You are not logged in.
Hi everyone!
After a recent system upgrade I've found that I'm not able to use the 'escrotum' application anymore:
Traceback (most recent call last):
File "/usr/bin/escrotum", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 78, in <module>
__import__('pkg_resources.extern.packaging.requirements')
File "/usr/lib/python2.7/site-packages/pkg_resources/extern/__init__.py", line 42, in load_module
__import__(extant)
File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
At first I've thought that I should reinstall the package (escrotum-git from the AUR), but it failed with the very same error message.
While I'm using python for my needs from time to time, I'm not really good with it and it is mostly just a black box for me.
Having said that, I've tried to dig in a little bit and ended up with a minimal python example that reveals the problem:
from pkg_resources import load_entry_point
Yes, just a one-liner. Apparently it doesn't have to do anything with the 'escrotum' itself.
While it works with python3, it does not with python2. And my system is up to date:
/usr/lib/python2.7/site-packages/packaging/requirements.py is owned by python2-packaging 16.5-1
/usr/lib/python2.7/site-packages/pkg_resources/__init__.py is owned by python2-setuptools 1:20.2.2-1
Any ideas how to fix it?
Thanks for you attention!
Last edited by mexus (2016-02-28 13:05:47)
Offline
Mod note: moving to AUR issues.
Last edited by WorMzy (2016-02-28 11:23:11)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
@WorMzy, it's not an AUR issue: I've provide a minimal example that does not relate to an AUR package. It's just happened to be uncovered with the AUR package
Offline
Hm, I may have been too hasty there. However, your example works fine for me:
$ python2
Python 2.7.11 (default, Dec 6 2015, 15:43:46)
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkg_resources import load_entry_point
>>>
My system is also up-to-date:
$ pacman -Qo /usr/lib/python2.7/site-packages/packaging/requirements.py /usr/lib/python2.7/site-packages/pkg_resources/__init__.py
/usr/lib/python2.7/site-packages/packaging/requirements.py is owned by python2-packaging 16.5-1
/usr/lib/python2.7/site-packages/pkg_resources/__init__.py is owned by python2-setuptools 1:20.2.2-1
and my files have the same content on the lines listed in your traceback:
$ sed -n '5p' /usr/bin/escrotum
from pkg_resources import load_entry_point
$ sed -n '78p' /usr/lib/python2.7/site-packages/pkg_resources/__init__.py
__import__('pkg_resources.extern.packaging.requirements')
$ sed -n '42p' /usr/lib/python2.7/site-packages/pkg_resources/extern/__init__.py
__import__(extant)
$ sed -n '59p' /usr/lib/python2.7/site-packages/packaging/requirements.py
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
Possibly there is a problem with your python environment. Do you set any python variables in your .bashrc, etc.?
Mod note: moving to Programming and Scripting.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Well, anything could happen
I've tried to run it from BASH (i didn't configure it at all) with the same result, and here is my environment:
XDG_VTNR=3
XDG_SESSION_ID=c5
ANDROID_HOME=/opt/android-sdk
ANDROID_SWT=/usr/share/java
TERM=linux
SHELL=/bin/bash
OLDPWD=/home/mexus
USER=mexus
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
MAIL=/var/spool/mail/mexus
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
HG=/usr/bin/hg
PWD=/home/mexus/test/python
LANG=en_US.UTF-8
SHLVL=1
XDG_SEAT=seat0
HOME=/home/mexus
LOGNAME=mexus
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
LESSOPEN=|/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/1000
_=/usr/bin/env
Offline
Can you post the output of 'which python2'?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Sure! Here it goes:
which python2
/usr/bin/python2
yaourt -Qo $(which python2)
/usr/bin/python2 is owned by python2 2.7.11-1
Just to be sure I've reinstalled the python2 package, but the "test" still fails for me. Looks like some magic is involved!
Offline
Okay, how about 'pacman -Qkk python2 python2-packaging python2-setuptools'?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Wow, i didn't know pacman can even detect altered files! Awesome:)
pacman -Qkk python2 python2-packaging python2-setuptools
python2: 4720 total files, 0 altered files
python2-packaging: 29 total files, 0 altered files
python2-setuptools: 156 total files, 0 altered files
Offline
felixonmars from #archlinux on freenode advised me to run the script with a "python2-hunter", so I've run
env PYTHONHUNTER="module_startswith=['packaging']" python2 -c "from pkg_resources import load_entry_point"
And here is an output: https://ptpb.pw/uiHl (it's too large to include it in the post). Maybe it would help.
Offline
With the help of guys from #archlinux (freenode) the issue was solved: for some reason there was a "pyparsing.py" file in the "~/.local/lib/python2.7/site-packages", and removing it solved the issue.
I still wonder why python haven't told me anything about this file, but I'll leave it to the conscience of python developers
Offline
Thanks for reporting back. Out of interest, how did you find out about that file?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
I was asked to check the python's sys.path, and it told me about the "~/.local" path, so I looked there and found the nasty pyparsing file. And at the moment i saw it, its faith was already decided
Offline