Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hard coded python library search path
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
Oralloy
n00b
n00b


Joined: 17 Mar 2004
Posts: 10
Location: Leeds, UK

PostPosted: Wed Jan 17, 2007 11:39 pm    Post subject: Hard coded python library search path Reply with quote

Hi,

I have a problem with my python install that has impacted on my being able to emerge many packages. I think that I've accidently done something so that the default search path hard coded into the interpreter is different to where 3rd party libraries are installed.

Some background: Sometime in December I decided to experiment with the latest version of PyQt4 and made the foolish decision to try and use the (masked) package in portage, rather than just installing it locally for user account. Then I found that PyQt4 wouldn't build with any version of Sip in portage so I made a custom ebuild of one that would. Then tha version of Sip wouldn't build because it uses the python C api from python 2.5. Then I unmasked python 2.5 and emerged that (at this point things really started to go wrong). This move broke various things on my system so I decided to revert back to python 2.4. Before I did that, I left the country for three weeks and forgot the exact details of what I'd done.

To downgrade, I unmerged python2.5, downloaded, built and installed the source for 2.4.4 from the python website and then emerged python again. Unfortunately, things still don't work. The default library search path of the interpreter seems to be different from where libraries actually get installed. Shell session below illustrating the problem:

Code:

~ # python
Python 2.4.4 (#1, Jan 17 2007, 22:26:31)
[GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/portage/pym', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']


Try to use something requiring a python package:

Code:

~ # ebuild /usr/portage/dev-lang/lua/lua-5.1.1-r1.ebuild digest
>>> Creating Manifest for /usr/portage/dev-lang/lua
Traceback (most recent call last):
  File "/usr/bin/ebuild", line 136, in ?
    debug=debug, tree=mytree)
  File "/usr/lib/portage/pym/portage.py", line 3485, in doebuild
    myportdb=mydbapi)
  File "/usr/lib/portage/pym/portage.py", line 2677, in digestgen
    assumeDistHashesAlways=(
  File "/usr/lib/portage/pym/portage_manifest.py", line 438, in create
    self.fhashdict[mytype][f] = perform_multiple_checksums(self.pkgdir+f, self.hashes)
  File "/usr/lib/portage/pym/portage_checksum.py", line 217, in perform_multiple_checksums
    raise portage_exception.DigestException, x+" hash function not available (needs dev-python/pycrypto)"
portage_exception.DigestException: RMD160 hash function not available (needs dev-python/pycrypto)


Okay, so I need dev-python/pycrypto for this to work

Code:

~ # emerge pycrypto
...
...
...
>>> Merging dev-python/pycrypto-2.0.1-r5 to /
--- /usr/
--- /usr/local/
--- /usr/local/lib/
--- /usr/local/lib/python2.4/
--- /usr/local/lib/python2.4/site-packages/
--- /usr/local/lib/python2.4/site-packages/Crypto/
...
...
...


So pycrpto is placed into/usr/local/lib/python2.4 (which is the python default on *nix, I think, but different to the interpreter seach path).

I can't update my system fully at the moment because so many emerges fail with import errors. I knew enough about Python & Gentoo to get myself into this hole but not nearly enough to dig my way out.

Any help greatly appreciated.
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