Re: error importing cgi module in Python on HP-XU (8914 Views)
Reply
Frequent Advisor
bill_allen
Posts: 60
Registered: ‎05-16-2006
Message 1 of 7 (8,914 Views)

error importing cgi module in Python on HP-XU

I installed the current Python package on a HP-UX 11.23 system today. Python install and runs but when I try to import the cgi module with:

>>>import cgi

I get the following error.

ImportError: Failed to load /opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl

Also, when running a cgi script that does the same import this error also appears in the log for Apache. Is there a patch or fix for this?

Thanks,
Bill Allen
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 2 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

What do these show:
uname -a
file /opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl
Frequent Advisor
bill_allen
Posts: 60
Registered: ‎05-16-2006
Message 3 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

Thanks for the response, here is that information.


HP-UX fcdshp03 B.11.23 U 9000/800 1122901597 unlimited-user license

Running file against that particular file yields:

/opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl: cannot open

Essentially, this is what Python is telling me also, which make me think this file is corrupt in the depot. I have downloaded the depot again and made another attempt with the same results, so I do not think it is corruption from the download process but at the source. I could be wrong, any thoughts?

--Bill Allen
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 4 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

>.../binascii.sl: cannot open
>this is what Python is telling me also,

No, this tells you the file isn't there, rather than it is the wrong type or corrupted.

>I do not think it is corruption from the download process but at the source.

Right, it just isn't there. Have you tried searching for it?
find /opt/iexpress -name binascii.sl
Frequent Advisor
bill_allen
Posts: 60
Registered: ‎05-16-2006
Message 5 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

I did serarch and the file is present.

find /opt/iexpress -name binascii.sl
/opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl

Here is a little more information, the full traceback. It still appears to me the problem is with the file itself.

Traceback (most recent call last):
File "", line 1, in
File "/opt/iexpress/python/lib/python2.7/cgi.py", line 51, in
import mimetools
File "/opt/iexpress/python/lib/python2.7/mimetools.py", line 6, in
import tempfile
File "/opt/iexpress/python/lib/python2.7/tempfile.py", line 34, in
from random import Random as _Random
File "/opt/iexpress/python/lib/python2.7/random.py", line 48, in
from binascii import hexlify as _hexlify
ImportError: Failed to load /opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 6 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

>/opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl: cannot open
>I did search and the file is present.

These seem contradictory. You need to check the permissions of each directory path and the file itself to make sure they all have at least r-xr-xr-x:
ll -d /opt /opt/iexpress /opt/iexpress/python /opt/iexpress/python/lib /opt/iexpress/python/lib/python2.7 /opt/iexpress/python/lib/python2.7/lib-dynload /opt/iexpress/python/lib/python2.7/lib-dynload/binascii.sl
Frequent Advisor
bill_allen
Posts: 60
Registered: ‎05-16-2006
Message 7 of 7 (8,914 Views)

Re: error importing cgi module in Python on HP-XU

I'll check those directory privs. Perhaps something did not get set properly during the install.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.