2

For these commands (in both bash and fish):

sudo emerge eix
emerge eix

I get this error:

usage: emerge [-h] [--version] [input [input ...]]
emerge: error: argument input: can't open 'eix': [Errno 2] No such file or directory: 'eix'

Same thing with livestreamer (and "pip install"):

#~/temp> livestreamer http://www.twitch.tv/totalbiscuit
usage: livestreamer [-h] [--version] [input [input ...]]
livestreamer: error: argument input: can't open 'http://www.twitch.tv/totalbiscuit': [Errno 2] No such file or directory: 'http://www.twitch.tv/totalbiscuit'

If a file with the name of the first argument exists, I get the same error for the second argument:

#~/temp> emerge test eix
usage: emerge [-h] [--version] [input [input ...]]
emerge: error: argument input: can't open 'test': [Errno 2] No such file or directory: 'test'
#~/temp> touch test
#~/temp> emerge test eix
usage: emerge [-h] [--version] [input [input ...]]
emerge: error: argument input: can't open 'eix': [Errno 2] No such file or directory: 'eix'

How to reproduce (not really):

  1. Be me, happily coding on a dying keyboard (broken cable, sometimes results in me creating weird files in ~/).
  2. (maybe unrelated) Do sudo pip3 uninstall aiohttp_jinja2 in the process, because I don't need it anymore (wrapper for Jinja2 templating engine for aiohttp.web AsyncIO webserver).
  3. Find out that pip, emerge and livestreamer don't work.
  4. Find a weird empty directory /home/username/~/ (it was an actual directory ~/~/, not a pointer to ~/.), remove it out of frustration with rm -r \~/
  5. Go to sleep after 10 hours of work.
  6. Wake up, tools using Python still don't work after boot, find that ~/~/ directory is there again, remove it again.
  7. Try to change primary Python version to 2.7 from 3.3 (sudo eselect python set 1), doesn't help.
  8. Download https://pypi.python.org/packages/source/a/aiohttp_jinja2/aiohttp_jinja2-0.4.1.tar.gz and install it manually with sudo python3 setup.py install, that doesn't help (probably something still proken in core Python modules, maybe os or configparser, not sure.
  9. Ask a question on http://superuser.com, realize it's too technical and Linux-related, ask here.

iPython is also dead in an interesting way (both ipython and ipython3):

#~> ipython
You are running chardetect interactively. Press CTRL-D twice at the start of a blank line to signal the end of your input. If you want help, run chardetect --help

Any suggestions?

Update: Getting closer.

So /usr/bin/python2.7 /usr/lib/python-exec/python2.7/emerge -av eix works just fine, I think the problem is related to python-exec2 somehow:

#~> file /usr/bin/livestreamer
/usr/bin/livestreamer: symbolic link to ../lib/python-exec/python-exec2
#~> file /usr/bin/emerge
/usr/bin/emerge: symbolic link to ../lib/python-exec/python-exec2
#~> file /usr/bin/pip
/usr/bin/pip: symbolic link to ../lib/python-exec/python-exec2
#~> file /usr/bin/pip3
/usr/bin/pip3: symbolic link to ../lib/python-exec/python-exec2
  • Strange. Can you check that your PATH is about sane, and check that /usr/bin/python is a symlink to python-wrapper, and that python-wrapper is an executable (not a script)? Can you use python2 and python3 without issues? – Mat Apr 25 '15 at 5:34
  • @Mat PATH is /bin /usr/bin /home/username/bin /home/username/bin (twice because i'm bad at using .config/fish/config.fish, but that's not a problem, I've checked). Is that sane? my path under sudo -s is /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin /opt/bin, but I have the same problem there. python-wrapper is an executable, and both python and python3 symlinks work fine (but not ipython). So it's probably only part of Python that is broken, some module? – kolobos Apr 25 '15 at 5:59
  • 1
    Looks ok. This is very strange :-) Does /usr/bin/python2.7 /usr/lib/python-exec/python2.7/emerge work? – Mat Apr 25 '15 at 6:15
  • 1
    Yep, looks like it. The symlinks are ok, maybe that python-exec2 file itself got borked somehow, have a look at it (or python-exec2-c, but that's supposed to be an executable). Can you try re-emerging dev-lang/python-exec maybe? – Mat Apr 25 '15 at 6:32
  • 1
    Same issue on Gentoo forums, seems to be a recurring problem with pip: forums.gentoo.org/viewtopic-t-1006016.html – kolobos Apr 25 '15 at 7:12
3

The programs you're having trouble with are all run using the dev-lang/python-exec script wrapper, which appears to have been somehow corrupt.

To attempt to re-install that package, assuming nothing else was severely harmed, you can try (adjust the version number to match your installed packages):

/usr/bin/python2.7 /usr/lib/python-exec/python2.7/emerge -1a dev-lang/python-exec

If your python installation is also broken (or some other critical system package), you should be able to recover by using binary packages. You can download some from Tinderbox.

Depending on how badly the installation is broken, you might have to boot into a Live CD to download the packages and manually mount your filesystems to install the binary packages.

  • This worked. This is what I had in /usr/lib/python-exec/python-exec2: # EASY-INSTALL-ENTRY-SCRIPT: 'chardet==2.3.0','console_scripts','chardetect' __requires__ = 'chardet==2.3.0 and I only had dev-python/chardet-2.2.1 installed, so it seems that pip somehow replaced my system's /usr/lib/python-exec/python-exec2. Same issue on Gentoo forums, seems to be a recurring problem with pip: forums.gentoo.org/viewtopic-t-1006016.html – kolobos Apr 25 '15 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.