Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
gryphonOffline
15 Post subject: [solved] python in virtualenv fails to import urandom  PostPosted: 02.04.2012, 10:48



Joined: 2012-04-02
Posts: 9

Status: Offline
Trying to import random in a virtualenv results in the following error:

      Code:

(env)$ python
>>> import random
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/random.py", line 47, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom
>>>



Anyone else seeing this? Basically this renders a lot of python based programs useless.

Gryphon
AMD64


Last edited by gryphon on 02.04.2012, 12:59; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
gryphonOffline
Post subject: RE: python in virtualenv fails to import urandom after upgra  PostPosted: 02.04.2012, 12:59



Joined: 2012-04-02
Posts: 9

Status: Offline
So this appears to be a virtualenv issue. The way I've gotten around this was to create a new virtualenv and overwrite the old

      Code:

env/bin/python


in the previously created virtualenvs with the python binary from the newly created virtualenv.

gryphon
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio