Python and SSL enabled

matey monica.medina at
Wed Nov 1 23:56:39 CET 2006

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

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


import M2Crypto

u = M2Crypto.m2urllib.URLopener()'')

However I got the following errror:

Traceback (most recent call last):
  File "", line 3, in ?
    import M2Crypto
  File "/home/mmedina/python2.3/site-packages/M2Crypto/",
line 14, in ?
    import __m2crypto
ImportError: python: fatal: relocation error: file
/home/mmedina/python2.3/site-packages/M2Crypto/ 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

I ran the and received the following:

Traceback (most recent call last):
  File "", line 61, in ?
    from M2Crypto import Rand
line 14, in ?
    import __m2crypto
ImportError: No module named __m2crypto

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 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