Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with emerge / python-exec
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Silmano
n00b
n00b


Joined: 10 Mar 2012
Posts: 53

PostPosted: Wed Dec 10, 2014 8:48 am    Post subject: Problem with emerge / python-exec Reply with quote

Hi,

I have a problem with my Gentoo machine. It seems I've broken the emerge or python-exec2 executables. The last thing I remember doing was an 'emerge --oneshot portage' this morning. That "apparently" went well. I type "apparently" because the output of the compile/install phases seemed more to a pip install than to an emerge compilation/installation. After that I wanted to do a world update and I noticed emerge wasn't running properly:
Code:
-> # emerge -avuDN world
usage: emerge [options] requirement_or_url ...
   or: emerge --help

error: option -u not recognized

Also emerge's help wasn't anything like the working one:
Code:
-> # emerge --help

Global options:
  --verbose (-v)  run verbosely (default)
  --quiet (-q)    run quietly (turns verbosity off)
  --dry-run (-n)  don't actually do anything
  --help (-h)     show detailed help message
  --no-user-cfg   ignore pydistutils.cfg in your home directory

Options for 'easy_install' command:
  --prefix                   installation prefix
  --zip-ok (-z)              install package as a zipfile
  --multi-version (-m)       make apps have to require() a version
  --upgrade (-U)             force upgrade (searches PyPI for latest versions)
  --install-dir (-d)         install package to DIR
  --script-dir (-s)          install scripts to DIR
  --exclude-scripts (-x)     Don't install scripts
  --always-copy (-a)         Copy all needed packages to install dir
  --index-url (-i)           base URL of Python Package Index
  --find-links (-f)          additional URL(s) to search for packages
  --build-directory (-b)     download/extract/build in DIR; keep the results
  --optimize (-O)            also compile with optimization: -O1 for "python -
                             O", -O2 for "python -OO", and -O0 to disable
                             [default: -O0]
  --record                   filename in which to record list of installed
                             files
  --always-unzip (-Z)        don't install as a zipfile, no matter what
  --site-dirs (-S)           list of directories where .pth files work
  --editable (-e)            Install specified packages in editable form
  --no-deps (-N)             don't install dependencies
  --allow-hosts (-H)         pattern(s) that hostnames must match
  --local-snapshots-ok (-l)  allow building eggs from local checkouts
  --version                  print version information and exit
  --no-find-links            Don't load find-links defined in packages being
                             installed
  --user                     install in user site-package
                             '/root/.local/lib64/python2.7/site-packages'

usage: emerge [options] requirement_or_url ...
   or: emerge --help


On the other hand, I don't know if it has something to do, but gcc-config doesn't seem to be able to find my gcc profile. Before the portage update, the last think I remember installing/upgrading was flexget via 'pip2 install --upgrade flexget'.

I think a reinstall of python-exec should work, but I'm not really sure. Any idea how to repair this mess?
Back to top
View user's profile Send private message
Silmano
n00b
n00b


Joined: 10 Mar 2012
Posts: 53

PostPosted: Wed Dec 10, 2014 9:25 am    Post subject: Reply with quote

Damn! Found the solution...

Reinstall portage correctly:
Code:
-> # /usr/lib/python-exec/python3.3/emerge -av portage

The previous installation didn't report much in the install phase and this last one reported all the portage files being copyied correctly.

Reinstall python-exec and overwrite the wrong binary I had:
Code:
-> # /usr/lib/python-exec/python3.3/emerge -av python-exec


Now emerge seems to work without issues and gcc-config reports the correct C profile:
Code:
-> # emerge --help
emerge: the other white meat (command-line interface to the Portage system)
Usage:
   emerge [ options ] [ action ] [ ebuild | tbz2 | file | @set | atom ] [ ... ]
   emerge [ options ] [ action ] < @system | @world >
   emerge < --sync | --metadata | --info >
   emerge --resume [ --pretend | --ask | --skipfirst ]
   emerge --help
Options: -[abBcCdDefgGhjkKlnNoOpPqrsStuvVw]
          [ --color < y | n >            ] [ --columns    ]
          [ --complete-graph             ] [ --deep       ]
          [ --jobs JOBS ] [ --keep-going ] [ --load-average LOAD            ]
          [ --newrepo   ] [ --newuse     ] [ --noconfmem  ] [ --nospinner   ]
          [ --oneshot   ] [ --onlydeps   ] [ --quiet-build [ y | n ]        ]
          [ --reinstall changed-use      ] [ --with-bdeps < y | n >         ]
Actions:  [ --depclean | --list-sets | --search | --sync | --version        ]

   For more help consult the man page.

Code:
-> # gcc-config -c
x86_64-pc-linux-gnu-4.8.3
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 10615

PostPosted: Thu Dec 11, 2014 12:51 am    Post subject: Reply with quote

This is a recurring problem. Every few months, I see someone post with this type of problem. It is invariably traced back to pip or similar such tools being run as root. For some reason, those tools like to overwrite the python-exec wrapper with their own program, causing all programs invoked via /usr/bin/python to be as though you had done /usr/bin/pip.
Back to top
View user's profile Send private message
IceSunrise
n00b
n00b


Joined: 03 Mar 2008
Posts: 24
Location: Russia, Saint-Petersburg

PostPosted: Mon Jun 01, 2015 3:47 pm    Post subject: Reply with quote

Thanks a lot for posting your solution!
I got this problem after upgrading pip under root. It's just unbelievable how one stupid upgrade (or is it a stupid package in this case?) can brake everything.
emerge would suddenly return
Code:

Usage:
  pip <command> [options]

no such option: -a


Leaving me wondering what a hell has happened just now!
Back to top
View user's profile Send private message
bercianor
n00b
n00b


Joined: 10 Feb 2015
Posts: 11

PostPosted: Sat Nov 21, 2015 1:02 am    Post subject: Reply with quote

Hi all!

Great for the solution, I think it can help me because I have the same problem here, but when try to do:
Code:
/usr/lib/python-exec/python3.4/emerge -av portage

after ask to start merging this package shows me the following error:
Code:
FileNotFoundError: [Errno 2] No existe el fichero o el directorio: b'/usr/lib/portage/python3.4'

and effectively, that folder doesn't exists...

And if I try:
Code:
/usr/lib/python-exec/python3.4/emerge -av python-exec

It returns:
Code:
>>> Emerging (1 of 1) dev-lang/python-exec-2.0.1-r1::gentoo
[dev-lang/python-exec-2.0.1-r1] bash: /usr/lib/portage/python3.4/ebuild.sh: No such file or directory
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/dev-lang/python-exec-2.0.1-r1'

>>> Failed to emerge dev-lang/python-exec-2.0.1-r1

Can someone help me to solve this?

Many many thanks in advance
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Sat Nov 21, 2015 2:00 am    Post subject: Reply with quote

Do you have other python versions installed? If you do and portage is installed to them, try them instead.

you only need one to restore full capability.

If none work and/or you don't have any others, if git works, you can run portage directly from a checkout, same if you manually unpack a portage tarball somewhere.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
bercianor
n00b
n00b


Joined: 10 Feb 2015
Posts: 11

PostPosted: Sat Nov 21, 2015 2:38 am    Post subject: Reply with quote

I have python 2.7, but the results are the same as 3.4

Git works ok, and let me clone the portage repository
Code:
git clone https://anongit.gentoo.org/git/proj/portage.git

then I ran the code
Code:
/root/portage-recover/portage/bin/emerge -av portage

and finish well

but when I try with
Code:
/root/portage-recover/portage/bin/emerge -av python-exec

it gave me the error
Code:
/bin/bash: /root/portage-recover/portage/bin/ebuild.sh: Permission denied


Log file dump:
Code:
cat /var/tmp/portage/dev-lang/python-exec-2.0.1-r1/temp/build.log
 * Package:    dev-lang/python-exec-2.0.1-r1
 * Repository: gentoo
 * Maintainer: python@gentoo.org
 * Upstream:   mgorny@gentoo.org https://bitbucket.org/mgorny/python-exec/issues/
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_jython2_5 python_targets_jython2_7 python_targets_pypy python_targets_pypy3 python_targets_python2_7 python_targets_python3_3 python_targets_python3_4 python_targets_python3_5 userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
/bin/bash: /root/portage-recover/portage/bin/ebuild.sh: Permission denied
 * The ebuild phase 'unpack' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments
 * (bug #190128) or bad substitution errors (bug #200313). Normally, before
 * exiting, bash should have displayed an error message above. If bash did
 * not produce an error message above, it's possible that the ebuild has
 * called `exit` when it should have called `die` instead. This behavior
 * may also be triggered by a corrupt bash binary or a hardware problem
 * such as memory or cpu malfunction. If the problem is not reproducible or
 * it appears to occur randomly, then it is likely to be triggered by a
 * hardware problem. If you suspect a hardware problem then you should try
 * some basic hardware diagnostics such as memtest. Please do not report
 * this as a bug unless it is consistently reproducible and you are sure
 * that your bash binary and hardware are functioning properly.
Back to top
View user's profile Send private message
bercianor
n00b
n00b


Joined: 10 Feb 2015
Posts: 11

PostPosted: Sat Nov 21, 2015 10:35 am    Post subject: Reply with quote

Solved!

trying with
Code:
/usr/lib/python-exec/python3.4/emerge -av python-exec

after update portage from its git clone, finally run, and then whole thing is solved

thanks to dol-sen for the help :)
thanks to Silmano for posting his solution :)
this is a great community :)
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 192

PostPosted: Sun Jul 17, 2016 1:47 pm    Post subject: Reply with quote

i tried all but non works for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum