jswails1 n00b
Joined: 19 Oct 2011 Posts: 20
|
Posted: Mon Nov 11, 2013 3:21 pm Post subject: pygobject-3.2.2-r1 issues with Python 2.7 |
|
|
The install phase (I believe) is dying with the following traceback:
Code: |
libtool: install: warning: remember to run `libtool --finish /usr/lib64/python2.7/site-packages/gi'
/bin/mkdir -p '/var/tmp/portage/dev-python/pygobject-3.2.2-r1/image//usr/lib64/python2.7/site-packages/gi'
/usr/bin/install -c -m 644 __init__.py types.py module.py importer.py pygtkcompat.py '/var/tmp/portage/dev-python/pygobject-3.2.2-r1/image//usr/lib64/python2.7/site-packages/gi'
Traceback (most recent call last):
File "/usr/lib64/python2.7/site.py", line 62, in <module>
import os
File "/usr/lib64/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/usr/lib64/python2.7/posixpath.py", line 17, in <module>
import warnings
File "/usr/lib64/python2.7/warnings.py", line 8, in <module>
import types
File "types.py", line 26, in <module>
from . import _gobject
|
The problem here is that when the stdlib intends to import "types", it is erroneously grabbing the "types.py" module from inside the gi package in the pygobject build directory. Presumably this is because the CWD of this step is inside the gi/ package directory. If this stage was done outside the gi/ directory so that the 'types' module that actually got imported was /usr/lib64/python2.7/types.py instead of /var/tmp/portage/dev-python/pygobject-3.2.2-r1/image/usr/lib64/python2.7/site-packages/gi/types.py then this error should go away.
Truth be told I'm not familiar enough with the internals of portage to know how to fix this. My temporary (ugly hackish workaround) is running the following commands as root:
Code: |
cd /usr/lib64/python2.7/
cp types.py _types.py
for m in *.py; do sed -i -e "s/import types/import _types as types/g" -e "s/from types import/from _types import/g" $m; done
|
After this, pygobject builds just fine, but I _really_ do not like hacking Python's stdlib like this. I just ran "emerge --sync", by the way, so to the best of my knowledge this hasn't been fixed upstream.
Cheers! |
|