I have a virtual environment that I installed some time ago. When I activate it and run python I'm told that the version number is
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
What does the plus after the version number mean?
And could that somehow explain why the function os.urandom
is not defined, even when (according to the documentation) it has been there since version 2.4.
>>> from os import urandom
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name urandom
From the Python FAQ:
You may also find version numbers with a “+” suffix, e.g. “2.2+”. These are unreleased versions, built directly from the CPython development repository. In practice, after a final minor release is made, the version is incremented to the next minor version, which becomes the “a0” version, e.g. “2.4a0”.
And for your second question, the inability to import urandom in a virtualenv is a known problem.
This answer to a similar question should be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With