Using the 64 bit version of python 2.6, I installed the unofficial 64 bit scipy module from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy. I tried running a script that specifically uses the scipy.ndimage module, which leads to this error:
Traceback (most recent call last):
File "PhantomAnalysis.py", line 79, in <module>
import scipy.ndimage
File "C:\Python26\lib\site-packages\scipy\ndimage\__init__.py", line 175, in <
module>
from .measurements import *
File "C:\Python26\lib\site-packages\scipy\ndimage\measurements.py", line 36, i
n <module>
from . import _ni_label
ImportError: DLL load failed: The specified procedure could not be found.
I'm just not able to import scipy.ndimage at all using those packages. Is this an issue with the package or with my installation/configuration?
I can provide any other relevant information.
Related
I can import numpy with no issues. However, when trying to import easyocr I'm getting the following error:
>>> %Run numpytst.py
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/numpytst.py", line 2, in <module>
import easyocr
File "/home/pi/.local/lib/python3.7/site-packages/easyocr/__init__.py", line 1, in <module>
from .easyocr import Reader
File "/home/pi/.local/lib/python3.7/site-packages/easyocr/easyocr.py", line 3, in <module>
from .detection import get_detector, get_textbox
File "/home/pi/.local/lib/python3.7/site-packages/easyocr/detection.py", line 9, in <module>
from .craft_utils import getDetBoxes, adjustResultCoordinates
File "/home/pi/.local/lib/python3.7/site-packages/easyocr/craft_utils.py", line 10, in <module>
from scipy.ndimage import label
File "/home/pi/.local/lib/python3.7/site-packages/scipy/ndimage/__init__.py", line 151, in <module>
from .filters import *
File "/home/pi/.local/lib/python3.7/site-packages/scipy/ndimage/filters.py", line 37, in <module>
from . import _nd_image
ImportError: numpy.core.multiarray failed to import
Environment:
Raspberry Pi 3B
Python 3.7.3
numpy 1.16.6
Have you tried to upgrade to a more recent version? like 1.20.x. I solved a similar Error by simply upgrading my NumPy to ver 1.20.3.
The reason could be the mismatch between dependencies. This worked for me:
pip install numpy --upgrade
When I use pycharm to run my code with from scipy import stats:
Importerror occurs: DLL load failed: The specified procedure could not be found.
Platform: Anaconda, python 3.7
IDE: pycharm, Microsoft VS code
Anaconda is installed in D:\Anaconda
The scipy package is installed properly. The code can be run successfully in Jupyter.
I have tried the similar questions, but no one can help. Can anybody give me some help to fix it?
I have also reinstalled Anaconda, however, it still faied.
From scipy import stats:
Traceback (most recent call last): ...from scipy import stats File
"D:\Anaconda3\lib\site-packages\scipy\stats__init__.py", line 345, in
from .stats import * File "D:\Anaconda3\lib\site-packages\scipy\stats\stats.py", line 171, in
from . import distributions File "D:\Anaconda3\lib\site-packages\scipy\stats\distributions.py", line
10, in
from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous, File
"D:\Anaconda3\lib\site-packages\scipy\stats_distn_infrastructure.py",
line 24, in
from scipy import optimize File "D:\Anaconda3\lib\site-packages\scipy\optimize__init__.py", line 271,
in
from ._minimize import * File "D:\Anaconda3\lib\site-packages\scipy\optimize_minimize.py", line 21,
in
from scipy.sparse.linalg import LinearOperator File "D:\Anaconda3\lib\site-packages\scipy\sparse\linalg__init__.py", line
117, in
from .eigen import * File "D:\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen__init__.py",
line 11, in
from .arpack import * File "D:\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack__init__.py",
line 22, in
from .arpack import * File "D:\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py",
line 45, in
from . import _arpack ImportError: DLL load failed: The specified procedure could not be found.
enter image description here
I solved it!
I think there must be something wrong in Scipy packages in Conda, so I remove all the packages related to Ski-learn, and download from "https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy".
Choose numpy+whl Scipy ski-learn(corresponding edition) after downloading and install it by pip.
I presently have Python 2.7 installed, and have been attempting to get my pygeoprocessing module to work correctly (which appears to have been installed correctly). This is the version of Idle Python I am running:
"Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32"
When I type in "import pygeoprocessing" from the Idle command line, this is the error message . . .
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pygeoprocessing
File "C:\Python27\ArcGISx6410.4\lib\site-packages\pygeoprocessing\__init__.py", line 10, in <module>
from geoprocessing import *
File "C:\Python27\ArcGISx6410.4\lib\site-packages\pygeoprocessing\geoprocessing.py", line 25, in <module>
import scipy.interpolate
File "C:\Python27\ArcGISx6410.4\lib\site-packages\scipy\interpolate\__init__.py", line 160, in <module>
from .interpolate import *
File "C:\Python27\ArcGISx6410.4\lib\site-packages\scipy\interpolate\interpolate.py", line 15, in <module>
import scipy.linalg
File "C:\Python27\ArcGISx6410.4\lib\site-packages\scipy\linalg\__init__.py", line 161, in <module>
from .misc import *
File "C:\Python27\ArcGISx6410.4\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from . import blas
***File "C:\Python27\ArcGISx6410.4\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.
When I navigated to the folder mentioned ( . . . scipy\linalg\blas.py) I found that both blas.py and _fblas were present. Therefore I don't know why I got that last import error.
Is there something I can check?
Thanks!
Since you are on a windows box you may want to verify whether you have the 64-bit or the 32-bit version of python installed. That has caused problems for me in the past.
If the above listed methods do not work, try installing the module with pip.
And then try importing it.
C.f. How do I install pip on Windows?
I need to use numpy for python 3.2 (i'm using 3.2.5).
I've installed numpy 1.8.2 via the .msi for python 3.2, and i tried running some basic things :
import numpy as np
x = np.array([[1,2],[3,4]])
print(x)
There's the console output :
Traceback (most recent call last):
File "C:/Users/Askerad/PycharmProjects/untitled/main.py", line 3, in <module>
from numpy import *
File "C:\Python32\lib\site-packages\numpy\__init__.py", line 153, in <module>
from . import add_newdocs
File "C:\Python32\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python32\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python32\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python32\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.
(the french part says : '%1 isn't a valid Win32 application')
i don't know what to do to make numpy work.
Edit : Changed the code just as Sarens said
You have an architecture mismatch, you need to install a 32bit binary from that link as you are using a 32 bit version of python, I would upgrade python to the latest version 3.4 and use a 64 bit version of python then you can install 64bit binaries. The latest version of numpy is also 1.9.2.
I used to have scipy.fftpack available on 32-bit Python 2.7, but now that I upgraded to 64-bit Python and got SciPy from here, I noticed it doesn't seem to include FFTPack.
Where can I download it?
Oh, and the error is:
>>> import scipy.fftpack
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python 2.7\lib\site-packages\scipy\fftpack\__init__.py", line 95, in <module>
from basic import *
File "C:\Program Files\Python 2.7\lib\site-packages\scipy\fftpack\basic.py", line 11, in <module>
import _fftpack
ImportError: DLL load failed: The specified module could not be found.
>>>
Never mind, ProcMon helped me finally figure it out.
It turns out that that version does include FFTPack, but does not include libmmd.dll, which seems to (?) be part of Intel's Math Kernel Library.
If you have the library available in your PATH then it should indeed work.