[Bug 954595] Re: ImportError: cannot import name urandom from os

Keith Brisson kbrisson at gmail.com
Wed Mar 14 04:52:31 UTC 2012


I'll also retract my confirmation.  I do suspect it might have been
virtualenv-related.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python2.7 in Ubuntu.
https://bugs.launchpad.net/bugs/954595

Title:
  ImportError: cannot import name urandom from os

Status in “python2.7” package in Ubuntu:
  Invalid

Bug description:
  1) Description:	Ubuntu precise (development branch)
  Release:	12.04

  2) python2.7 2.7.3~rc1-1ubuntu2, libpython2.7 2.7.3~rc1-1ubuntu2,
  python2.7-minimal 2.7.3~rc1-1ubuntu2

  (tribune)niran at niran-MacPro:~/tribune/texastribune$ pip install -U fabric
  Traceback (most recent call last):
    File "/home/niran/.virtualenvs/tribune/bin/pip", line 9, in <module>
      load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
    File "/home/niran/.virtualenvs/tribune/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 337, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
    File "/home/niran/.virtualenvs/tribune/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2279, in load_entry_point
      return ep.load()
    File "/home/niran/.virtualenvs/tribune/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 1989, in load
      entry = __import__(self.module_name, globals(),globals(), ['__name__'])
    File "/home/niran/.virtualenvs/tribune/local/lib/python2.7/site-packages/pip/__init__.py", line 10, in <module>
      from pip.backwardcompat import u, walk_packages, console_to_str
    File "/home/niran/.virtualenvs/tribune/local/lib/python2.7/site-packages/pip/backwardcompat.py", line 66, in <module>
      from urllib2 import URLError, HTTPError
    File "/usr/lib/python2.7/urllib2.py", line 94, in <module>
      import httplib
    File "/usr/lib/python2.7/httplib.py", line 79, in <module>
      import mimetools
    File "/usr/lib/python2.7/mimetools.py", line 6, in <module>
      import tempfile
    File "/usr/lib/python2.7/tempfile.py", line 34, in <module>
      from random import Random as _Random
    File "/usr/lib/python2.7/random.py", line 47, in <module>
      from os import urandom as _urandom
  ImportError: cannot import name urandom

  (tribune)niran at niran-MacPro:~/tribune/texastribune$ python
  Python 2.7.2+ (default, Aug 16 2011, 07:24:41)
  [GCC 4.6.1] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import os
  >>> os.urandom
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  AttributeError: 'module' object has no attribute 'urandom'

  Downgrading all three packages to 2.7.2-13ubuntu5 makes pip work
  again, and importing urandom from os succeeds as well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/954595/+subscriptions




More information about the foundations-bugs mailing list