Python and SSL enabled

matey monica.medina at ngc.com
Wed Nov 1 17:56:39 EST 2006


Firstly, thank for answering.  Otherwise I wouldn't know where to turn
for help.......


I tried to run the following simple program....

#!/usr/local/bin/python

import M2Crypto

u = M2Crypto.m2urllib.URLopener()
u.open('http://www.yahoo.com')

However I got the following errror:

Traceback (most recent call last):
  File "test.py", line 3, in ?
    import M2Crypto
  File "/home/mmedina/python2.3/site-packages/M2Crypto/__init__.py",
line 14, in ?
    import __m2crypto
ImportError: ld.so.1: python: fatal: relocation error: file
/home/mmedina/python2.3/site-packages/M2Crypto/__m2crypto.so: symbol
d2i_SSL_SESSION: referenced symbol not found
cengsu01:/home/mmedina/scripts/python >

However, I went back to INSTALL instructions for m2crytpo.  I saw I
forgot to run alltests.py

I ran the alltests.py and received the following:

Traceback (most recent call last):
  File "alltests.py", line 61, in ?
    from M2Crypto import Rand
  File
"/home/mmedina/crypt/m2kcrypto/m2crypto-0.16/M2Crypto/__init__.py",
line 14, in ?
    import __m2crypto
ImportError: No module named __m2crypto
cengsu01:/home/mmedina/crypt/m2kcrypto/m2crypto-0.16/tests

Can you tell me what I did not do?

Thanks in advance.

Heikki Toivonen wrote:
> matey wrote:
> > However, when I use the following command: python setup.py install
> > I get the following error:
> >
> > creating /usr/local/lib/python2.3/site-packages/M2Crypto
> > error: could not create
> > '/usr/local/lib/python2.3/site-packages/M2Crypto': Permission denied
>
> Ok, it looks like you M2Crypto built ok, but now you face this
> permission problem which is not specific to M2Crypto. You'd run into
> this with any 3rd party python module.
>
> > Since I don't have root privleges can I install the M2Crypto somewhere
> > else?
>
> You could manually copy the built M2Crypto directory somewhere in your
> home directory, for example:
>
> /home/mmedina/python2.3/site-packages/M2Crypto
>
> Then, you'd edit (or create) PYTHONPATH environment variable so that it
> contained /home/mmedina/python2.3/site-packages. After that you should
> be able to import M2Crypto in your scripts. In the future if you needed
> more 3rd party libs you could just place them as siblings of M2Crypto in
> your personal site-packages dir we created above.
>
> An alternative is to copy M2Crypto and any other 3rd party libs into the
> same dir where your python script is so that when you do an import, the
> 3rd party libs are found in the same dir.
> 
> -- 
>   Heikki Toivonen




More information about the Python-list mailing list