I have a homework to solve a delay differential equation using two packages, ddeint and pydelay. The problem is, I can't import pydelay to my program. It keeps saying that it can't import weave from scipy.
In [1]: import pydelay
Traceback (most recent call last):
File "<ipython-input-1-c7b60806236e>", line 1, in <module> import pydelay
File "c:\python27\lib\site-packages\pydelay\__init__.py", line 9, in <module> from _dde23 import dde23
File "c:\python27\lib\site-packages\pydelay\_dde23.py", line 32, in <module> from scipy import weave
ImportError: cannot import name weave
I use Windows 10 64 bit with Python 2.7, I write my program in Spyder 3.1.4. I have installed numpy 1.13.0+mkl so that I can install ddeint 0.1.2. I also have installed scipy 0.19.1 and weave 0.16.0. From what I've read, the new version of scipy doesn't have weave in it, and pydelay use weave from scipy, so I assume that my problem comes from that.
Is there any way for me to use pydelay with separated weave I've installed?
Related
I am struggling to rectify this error
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import soundfile as sf
Traceback (most recent call last):
File "<ipython-input-5-ae75db7b0c22>", line 4, in <module>
import soundfile as sf
File "...\appdata\local\programs\python\python37\lib\site-packages\soundfile.py", line 163, in <module>
_path, '_soundfile_data', _libname))
OSError: cannot load library 'c:\users\ishpreet\appdata\local\programs\python\python37\lib\site-packages\_soundfile_data\libsndfile64bit.dll': error 0x7e
It looks like your soundfile library is mis-installed, the Python code is present but it's just a wrapper for a native dll which is missing.
The library's community and bug tracker is generally the better place to look for these issues, and indeed it has an issue open indicating that pip 20 mis-installs soundfile (and others) as it grabs the pure-python package instead of the wheel with precompiled libraries.
You may want to either:
wait it out
explicitly install the proper wheel
downgrade to pip 19.3
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
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
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.
I am trying to run a python script which has the following statements:
import random as RD
import pylab as PL
import scipy as SP
import networkx as NX
Where can I download these packages?
I have installed these packages and I get the following error when I run my code
I am getting the following error when I run the code
Traceback (most recent call last):
File "C:\Documents and Settings\hplabs\Desktop\Dushyant\networkdemo.py", line 7, in <module>
import pylab as PL
File "C:\Python26\lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Python26\lib\site-packages\matplotlib\__init__.py", line 129, in <module>
from rcsetup import defaultParams, validate_backend, validate_toolbar
File "C:\Python26\lib\site-packages\matplotlib\rcsetup.py", line 19, in <module>
from matplotlib.colors import is_color_like
File "C:\Python26\lib\site-packages\matplotlib\colors.py", line 52, in <module>
import numpy as np
ImportError: No module named numpy
Here's a link to the non standard libraries. random is part of the standard library.
matplotlib
scipy
networkX
numpy (reuired by scipy)
'random' is shipped with the standard library
pylab and scipy are part of SciPy
Networkx is available here
random is a standard python library module, no need to install that.
pylab and scipy can be found on the SciPy site
networkx also has a site
BTW: These are all easily found using google.com
When installing Scipy, you also need to install numpy which it depends on. See here. You are getting the error because numpy is not installed on your system.