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.
Related
I have python 3.10 installed on disk C: and Anaconda with Python 3.9 on disk D:. When I try importing numpy in jupyter, I get the following error.
>>> import numpy
Traceback (most recent call last):
File "C:\Python310\Lib\site-packages\numpy\core\__init__.py", line 23, in <module>
from . import multiarray
File "C:\Python310\Lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
from . import overrides
File "C:\Python310\Lib\site-packages\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python310\Lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import core
File "C:\Python310\Lib\site-packages\numpy\core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "D:\ProgramData\Anaconda3\python.exe"
* The NumPy version is: "1.23.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
Looks like Python interpreter from disk D: is looking for libraries in disk C:, and I suppose that the numpy file installed there is not compatible with python 3.9. I think it's because my PYTHONPATH is
>>> print("PYTHONPATH:", os.environ.get('PYTHONPATH'))
PYTHONPATH: C:\Python310\Lib\site-packages
But how do I change it so that Jupyter only looks for what's in Anaconda folder libraries and not break whatever I have on disk C:? I guess what I'm asking is, is it possible to have 2 PYTHONPATHs, one for Jupyter and one for whatever else? Would it be sufficient to just add Anaconda libraries folder to PYTHONPATH, or it would cause conflicts? Because how would Jupyter choose one path over the other?
I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. However having downloaded the package it is proving difficult to run. I'm getting the following error:
Traceback (most recent call last):
File "C:\launch.py", line 29, in <module>
from src.smcsquare import SMCsquare
File "C:\src\smcsquare.py", line 32, in <module>
from scipy.stats import norm
File "C:\Python34\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
from .stats import *
File "C:\Python34\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
import scipy.special as special
File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
The _ufuncs.pyd is there in the C:\Python34\lib\site-packages\scipy\special\ directory. I tried adding this to my PYTHONPATH but it made no difference. I have also tried so dll fixers but these have not helped.
Has anyone encountered this and did you find a solution?
As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using.
Next, the problem I was having was I forgot to download and install the extra "numpy+mkl" package per the instruction: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
So for me it was numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl, which I downloaded and then:
python -m pip install numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl
I had already installed the regular numpy package via pip, but I just installed this one over it and everything started working and has been fine so far.
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.
I am getting this error on this line:
from sklearn.ensemble import RandomForestClassifier
The error log is:
Traceback (most recent call last):
File "C:\workspace\KaggleDigits\KaggleDigits.py", line 5, in <module>
from sklearn.ensemble import RandomForestClassifier
File "C:\Python27\lib\site-packages\sklearn\ensemble\__init__.py", line 7, in <module>
from .forest import RandomForestClassifier
File "C:\Python27\lib\site-packages\sklearn\ensemble\forest.py", line 47, in <module>
from ..feature_selection.selector_mixin import SelectorMixin
File "C:\Python27\lib\site-packages\sklearn\feature_selection\__init__.py", line 7, in <module>
from .univariate_selection import chi2
File "C:\Python27\lib\site-packages\sklearn\feature_selection\univariate_selection.py", line 13, in <module>
from scipy import stats
File "C:\Python27\lib\site-packages\scipy\stats\__init__.py", line 320, in <module>
from .stats import *
File "C:\Python27\lib\site-packages\scipy\stats\stats.py", line 241, in <module>
import scipy.special as special
File "C:\Python27\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
After installing:
Python 2.7.4 for Windows x86-64
scipy-0.12.0.win-amd64-py2.7.exe (from here)
numpy-unoptimized-1.7.1.win-amd64-py2.7.exe (from here)
scikit-learn-0.13.1.win-amd64-py2.7.exe (from here)
Anybody know why this is happening and how to solve it ?
As Christoph Gohlke mentioned on his download page, the scikit-learn downloadable from his website requires Numpy-MKL. Therefore I made a mistake by using Numpy-Unoptimized.
The link to his Numpy-MKL is statically linked to the Intel's MKL and therefore you do not need any additional download (no need to download Intel's MKL).
This is a little late, but for those like me, download these from the official
Microsoft website.
After that restart your interpreter/console and it should work.
This problem happened to me when I use scipy 0.12. After I changed to scipy 0.11, the problem was gone.
I have recently moved to Python3.3 from python3.2. I installed Numpy 1.7.0 and Scipy 0.11.0. I am running all these on Scientific Linux 6.4.
But when I run:
from scipy import integrate
I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.3/site-packages/scipy/integrate/__init__.py", line 50, in <module>
from .quadrature import *
File "/usr/local/lib/python3.3/site-packages/scipy/integrate/quadrature.py", line 5, in <module>
from scipy.special.orthogonal import p_roots
File "/usr/local/lib/python3.3/site-packages/scipy/special/__init__.py", line 532, in <module>
from .lambertw import lambertw
File "lambertw.pyx", line 24, in init scipy.special.lambertw (scipy/special/lambertw.c:1588)
ValueError: level must be >= 0
So I installed Scipy 0.12.0c1, but the problem still remains. Could you please help me fix this issue?
Thank you very much in advance
The answer is that Scipy 0.11.0 is not compatible with Python 3.3.
You need to wait for 0.12.0, or download the release candidate version 0.12.0rc1, or recompile using the Cython fix mentioned in the comments above.
However, this bug is fixed in 0.12.0rc1. You most likely made a mistake in installing it --- there is no file called lambertw.c in 0.12.0rc1.