I'm a newbie to IPython/Anaconda (for Windows 7), and for some reason, I'm getting an import error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-6-484073d472a5> in <module>()
6 import matplotlib.pyplot as plt
7 import requests
----> 8 import pattern
ImportError: No module named pattern
Here's what I did to set up Anaconda/IPython:
Installed Anaconda. I already have a version of python on this computer. The Anaconda distribution was installed to C:\Users\MyName, while the regular python distribution (2.7) was installed to C:\Python27.
When I tried to import some packages (sklearn, pandas, requests, pattern), for some reason those packages just wouldn't import so I installed them manually (downloading them to a local folder on my desktop and running $ python setup.py install, and after that it all seemed to work).
I can run IPython notebooks fine. However, when I try to import pattern specifically, I get that error (which I don't get for sklearn or any of the other packages I installed manually). Printing my sys path from the terminal (import sys print sys.path) and IPython notebook gives:
Terminal:
['C:\\Users\\MyName\\Desktop\\Data Science\\cs109\\Labs', 'C:\\python27\\lib\\site-
packages\\mrjob-0.4.2_dev-py2.7.egg', 'C:\\python27\\lib\\site-
packages\\simplejson-3.3.1-
py2.7.egg', 'C:\\python27\\lib\\site-packages\\pyyaml-3.10-py2.7-win32.egg',
'C:\\python27\\lib\\site-packages\\boto-2.18.0-py2.7.egg',
'C:\\python27\\lib\\site-packages\\requests-2.0.1-py2.7.egg',
'C:\\Windows\\system32\\python27.zip',
'C:\\Python27\\lib\\site-packages\\Orange\\orng', 'C:\\python27\\DLLs',
'C:\\python27\\lib', 'C:\\python27\\lib\\plat-win', 'C:\\python27\\lib\\lib-tk',
'C:\\python27', 'C:\\python27\\lib\\site-packages', 'C:\\python27\\lib\\site-
packages\\PIL', 'C:\\python27\\lib\\site-packages\\win32',
'C:\\python27\\lib\\site-
packages\\win32\\lib', 'C:\\python27\\lib\\site-packages\\Pythonwin']
IPython notebook:
['', 'C:\\Users\\MyName\\Anaconda\\python27.zip', 'C:\\Python27\\lib\\site-
packages\\Orange\\orng', 'C:\\Users\\MyName\\Anaconda\\DLLs',
'C:\\Users\\MyName\\Anaconda\\lib', 'C:\\Users\\MyName\\Anaconda\\lib\\plat-win',
'C:\\Users\\MyName\\Anaconda\\lib\\lib-tk', 'C:\\Users\\MyName\\Anaconda',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\PIL',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\win32',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\win32\\lib',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\Pythonwin',
'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg-
info', 'C:\\Users\\MyName\\Anaconda\\lib\\site-packages\\IPython\\extensions']
If I do
import pattern
print pattern
It shows that pattern is located at:
C:\python27\lib\site-packages\pattern\__init.pyc
Any thoughts as to why IPython can't import pattern?