airtime_virtualenv "ImportError: cannot import name urandom" in logs
  • Hi, I just received this output via email and searches on google hint at needing to run virtualenv within the install directory. We're already running on a production system so I'd like to hear some confirmation before proceeding. Should I worry about this?

    Traceback (most recent call last):
      File "/usr/lib/airtime/airtime_virtualenv/bin/pip", line 9, in <module>
        load_entry_point('pip==0.7.2', 'console_scripts', 'pip')()
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 299, in load_entry_point
        return get_distribution(dist).load_entry_point(group, name)
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 2229, in load_entry_point
        return ep.load()
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 1948, in load
        entry = __import__(self.module_name, globals(),globals(), ['__name__'])
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/__init__.py", line 10, in <module>
        from pip.basecommand import command_dict, load_command, load_all_commands
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/basecommand.py", line 6, in <module>
        import urllib2
      File "/usr/lib/python2.6/urllib2.py", line 94, in <module>
        import httplib
      File "/usr/lib/python2.6/httplib.py", line 78, in <module>
        import mimetools
      File "/usr/lib/python2.6/mimetools.py", line 6, in <module>
        import tempfile
      File "/usr/lib/python2.6/tempfile.py", line 34, in <module>
        from random import Random as _Random
      File "/usr/lib/python2.6/random.py", line 47, in <module>
        from os import urandom as _urandom
    ImportError: cannot import name urandom 

    I got the same output back to back. Thank you.
  • 2 Comments sorted by

  • You should run the following commands:

    sudo rm /usr/lib/airtime/airtime_virtualenv/bin/python
    sudo cp /usr/bin/python /usr/lib/airtime/airtime_virtualenv/bin/

    Then restart pypo and media-monitor

    sudo service airtime-media-monitor restart
    sudo service airtime-playout restart (if pre-Airtime 2.2.0 this command will temporarily interrupt playout for 2 seconds) 

    Airtime Pro Hosting: http://airtime.pro
  • Thanks for all the help, Martin. I appreciate it.