5

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
Mads Skjern
  • 5,648
  • 6
  • 36
  • 40

1 Answers1

5

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.

user2357112
  • 260,549
  • 28
  • 431
  • 505
David Cain
  • 16,484
  • 14
  • 65
  • 75