I've installed scipy and statsmodels, but encounter an error when attempting to import statsmodels:
$ pip install scipy
$ pip install statsmodels
$ python
>>> import statsmodels as sm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pa354/software/miniconda3/lib/python3.7/site-packages/statsmodels/__init__.py", line 10, in <module>
from statsmodels.tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
File "/home/pa354/software/miniconda3/lib/python3.7/site-packages/statsmodels/tools/__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "/home/pa354/software/miniconda3/lib/python3.7/site-packages/statsmodels/tools/tools.py", line 8, in <module>
from scipy.linalg import svdvals
ModuleNotFoundError: No module named 'scipy.linalg'
Upgrade to the latest version of scipy with:
$ pip install scipy --upgrade
Related
I'm getting below error:
Traceback (most recent call last):
File "TicketGeneration_test.py", line 6, in <module>
from MysqlConnection import SQLConnection
File "/Users/ashish.kumar/MerchantRisk/June5th/reports/MysqlConnection.py", line 1, in <module>
import MySQLdb
ImportError: No module named MySQLdb
I've already tried :
pip install MySQL-python
pip install mysqlclient
My python version is Python 2.7.16
I'm using Python 3.6.3 on Windows 10 and Quandl module in my pip list, but I get the following error:
import quandl
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import quandl
File "C:\Users\Kamal\AppData\Local\Programs\Python\Python36-32\lib\quandl\__init__.py", line 3, in <module>
from .api_config import ApiConfig
ModuleNotFoundError: No module named 'quandl.api_config'
Try pip3 install quandl. If you have python2 installed, there may be a mismatch in symlinks related to pip.
I seem to have messed up my python install. I can't install new python packages:
$ pip install arq
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
And trying to address this error directly gives the same error:
$ pip install six
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
I'm not really sure what to do. All pip operations seem to fail for the same reason. pip freeze and just pip give the same result.
I'm on osx.
This is inspired by #Christian Dean's comment. But I am on OSX so what I did was to just reinstall pip from here:
http://pip.readthedocs.io/en/stable/installing/
Traceback (most recent call last):
File "C:/Python27/12.py", line 4, in <module>
from sklearn import preprocessing, cross_validation, svm
File "C:\Python27\lib\site-packages\sklearn\__init__.py", line 57, in <module>
from .base import clone
File "C:\Python27\lib\site-packages\sklearn\base.py", line 10, in <module>
from scipy import sparse
ImportError: No module named scipy
Please help me resolve this.
Install this package using:
easy_install scipy
or
sudo apt-get install python-scipy
or
pip install scipy
or
conda install scikit-learn
if you are using windows refer:
https://stackoverflow.com/a/39577864/6633975
https://stackoverflow.com/a/32064281/6633975
I'm trying to install a package using python setup.py build, but it fails when it cannot find setuptools.version. In fact:
import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/gpajer/anaconda/lib/python2.7/site- packages/setuptools/__init__.py", line 11, in <module>
import setuptools.version
ImportError: No module named version
Shouldn't there be a file .../anaconda/lib/python2.7/site-packages/setuptools/version.py? There is no such file. Any ideas?
From https://anaconda.org/anaconda/setuptools:
To install this package with conda run:
conda install -c anaconda setuptools=21.2.1