Opened 8 years ago

Closed 8 years ago

#526 closed defect (fixed)

python can't import matplotlib, matplotlib.pth is missing

Reported by: Andreas Müller Owned by: osgeo4w-dev@…
Priority: trivial Component: Package
Version: Keywords: python matplotlib
Cc:

Description

python can't import the modules under matplotlib, when using matplotlib_1.3.1 with python27 or python36, x86. It raises a ModulNotFoundError: No module named 'matplotlib'

Solution: add a file matplotlib.pth to site-packages which points to matplotlib-1.3.1-py2.7-win32.egg directory

please add this file to the matplotlib package!

Change History (3)

comment:1 by jef, 8 years ago

Not producable here:

64bit:

C:\OSGeo4W64>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> quit()

C:\OSGeo4W64>call py3_env.bat

C:\OSGeo4W64>SET PYTHONPATH=

C:\OSGeo4W64>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\OSGeo4W64>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem;C:\OSGEO4~1\apps\msys\bin

C:\OSGeo4W64>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> quit()

C:\OSGeo4W64>

32bit:

C:\OSGeo4W>python
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> quit()

C:\OSGeo4W>call py3_env.bat

C:\OSGeo4W>SET PYTHONPATH=

C:\OSGeo4W>SET PYTHONHOME=C:\OSGeo4W\\apps\Python36

C:\OSGeo4W>PATH C:\OSGeo4W\\apps\Python36;C:\OSGeo4W\\apps\Python36\Scripts;C:\OSGeo4W\\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\OSGeo4W\\apps\Python27\Scripts

C:\OSGeo4W>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> quit()

comment:2 by Andreas Müller, 8 years ago

jef, first: thank you for your quick response! You are right, checked it twice, i had a muddle.

But in my special case, i now realized that there are at least two packages that contain a file "easy-install.pth": setuptools and matplotlib. I don't know how this works while importing something else, but matplotlibs "path" is part of the file - so i think i was close ;-). Therefore, if you install setuptools after matplotlib, the former easy-install.pth is overwritten and matplotlib can't be imported anymore!

Last edited 8 years ago by jef (previous) (diff)

comment:3 by jef, 8 years ago

Resolution: fixed
Status: newclosed

matplotlib updated to 2.0.0 (w/o easy-install.pth).

Note: See TracTickets for help on using tickets.