简体   繁体   中英

Importing Packages in Ipython Notebook

When I try and import BeautifulSoup into IPython Notebook I get an error message: ImportError: No module named BeautifulSoup . The package is installed and works perfectly in IDLE. When I check system version, it returns 2.7.5 |Anaconda 1.7.0 (64-bit)| (default, Jul 1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] 2.7.5 |Anaconda 1.7.0 (64-bit)| (default, Jul 1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] . This would seem to be the same version of python I run in IDLE, though minus the Anaconda. How can I fix this problem?

There are two possible answers to your question. If you have no need for running multiple copies of Python running different modules, you can simply change all instances of the string "Python27" in your PATH to "Anaconda" (assuming you want to run the Anaconda Python) as suggested in the comments.

Alternately, if you want to run different combinations of modules in two copies of the same version of Python, you can segregate/partition the modules you install into Anaconda/default Python versions. If you install using Windows installer, just make sure both versions of Python are in the registry (they should be by default) and the install wizard should allow you to choose where you want to install it. You can also individually install modules from their source code, adding them to "C:\\Python27\\Lib" or "C:\\Anaconda\\Lib" depending on the environment in which you want to use them.

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