I am a recent convert from Matlab/ Windows to Python/ Ubuntu. I have installed EPD python which is a python distribution that includes most scientific packages, I am super happy so far. Next, I needed to install NLTK to do some text analytics and followed the instructions on the nltk webpage. Problem is that all the packages (pyyaml,nltk etc) are getting installed into
/usr/local/lib/python2.7
However, I already changed my .bashrc (as specifed in post-installations instructions of EPD) and added the following line at the end of it.
export PATH=/home/myname/epd/bin:$PATH
and sys.path from my python shell returns
['',
'/home/myname/epd/bin',
'/home/myname/epd/lib/python2.7/site-packages/pandas-0.10.0-py2.7- linux-i686.egg',
'/home/myname/epd/lib/python27.zip',
'/home/myname/epd/lib/python2.7',
'/home/myname/epd/lib/python2.7/plat-linux2',
'/home/myname/epd/lib/python2.7/lib-tk',
'/home/myname/epd/lib/python2.7/lib-old',
'/home/myname/epd/lib/python2.7/lib-dynload',
'/home/myname/epd/lib/python2.7/site-packages',
'/home/myname/epd/lib/python2.7/site-packages/PIL',
'/home/myname/epd/lib/python2.7/site-packages/IPython/extensions']
Any help regarding how to make new python packages install into the right path is much appreciated. If you have time, please do elaborate on why this is happening and what I am doing wrong. Thanks a ton for you time!
You have two good choices for setting up your python environment in ubuntu:
Use the ubuntu packages, like Thorsten suggests.
Use the pip package manager in a virtualenv. This way you can set up multiple environments and hop from one to the other. A virtualenv can be configured to also include the system-wide ubuntu packages.
nltk exists as a pip package: http://pypi.python.org/pypi/nltk/2.0.4
pip has some trouble on ubuntu when linking to c libraries, since ubuntu places them in a place where the setup scripts do not look. Make sure to also install the -dev version of the dependency packages, since they contain the header files that pip needs, and copy or link the libraries from /usr/lib/your linux architecture/lib/ to /usr/local/lib so that pip may find them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With