python image not found after paraview brew install - python

I am runing python scripts on mac and after a "brew install paraview" a lot of packages are not working anymore : import vtk, or import scipy.linalg ...
Here is for example one of the bug:
Would you have an idea how to fix this?
Traceback (most recent call last):
File "MV15.py", line 3, in <module>
import scipy.linalg as slin File "/usr/local/lib/python2.7/site-packages/scipy/linalg/__init__.py", line 159, in <module>
from .misc import * File "/usr/local/lib/python2.7/site-packages/scipy/linalg/misc.py", line 5, in <module>
from . import blas File "/usr/local/lib/python2.7/site-packages/scipy/linalg/blas.py", line 145, in <module>
from scipy.linalg import _fblas ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/linalg/_fblas.so, 2): Library not loaded: /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/libgfortran.3.dylib Referenced from: /usr/local/lib/python2.7/site-packages/scipy/linalg/_fblas.so Reason: image not found

Related

I am trying to import matplotlib in python in my system But it is showing me the below error

import matplotlib
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\__init__.py", line 174, in <module>
_check_versions()
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.
Open cmd and try pip install matplotlib
This will download and install the module.

from scipy.linalg import _fblas: ImportError: DLL load failed: The specified module could not be found

I did some changes on my Anaconda installation (I just uninstalled previous one, and installed a newer version). Now trying to run my code simply importing this:
from skimage.measure import compare_ssim
But it shows this error. How can I fix it? All searching didn't help. When I do this import on Anaconda Prompt, it doesn't complaint. But when I run this on Eclipse, it shows this error.
Traceback (most recent call last):
File "C:\Users\user\eclipse-workspace\project\hybrid.py", line 18, in <module>
from skimage.measure import compare_ssim
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\__init__.py", line 176, in <module>
from .util.lookfor import lookfor
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\util\__init__.py", line 12, in <module>
from ._montage import montage, montage2d
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\util\_montage.py", line 2, in <module>
from .. import exposure
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\exposure\__init__.py", line 1, in <module>
from .exposure import histogram, equalize_hist, \
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\exposure\exposure.py", line 4, in <module>
from ..color import rgb2gray
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\color\__init__.py", line 1, in <module>
from .colorconv import (convert_colorspace,
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\skimage\color\colorconv.py", line 59, in <module>
from scipy import linalg
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\linalg\__init__.py", line 190, in <module>
from .misc import *
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from .blas import get_blas_funcs
File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\linalg\blas.py", line 214, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed: The specified module could not be found.
Uninstalling and re-installing Numpy+mkl from here fixed, in my case.
My error arised from from scipy import signal. But it had given the same error as yours:
"from scipy.linalg import _fblas: ImportError: DLL load failed: The specified module could not be found"
I realized when I run this import on Anaconda Prompt, it doesn't complaint. But when I run this on Eclipse, it shows this error.
The simple solution was to add this to my PATH that helped fix the problem:
C:\Users\user\AppData\Local\Continuum\anaconda3\Library\bin

Python Anaconda: ImportError undefined symbol: ATL_cpttrsm

>>> import scipy.stats
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/__init__.py", line 334, in <module>
from .stats import *
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/stats.py", line 186, in <module>
from . import distributions
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/distributions.py", line 10, in <module>
from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/_distn_infrastructure.py", line 22, in <module>
from scipy import optimize
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/__init__.py", line 165, in <module>
from ._root import *
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/_root.py", line 20, in <module>
from . import nonlin
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/nonlin.py", line 122, in <module>
import scipy.sparse.linalg
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py", line 110, in <module>
from .dsolve import *
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/__init__.py", line 60, in <module>
from .linsolve import *
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/linsolve.py", line 10, in <module>
from . import _superlu
ImportError: /usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/_superlu.so: undefined symbol: ATL_cpttrsm
Importing scipy.stats gives the error above. I recently installed Python anaconda. I have tried reinstalling numpy and scipy but to no avail. I am using Ubuntu 14.04
The command "which -a python" gives the following lines as output :-
/home/abhishek/anaconda/bin/python
/usr/bin/python
You should unset PYTHONPATH. It is causing your Anaconda Python to pick up packages installed in /usr/local instead of just the Anaconda packages (which should work correctly).
It was pointed out to me that the scipy installation in /usr/local/ was broken and that I needed to uninstall it.
sudo pip uninstall scipy
This fixed the problem.

matplotlib says it needs libpng15, but I have libpng16

The problem is likely a configuration issue, because getting the installation correct on Macs seems to be tricky. I'm running Mavericks and matplotlib 1.4.x, yet when I open a Python 2.7.5 shell and import pylib, I get this error:
>>> import pylab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/pylab.py", line 230, in <module>
import matplotlib.finance
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/finance.py", line 38, in <module>
from matplotlib.collections import LineCollection, PolyCollection
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/collections.py", line 27, in <module>
import matplotlib.backend_bases as backend_bases
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backend_bases.py", line 55, in <module>
import matplotlib.textpath as textpath
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/textpath.py", line 22, in <module>
from matplotlib.mathtext import MathTextParser
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/mathtext.py", line 64, in <module>
import matplotlib._png as _png
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so, 2): Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so
Reason: image not found
I have libpng16 installed, but not libpng15.
I saw a hardcoded reference to libpng15 in _png.so.
Uninstall and install of matplotlib fixed the issue for me.
You can always moke it by generating a soft link like this
sudo ln -s /opt/X11/lib/libpng.dylib /usr/local/lib/libpng15.15.dylib
Not the cleaner solution but I haven't figure out why matplotlib stubbornly asks specifically for libpng15 and not any 15 or greater.

Error importing scipy.linalg on windows (python 3.3)

I am using python 3.3 on Windows. I downloaded scipy-0.13.2.win32-py3.3.exe from scipy-lib and installed it. However, when I tried to load scipy.linalg, interpreter displayed the following errors:
>>> import scipy.linalg
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import scipy.linalg
File "C:\Python33\lib\site-packages\scipy\linalg\__init__.py", line 157, in <module>
from .misc import *
File "C:\Python33\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from . import blas
File "C:\Python33\lib\site-packages\scipy\linalg\blas.py", line 131, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed: The specified module could not be found.
How can I resolve this issue? Between, I checked installed library modules on my PC with the github modules at linealg-scipy and they are latest, so no issue there, I guess.
To fix this issue in both Python 2.7/3, you can install scipy from here
It will work better than the version from this deposit.

Categories