简体   繁体   中英

Cannot install modules with anaconda installed

I installed anaconda a little while ago. Later I installed django . Django was the first program I could install successfully and run without error.

I just tried to install mysqldb with the following:

sudo apt-get install python-mysqldb

and it gave following message:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-mysqldb is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.5.0-17 linux-headers-3.5.0-17-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

If I run a django app configure to have a mysql back-end I get

ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

I think this has something to do with having anaconda installed. I'm running on ubuntu OS.

Does anyone know how I can get mysqldb module to get recognized by django ?

It looks like all my anaconda modules are in:

/home/aiden/anaconda/lib/python2.7

I think my django lives in:

/home/aiden/django/

and i searched for mysqldb and found a file under anaconda:

/home/aiden/anaconda/lib/python2.7/site-packages/sqlalchemy/something.../drizzle/mysqldb.py

I don't know how to check where I installed things to, but I think that mysqldb isn't getting installed b/c it's already somewhere in anaconda

apt-get is going to install things into the system Python. To install things into Anaconda, you need to use the conda package manager, assuming the package is build for conda already, or else build from source. You can also try to find the package on binstar.org if there isn't one in conda already.

I just ran a "conda install bottle" but it didn't have the package available, but it automatically installed bottle using pip. This works fine. Anaconda is great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM