Author lemburg
Recipients Arfrever, Trundle, barry, brett.cannon, chba, eric.smith, eric.snow, jcea, jkloth, lemburg, loewis, meador.inge
Date 2014-03-25.17:17:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5331BA1C.6070300@egenix.com>
In-reply-to <1395766056.68.0.516014467414.issue16047@psf.upfronthosting.co.za>
Content
On 25.03.2014 17:47, Christian Bachmaier wrote:
> 
> Christian Bachmaier added the comment:
> 
>> To test what I asked for, please run freeze on this script:
>>
>> """
>> import _psycopg2

Sorry. The above should have read "import _psycopg".

>> print ('Works.')
>> """
> 
> $ xxx/freeze.py hello.py
> $ make
> $ ./hello
> Traceback (most recent call last):
>   File "hello.py", line 3, in <module>
>     import _psycopg2
>   File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2214, in _find_and_load
>     return _find_and_load_unlocked(name, import_)
>   File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2201, in _find_and_load_unlocked
>     raise ImportError(_ERR_MSG.format(name), name=name)
> ImportError: No module named '_psycopg2'
> 
> Btw the same with import psycopg2, psycopg2._psycopg, or _psycopg. Event with the subdir link as explained above. The first one (import psycopg2) is the one which operates in interpretation mode.

Ok, now we're getting closer.

Could you run this to have Python print the locations where
it looks for the shared lib:

export PYTHONVERBOSE=2
./hello

This should print a long list of messages such as these:

import os # frozen
import errno # builtin
import posix # builtin
import posixpath # frozen
...

to stderr. Of those only the lines which mention _psycopg are relevant.

Please make sure that the dir where the .so file resides is
included in this list. If not, you will need to adjust PYTHONPATH
accordingly.

If the dir is mentioned in the listing, we have to dig deeper
using strace or similar.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com
History
Date User Action Args
2014-03-25 17:17:22lemburgsetrecipients: + lemburg, loewis, barry, brett.cannon, jcea, eric.smith, jkloth, Arfrever, Trundle, meador.inge, eric.snow, chba
2014-03-25 17:17:22lemburglinkissue16047 messages
2014-03-25 17:17:22lemburgcreate