Operating System - HP-UX
1745810 Members
3726 Online
108722 Solutions
New Discussion юеВ

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

 
bill_allen
Frequent Advisor

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
6 REPLIES 6
Dennis Handly
Acclaimed Contributor

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
bill_allen
Frequent Advisor

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
Dennis Handly
Acclaimed Contributor

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
bill_allen
Frequent Advisor

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
Dennis Handly
Acclaimed Contributor

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
bill_allen
Frequent Advisor

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.