Hi Martin,

Here are the results of my experiments to try to get the simple statement "import matplotlib" working. As advised I used the spec file generated by pyinstaller 1.5.1 makespec.py as my starting point. The python script is called mymatplotlib.py and includes only the line:
    import matplotlib
The executable always gets made but there is always the error - "RuntimeError: Path in environment MATPLOTLIBDATA not a directory". The same error occurs whether I'm using Matplotlib 0.99.1 or 1.1.0. The error occurs in _get_data_path() in matplotlib\__init__.py

The original mymatplotlib.spec made using makespec.py was as follows:
# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), 'mymatplotlib.py'],
             pathex=['C:\\Python26\\pyinstaller-1.5.1'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=1,
name=os.path.join('build\\pyi.win32\\mymatplotlib', 'mymatplotlib.exe'),
          debug=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT( exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               name=os.path.join('dist', 'mymatplotlib'))

The following changes do not prevent the runtime error (NB I have not tried every possible combination ;-)):

* deleting coll = COLLECT(...)
* changing upx to False in EXE(...)
* including a.binaries in EXE(...)
* changing exclude_binaries to False in EXE(...)
* changing matplotlib version from 0.99.1 to 1.1.0
* adding hookspath=[os.path.join(HOMEPATH,'hooks')]

Does anyone have any ideas? I have tried to strip everything down to the simplest level possible.


All the best, Grant


On 08/12/11 15:46, Grant Paton-Simpson wrote:
Hi Martin,

Thanks for that. I have used pyinstaller 1.5.1 to make an initial spec file and I have been able to modify that spec file to make exes without getting the original error. The remaining problem seems to be matplotlib - more specifically, it can't find the mpl-data folder. I think the sole reason my earlier script produced an exe which worked on my dev machine but not a clean install was that the dev machine contained the mpl-data in the path the exe was looking for it in.

I have looked at the path my exe was expecting the mpl-data when testing it on the clean XP machine ("C:\DOCUME~1\GRANTP~1\LOCALS~1\Temp\_MEI8802") and nothing was there.

Problems with matplotlib of this sort should be fixed by the new hooks but I still seem to have a problem.

I'll keep trying things but any tips would be appreciated. I feel the solution is very close but slightly out of reach ;-)


All the best, Grant


On 06/12/11 11:13, Martin Zibricky wrote:
Grant Paton-Simpson píše v Út 06. 12. 2011 v 08:34 +1300:
Are there any experiments I can run to make the cause more obvious.
Thanks in advance.
Hi,

My advice would be to try recreate .spec file directly with pyinstaller
1.5.1 or with current svn trunk.



--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to