DLL load failed while importing _arpack from scipy.integrate - python

I am trying to import solve_ivp from scipy.intgrate
from scipy.integrate import solve_ivp as odesolver
and i got this error:
line 9, in <module>
from scipy.integrate import solve_ivp as odesolver
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\integrate\__init__.py", line 94, in <module>
from ._bvp import solve_bvp
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\integrate\_bvp.py", line 8, in <module>
from scipy.sparse.linalg import splu
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module>
from .eigen import *
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py", line 9, in <module>
from .arpack import *
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py", line 20, in <module>
from .arpack import *
File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 42, in <module>
from . import _arpack
ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.
i am trying to reinstall anaconda but it didn't work
i have tried to reinstall scipy using pip install but still got the error
any idea how to solve this error?
thank you in advance

This might be a wild guess but it seems anaconda has some issue with scipy.
May I suggest you the good ol' trick of reinstalling the dependencies ?
conda remove --force numpy scipy
pip install numpy scipy
They had an issue open for a while on anaconda's github, if you fancy the read.

Related

IDE when import scipy, ImportError: DLL load failed: The specified procedure could not be found

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.

R - Reticulate won't work with numpy

I'm trying to use the Reticulate package to use Python through R. I successfully connected Reticulate to Python 3.6 with Sys.setenv(RETICULATE_PYTHON = "/usr/local/bin/python3"). Then after noticing that my Python 3.6 didn't have Numpy, I used entered pip3 install numpy into the command line and installed it. Now, I am having the following problem with Reticulate when I call py_config():
py_config()
Error in py_run_string_impl(paste0("import sys; sys.path.append('", system.file("python", :
ImportError: cannot import name 'dtype'
Detailed traceback:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/__init__.py", line 35, in <module>
from . import _internal # for freeze programs
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nump
Uninstalling Numpy fixes the problem, but then I don't have Numpy. :(
Can anyone tell me what's going on and how I can fix it?

SciPy compatibility issue with MKL libraries

I recently installed SciPy for Python3.4 on Ubuntu 12.04 with
pip3 install scipy
When I import scipy in Python3.4 as:
import scipy
it imports, but when I import the function interpolate as
import scipy.interpolate
I get the following error:
File "test.py", line 55, in <module>
import scipy.interpolate
File "/home//.pyenv/versions/3.4.1/lib/python3.4/site-packages/scipy/interpolate/__init__.py", line 158, in <module>
from .interpolate import *
File "/home/nxkr/.pyenv/versions/3.4.1/lib/python3.4/site-packages/scipy/interpolate/interpolate.py", line 11, in <module>
import scipy.linalg
File "/home/nxkr/.pyenv/versions/3.4.1/lib/python3.4/site-packages/scipy/linalg/__init__.py", line 175, in <module>
from .basic import *
File "/home/nxkr/.pyenv/versions/3.4.1/lib/python3.4/site-packages/scipy/linalg/basic.py", line 21, in <module>
from ._solve_toeplitz import levinson
ImportError: /home/nxkr/.pyenv/versions/3.4.1/lib/python3.4/site-packages/scipy/linalg/_solve_toeplitz.cpython-34m.so: undefined symbol: _intel_fast_memcpy
How to fix this error in Python3?
Numpy and Scipy are popular packages. You probably can find them in Ubuntu repository. So it's better to install them with apt-get but not pip.
If you want MKL support, I would suggest anaconda - a full Python distribution with MKL and other acceleration libraries integrated such as CUDA. This will make your life easier.
https://www.continuum.io/downloads

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

ImportError: cannot import name doccer

I just installed python xy 2.7.9 on Windows 7. I went to run some previously written code in Spyder which calls:
from scipy.sparse import linalg as sla
However, I get the following error:
File "C:\Python27\lib\site-packages\scipy\sparse\linalg\__init__.py", line 113, in <module>
from .matfuncs import *
File "C:\Python27\lib\site-packages\scipy\sparse\linalg\matfuncs.py", line 20, in <module>
import scipy.misc
File "C:\Python27\lib\site-packages\scipy\misc\__init__.py", line 44, in <module>
from . import doccer
ImportError: cannot import name doccer
Does anyone know how to fix this? I find this weird because it worked with my previous copy of Python (which I uninstalled before installing the new version).
Thanks!
What worked for me is moving doccer.py from "misc" folder to "_lib" folder (which are in path /usr/lib/python3/dist-packages/scipy/ for me).
I found this in a release note of scipy : https://github.com/scipy/scipy/pull/9652

Categories

Resources