Python 2.5.... MatPlotLib doesn't install PyLab - python

I have NumPy and SciPy installed and working. I'm using Python 2.5 (MIT Intro to Programming course) so I've been installing the packages with .exe files instead of Pip or Anaconda. With MatPlotLib, I get the following errors during installation:
could not create: matplotlib-py2.5
could not create: python 2.5 matplotlib-1.0.0
could not set key value: "C:\Python25\Removematplotlib.exe" -u "C:\Python25\matplotlib-wininst.log"
I have a MatPlotLib folder in Python's Lib/site-packages directory. Importing matplotlib into IDLE works fine. But when I try to import pylab:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pylab
File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 216, in <module>
from matplotlib import mpl # pulls in most modules
File "C:\Python25\Lib\site-packages\matplotlib\mpl.py", line 1, in <module>
from matplotlib import artist
File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 6, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
File "C:\Python25\Lib\site-packages\matplotlib\transforms.py", line 34, in <module>
from matplotlib._path import affine_transform
ImportError: DLL load failed: The specified module could not be found.
I've looked around on different message boards but can't find anyone else with this issue.
Any ideas?

Related

ImportError: DLL load failed while importing _path: The specified module could not be found

When I was trying to import matplotlib, I wrote
import matplotlib.pyplot as plt
in my code.
and this error occured.
Traceback (most recent call last):
File "C:\aiProjects\opencv\test.py", line 2, in <module>
import matplotlib.pyplot as plt
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\__init__.py", line 113, in <module>
from . import _api, _version, cbook, _docstring, rcsetup
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
from matplotlib.colors import Colormap, is_color_like
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\colors.py", line 56, in <module>
from matplotlib import _api, _cm, cbook, scale
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
from matplotlib.ticker import (
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\ticker.py", line 138, in <module>
from matplotlib import transforms as mtransforms
File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
Process finished with exit code 1
I tried several ways such as reinstalling matplotlib and pasting new "Msvcp71.dll" and "Msvcr71.dll" files in my system folders. Anyways to solve this problem?
... reinstall the matplotlib python package with this argument --ignore-installed:
pip3 install matplotlib --user --ignore-installed

Python new ImportError in matplotlib : cannot import name _string_to_bool [duplicate]

I am using pycharm for python in windows 8. I have installed the package matplotlib.
I am using python 2.7
when i do import matplotlib there is no error.
However if i do matplotlib.pyplot as plt i am getting this following errors:
Traceback (most recent call last):
File "C:/Users/PiyushSudip/PycharmProjects/myFirst/test1.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 23, in <module>
from matplotlib.figure import Figure, figaspect
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 18, in <module>
from axes import Axes, SubplotBase, subplot_class_factory
File "C:\Python27\lib\site-packages\matplotlib\axes\__init__.py", line 4, in <module>
from ._subplots import *
File "C:\Python27\lib\site-packages\matplotlib\axes\_subplots.py", line 10, in <module>
from matplotlib.axes._axes import Axes
File "C:\Python27\lib\site-packages\matplotlib\axes\_axes.py", line 18, in <module>
from matplotlib.cbook import _string_to_bool, mplDeprecation
ImportError: cannot import name _string_to_bool
can anyone help figure out what i am doing wrong?
http://matplotlib.org/users/installing.html#required-dependencies
There is a package called six which matplotlib depends on. Check to make sure it's installed, or install it from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#six
This site has packaged versions of many python modules which are easy to setup on windows, just download and run.
Also check the other dependencies to make sure you have them all, otherwise you might get another error for a different module

pip install of statsmodels is not working. DLL load failed: The specified module could not be found

I am really new to python and I am trying to install the statsmodels module. It seems that since I am on a 64 bits I need to use the following unofficial website http://www.lfd.uci.edu/ I did all I know about how to download a whl and I did download it and used the pip afterwards and all work fine. now when I do pip install statsmodels it work fine. However, in my shell after I try import the stats models I am getting
import statsmodels
Traceback (most recent call last): File "<pyshell#7>", line 1, in <module>
import statsmodels File "D:\Python34\lib\site-packages\statsmodels\__init__.py", line 8, in <module>
from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning, File "D:\Python34\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical File "D:\Python34\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.linalg import svdvals File "D:\Python34\lib\site-packages\scipy\linalg\__init__.py", line 174, in <module>
from .misc import * File "D:\Python34\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from .blas import get_blas_funcs File "D:\Python34\lib\site-packages\scipy\linalg\blas.py", line 155, in <module>
from scipy.linalg import _fblas ImportError: DLL load failed: The specified module could not be found.
Any help would be much appreciated.
Thank you in advance

running a python script that requires matplotlib gives: ImportError: undefined symbol: __libm_sse2_sincos

A specific package that I'm trying to run is fastStructure. After installing all the requirements (numpy, scipy, cython, gsl, matplotlib), when I try to execute the script I get the following error:
python distruct.py
Traceback (most recent call last):
File "distruct.py", line 2, in <module>
import matplotlib.pyplot as plot
File "/data003/GIF/software/packages/python/2.7.9/lib/python2.7/site-packages/matplotlib/pyplot.py", line 24, in <module>
import matplotlib.colorbar
File "/data003/GIF/software/packages/python/2.7.9/lib/python2.7/site-packages/matplotlib/colorbar.py", line 27, in <module>
import matplotlib.artist as martist
File "/data003/GIF/software/packages/python/2.7.9/lib/python2.7/site-packages/matplotlib/artist.py", line 8, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, \
File "/data003/GIF/software/packages/python/2.7.9/lib/python2.7/site-packages/matplotlib/transforms.py", line 35, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: /data003/GIF/software/packages/python/2.7.9/lib/python2.7/site-packages/matplotlib/_path.so: undefined symbol: __libm_sse2_sincos
Does this mean that some of the requirements weren't properly installed? or Am I missing some of the basic packages that are supposed to be there on all computers?
If it helps I am on a large HPC cluster, running RHEL with intel processors.
I am unable to find any information about this error and I am unable to move forward. Any help will be greatly appreciated.
EDIT:
Specifically,
import matplotlib.pyplot as plot
is what causing this error.

ImportError: cannot import name flib

I want to use Python for trying out hddm.
I installed anaconda, Python 2.7. When I try to follow the hddm tutorial in the command line window in spyder, the following happens, which seems to be a problem in pymc:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import hddm
Traceback (most recent call last):
File "<ipython-input-24-17365318b31c>", line 1, in <module>
import hddm
File "/Users/c/anaconda/lib/python2.7/site-packages/hddm/__init__.py", line 7, in <module>
import likelihoods
File "/Users/c/anaconda/lib/python2.7/site-packages/hddm/likelihoods.py", line 2, in <module>
import pymc as pm
File "/Users/c/anaconda/lib/python2.7/site-packages/pymc/__init__.py", line 31, in <module>
from .distributions import *
File "/Users/c/anaconda/lib/python2.7/site-packages/pymc/distributions.py", line 30, in <module>
from . import flib, utils
ImportError: cannot import name flib
I work on Mac OS X 10.7. On the web, I find some comments concerning pymc possibly not being compiled with the correct version of gfortran, but the solutions all seem to be for windows. Also, I thought that this kind of problem should not happen with an integrated system like Anaconda?
There are two options:
use conda install -c conda.binstar.org/pymc pymc
install gfortran and use pip install -U pymc

Categories

Resources