Howdy all,
I'm trying to install NLTK with pip on Mac OS 10.6.8 and I'm running
into trouble. Specifically I'm trying to install in a virtual
environment associated with Python 2.7.2. Whenever I try to install
NLTK using "pip install nltk" (I do have pip set to the right
environment), I receive an error that it cannot find the file
"setup.py".
I know this is an error that's been encountered by others, e.g. here:
http://groups.google.com/group/nltk-users/browse_thread/thread/3162be5b2d13e5a7
which seems to be a mirror of this:
http://www.richard-careaga.com/archives/3474
But in that thread the author suggests that the user do the
following:
cd /usr/local/var/pip/build/nltk*/nltk*
pip install .
What I in fact find in my install is this:
09:23 AM mbpbt:ml> ls
09:23 AM mbpbt:ml> mkvirtualenv ml
New python executable in ml/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /Users/bobtodd/.virtualenvs/ml/
bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/bobtodd/.virtualenvs/ml/
bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/bobtodd/.virtualenvs/ml/
bin/preactivate
virtualenvwrapper.user_scripts creating /Users/bobtodd/.virtualenvs/ml/
bin/postactivate
virtualenvwrapper.user_scripts creating /Users/bobtodd/.virtualenvs/ml/
bin/get_env_details
(ml)09:23 AM mbpbt:ml> python --version
Python 2.7.2
(ml)09:23 AM mbpbt:ml> pip install nltk
Downloading/unpacking nltk
Downloading nltk-2.0.1rc1.macosx-10.6-x86_64.tar.gz (1.9Mb): 1.9Mb
downloaded
Running setup.py egg_info for package nltk
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/Users/
bobtodd/.virtualenvs/ml/build/nltk/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/Users/
bobtodd/.virtualenvs/ml/build/nltk/setup.py'
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/bobtodd/.pip/pip.log
(ml)09:23 AM mbpbt:ml> cd ~/.virtualenvs/ml/
bin/ build/ include/ lib/
(ml)09:23 AM mbpbt:ml> cd ~/.virtualenvs/ml/build/nltk*/nltk*
-bash: cd: /Users/bobtodd/.virtualenvs/ml/build/nltk*/nltk*: No such
file or directory
(ml)09:25 AM mbpbt:ml> ls ~/.virtualenvs/ml/build/nltk/
opt pip-egg-info
(ml)09:25 AM mbpbt:ml> ls ~/.virtualenvs/ml/build/nltk/opt/
local
(ml)09:26 AM mbpbt:ml> ls ~/.virtualenvs/ml/build/nltk/opt/local/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/nltk
__init__.py containers.pyc help.py
sourcedstring.py
__init__.pyc corpus help.pyc
sourcedstring.pyc
align.py data.py inference stem
align.pyc data.pyc internals.py tag
app decorators.py internals.pyc test
book.py decorators.pyc lazyimport.py text.py
book.pyc downloader.py lazyimport.pyc text.pyc
ccg downloader.pyc metrics tokenize
chat draw misc toolbox
chunk etree model tree.py
classify evaluate.py nltk.jar tree.pyc
cluster evaluate.pyc olac.py
treetransforms.py
collocations.py examples olac.pyc
treetransforms.pyc
collocations.pyc featstruct.py parse util.py
compat.py featstruct.pyc probability.py util.pyc
compat.pyc grammar.py probability.pyc yamltags.py
containers.py grammar.pyc sem yamltags.pyc
(ml)09:27 AM mbpbt:ml> ls ~/.virtualenvs/ml/build/nltk/pip-egg-info/
(ml)09:27 AM mbpbt:ml>
So I in fact don't even have the directory ...../build/nltk*/nltk*
that the author suggests I cd to.
From other materials I've found online, many users have solved the
problem (dating back a few years now) by various changes along the
lines of linking a file ..../build/nltk/setup.py to the actual file
deeper down, e.g. .../build/nltk/nltk-<version_number>/setup.py. But
as you can see from the above, I don't even have that... rather I seem
to have .../build/nltk/opt, which honestly seems to me a rather
mysterious beast, what with the Frameworks 'n' all. So I don't even
know how to apply the solutions I've come across.
I understand that I could try easy_install, but as pip is getting set
to replace this, I figure a solution to the issue with pip would
benefit others as well. And I understand that I could use MacPorts,
but I've ditched that for Homebrew for other reasons.
Any help would be greatly appreciated.
Kind regards,
Todd