I'm new to Anaconda version of Python, and already I'm running into unpleasant problems.
I installed Anaconda per the instructions here, and it worked like charm, with all the included packages imported properly when demanded. Then I went on to install some extra packages which Anaconda did not included in the first place with pip
:
$ sudo pip install BeautifulSoup mrjob pattern
The installations seems to be perfect, but when I try to import them in ipython, things get frustrating:
Python 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18)
Type "copyright", "credits" or "license" for more information.
IPython 1.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import BeautifulSoup
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-aa1e12a76f5e> in <module>()
----> 1 import BeautifulSoup
ImportError: No module named BeautifulSoup
In [2]: import mrjob
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-6ea1b9bda48b> in <module>()
----> 1 import mrjob
ImportError: No module named mrjob
In [3]: import pattern
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-4b662941bac1> in <module>()
----> 1 import pattern
ImportError: No module named pattern
In [4]:
Funny thing is, these packages can be very well imported when I'm not running the Anaconda bundle of python, after removing
# added by Anaconda 1.8.0 installer
export PATH="/home/username/anaconda/bin:$PATH"
from my .bashrc
:
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import BeautifulSoup
In [2]: import mrjob
In [3]: import pattern
In [4]:
Did I miss anything during any of these installations that I ran? Should I manually link these packages to Anaconda so that it knows where to find them?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…