Pip installs on Archlinux fails to build egg

1

I was trying to install nltk on my Archlinux server but it repeatedly fails with the following error output


/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'entry_points'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'zip_safe'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'

  warnings.warn(msg)

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: setup.py --help [cmd1 cmd2 ...]

   or: setup.py --help-commands

   or: setup.py cmd --help



error: invalid command 'bdist_egg'

/tmp/pip_build_root/nltk/distribute-0.6.21-py3.3.egg

Traceback (most recent call last):

  File "./distribute_setup.py", line 143, in use_setuptools

    raise ImportError

ImportError



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "", line 16, in 

  File "/tmp/pip_build_root/nltk/setup.py", line 23, in 

    distribute_setup.use_setuptools()

  File "./distribute_setup.py", line 145, in use_setuptools

    return _do_download(version, download_base, to_dir, download_delay)

  File "./distribute_setup.py", line 125, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "./distribute_setup.py", line 116, in _build_egg

    raise IOError('Could not build the egg.')

OSError: Could not build the egg.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/nltk
Storing complete log in /root/.pip/pip.log

This error is also occurring for matplotlib buts thats the only other library I found it to fail on so far. pyyaml installs fine. The install works perfectly under virtualenv on my mac which is using python 2.7 but the server is using python 3.3. Any help is appreciated.

stmfunk

Posted 2013-09-27T11:17:17.513

Reputation: 207

Did you ever solve this issue? – X3Maverick – 2014-07-26T19:20:32.893

Have you tried using pip2 (in python2-pip)? If they work in python 2 on the mac but not in python 3 on the server, it may be because they are not py3-ready. – J David Smith – 2013-10-03T16:57:18.473

Answers

0

I have this same problem on Linux Mint Quiana 17, 64-bit. I'm not sure why, but when I run

sudo pip install nltk

it installs nltk 2.0.4, as seen in pip list. This may cause this problem as nltk 3.0 was the first version to support Python 3. Also, running pip search nltk does say that the latest version of nltk is 3.0.0b2 (which it is, as of time of writing), but running neither sudo pip install -U nltk nor sudo pip install -U nltk==3.0.0b2 installs the latest version. Maybe it's because I don't know pip that well, or my google-fu is not strong enough, but I can't get it to install the newest version.

My work-around was just cloning the github repository of nltk 3.0.0b2 and running the setup.py by myself.

identicon

Posted 2013-09-27T11:17:17.513

Reputation: 101