我无法导入MySQLdb
我试过了:
sudo apt-get install python-mysqldb
但我仍然无法导入它。
我在使用并行的Macbook上使用Ubuntu 14.04。
使用评论进行诊断:
pip freeze
abstract-rendering==0.5.1
alabaster==0.7.3
argcomplete==0.8.9
astropy==1.0.3
Babel==1.3
backports.ssl-match-hostname==3.4.0.2
bcolz==0.9.0
beautifulsoup4==4.3.2
binstar==0.11.0
bitarray==0.8.1
blaze==0.8.0
blz==0.6.2
bokeh==0.9.0
boto==2.38.0
Bottleneck==1.0.0
cdecimal==2.3
certifi==14.5.14
cffi==1.1.0
clyent==0.3.4
colorama==0.3.3
conda==3.14.1
conda-build==1.14.1
conda-env==2.2.3
configobj==5.0.6
cryptography==0.9.1
Cython==0.22.1
cytoolz==0.7.3
datashape==0.4.5
decorator==3.4.2
docutils==0.12
enum34==1.0.4
fastcache==1.0.2
Flask==0.10.1
funcsigs==0.4
gevent==1.0.1
gevent-websocket==0.9.3
greenlet==0.4.7
grin==1.2.1
h5py==2.5.0
idna==2.0
ipaddress==1.0.7
ipython==3.2.0
itsdangerous==0.24
jdcal==1.0
jedi==0.8.1
Jinja2==2.7.3
jsonschema==2.4.0
llvmlite==0.5.0
lxml==3.4.4
MarkupSafe==0.23
matplotlib==1.4.3
mistune==0.5.1
mock==1.0.1
multipledispatch==0.4.7
networkx==1.9.1
nltk==3.0.3
nose==1.3.7
numba==0.19.1
numexpr==2.4.3
numpy==1.9.2
odo==0.3.2
openpyxl==1.8.5
pandas==0.16.2
patsy==0.3.0
pep8==1.6.2
Pillow==2.8.2
ply==3.6
psutil==2.2.1
ptyprocess==0.4
py==1.4.27
pyasn1==0.1.7
pycosat==0.6.1
pycparser==2.14
pycrypto==2.6.1
pycurl==7.19.5.1
pyflakes==0.9.2
Pygments==2.0.2
pyOpenSSL==0.15.1
pyparsing==2.0.3
pytest==2.7.1
python-dateutil==2.4.2
pytz==2015.4
PyYAML==3.11
pyzmq==14.7.0
redis==2.10.3
requests==2.7.0
rope==0.9.4
runipy==0.1.3
scikit-image==0.11.3
scikit-learn==0.16.1
scipy==0.15.1
six==1.9.0
snowballstemmer==1.2.0
sockjs-tornado==1.0.1
Sphinx==1.3.1
sphinx-rtd-theme==0.1.7
spyder==2.3.5.2
SQLAlchemy==1.0.5
statsmodels==0.6.1
sympy==0.7.6
tables==3.2.0
terminado==0.5
Theano==0.7.0
toolz==0.7.2
tornado==4.2
ujson==1.33
unicodecsv==0.9.4
Werkzeug==0.10.4
xlrd==0.9.3
XlsxWriter==0.7.3
xlwt==1.0.0
答案 0 :(得分:1)
也许您应该首先安装MYSQL
环境。
sudo apt-get install mysql-client
然后将以下行添加到.bash_profile
。
export PATH=/path/to/install/mysql/bin:$PATH
export LD_LIBRARY_PATH=/path/to/install/mysql/lib/mysql:$LD_LIBRARY_PATH
然后source .bash_profile
。