PyDSTool with anaconda not installing properly - python-2.7

I am trying to install PyDSTool with anaconda2 (conda install PyDSTool), which seems to go well. But when I open spyder and import PyDSTool, it gives me error
import PyDSTool
Traceback (most recent call last):
File "<ipython-input-1-a214100b00aa>", line 1, in <module>
import PyDSTool
File "/home/user/anaconda2/lib/python2.7/site-packages/PyDSTool/__init__.py", line 76, in <module>
raise RuntimeError("SciPy v0.5.1 or above is required")
RuntimeError: SciPy v0.5.1 or above is required
I tried to change parseUtils.py as per this suggestion: import of package PyDSTool doesn't work
but still the same error. I certainly have SciPy 1.0 and python 2.7.

I ran into this problem recently. The accepted answer here (PyDSTool do not recognize SciPy version) is still effective today at solving this problem.
Basically download PyDSTool from here (https://github.com/tkf/pydstool/tree/tkf) instead of sourceforge.

Related

Why xlsxwriter module does not work like other modules?

Traceback (most recent call last):
File "F:TC.py", line 1, in <module>
import xlsxwriter
ImportError: No module named xlsxwriter
I am getting this error even after trying every possible answer given to this problem earlier.
I am using python 2.7 in windows
I have installed xlsxwriter using pip
I have tried reinstalling python shell but it doesn't work.

numpy and pandas breaking after installing biopython on spyder anaconda

I'm using spyder 2 anaconda 2.3.0 on windows as a python IDE for python 2.7. I've been using this for a long time to code in python but suddenly I don't know what happened and it said I did not have biopython package installed, when I installed biopython using
conda -c install anaconda biopython
command, biopython started running however it broke pandas and numpy.
now when I import pandas I get this:
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\pandas\__init__.py", line 13, in
<module>
"extensions first.".format(module))
ImportError: C extension: hashtable not built. If you want to import pandas
from the source directory, you may need to run 'python setup.py build_ext --
inplace' to build the C extensions first.
and then when I import numpy I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Anaconda\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Anaconda\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Anaconda\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Anaconda\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
I uninstalled numpy and pandas and then installed them back using pip ... still the same. I entirely unistalled anaconda and installed it back still the same errors. I really do not know what's causing this. Any help will be truly appreciated. I've been trying to fix this for the past three days and its not working out. Thanks for your time.

ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

Possible duplicate of this question.
I have a gpu account to whom I connect through putty (ssh login). I have created a virtualenv there and I am installing tenorflow through pip for gpu. Everything works fine, when I run command
$ pip list
following list is being shown:
backports.weakref (1.0rc1)
bleach (1.5.0)
funcsigs (1.0.2)
html5lib (0.9999999)
Markdown (2.6.8)
mock (2.0.0)
numpy (1.13.1)
olefile (0.44)
pbr (3.1.1)
Pillow (4.2.1)
pip (9.0.1)
protobuf (3.3.0)
setuptools (36.0.1)
six (1.10.0)
tensorflow-gpu (1.2.1)
Werkzeug (0.12.2)
wheel (0.29.0)
But when I run:
$ python
>>> import tensorflow
It shows the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
<module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/nauman/junaid/final/test/lib/python2.7/site-
packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in
swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,
description)
ImportError: libcusolver.so.8.0: cannot open shared object file: No such
file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
I have also set my environment variables like this:
export CUDA_HOME=/opt/cuda
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
Moreover, I found that libcusolver.so.8.0 is not there, while libcusolver.so.7.5
is there in cuda/lib64/.
Somehow tensorflow is finding wrong file or I ain't know nothing.
Any help would be appreciated as I am new to all this stuff.
Python version: 2.7
OS: Linux
This may be connected to the incorrect linking of your libraries.
Simply run sudo ldconfig /usr/local/cuda/lib64. It solved for me.
If you need to know more: ldconfig man page.
I solved the issue. Actually I have cuda 7.5 installed and I was installing latest tensorflow version which probably support cuda 8.0.
So I downgraded.
pip install --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
If you installed tensorflow-gpu by using pip with prebuilt .whl, the cuda version were fixed. As far as I know, starting 0.11.0rc1, all the prebuilt packages are now built for cuda 8. So there are two ways to solve the problem:
install cuda 8 for the prebuilt packages tensorflow-gpu >= 0.11.orc1
keep cuda 7.5 stay, then build tensorflow-gpu from source code
If you are using cuda-9.0 try sudo apt install nvidia-cuda-dev (if you are using an Ubuntu distribution)

How can I import the csvsql to Python 2.7

I have successfuly installed csvkit using conda install ...
However, when I try to import the libraries in Python 2.7 Spyder, I get error messages:
import csvsql
Traceback (most recent call last):
File "<ipython-input-5-303a60a6b1ac>", line 1, in <module>
import csvsql
ImportError: No module named csvsql
import csvkit
Traceback (most recent call last):
File "<ipython-input-7-ca8a99ae9834>", line 1, in <module>
import csvkit
ImportError: No module named csvkit
I looked at the documentation -- they describe the installation process but not how the library is loaded in Python.
Moreover, I had an analogous problem with httplib2. I installed it successfuly but when I tried to import it in Spyder I received an analogous error message (No module named httplib2).
(I use Anaconda 3 and Spyder on Windows 11)
Any ideas? Thank you in advance.
I asked this question on the csvkit GitHub / issues forum.
The answer given was: You should use agate on which csvkit now relies for all its operations. See https://github.com/wireservice/agate.
I'm with you -- it would be wonderful to use csvkit as a command-line tool and a library, but it's authors don't see it that way. The full issue: https://github.com/wireservice/csvkit/issues/670

How to properly install sklearn on Eclipse

I recently came across a blog(http://stronginference.com/ScipySuperpack/) on how to install sklearn . I successfully installed it and it was stored on the path:
/usr/local/lib/python2.7/site-packages/sklearn
I then went to the properties of my eclipse; under the Interpreter-Python and added the path to the PYTHONPATH. I could import sklearn but when I ran this simple code to test everything:
from sklearn import datasets
iris = datasets.load_iris()
digits = datasets.load_digits()
print digits.data
It threw the following errors:
Traceback (most recent call last):
File "/Users/licheng/Documents/workspaceII/SkLearnTutorial/Src/my_first_scilearn.py", line 6, in <module>
from sklearn import datasets
File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/__init__.py", line 7, in <module>
from .base import load_diabetes
File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/base.py", line 24, in <module>
from ..utils import check_random_state
File "/usr/local/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module>
from .murmurhash import murmurhash3_32
File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (/private/var/folders/fv/vhs3w0zn2q961_gyp8f2z_rw0000gn/T/pip-EVsI8B-build/sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
any help on what could be wrong? I have been on these for hours now.
Thanks
Try uninstalling NumPy, SciPy and scikit-learn.
Then reinstall those packages.
If you are using Windows, binaries for those packages have been provided by Christoph Gohlke, which can be quite convenient. Just download them and then use pip to install.
Unofficial Windows Binaries for Python Extension Packages