Opened 12 years ago

Closed 12 years ago

#35685 closed defect (invalid)

python27 @2.7.3_0 cannot import module 'random'

Reported by: dboris (Boris D.) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: jyrkiwahlstedt
Port: python27

Description

After fresh install of macports on Mountain Lion, python27 gives the following error:

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom

Not sure if it's related, but the version reported by python is also wrong: 2.7.2, while the installed and activated port should be 2.7.3.

Change History (1)

comment:1 in reply to:  description Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jwa@… added
Port: python27 added
Resolution: invalid
Status: newclosed

Replying to borisd@…:

After fresh install of macports on Mountain Lion, python27 gives the following error:

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 

This is Apple's Python included with OS X, not MacPorts'.

[snip]

Not sure if it's related, but the version reported by python is also wrong: 2.7.2, while the installed and activated port should be 2.7.3.

Further evidence of above.

If you want to use MacPorts python27, run "python2.7" or else use "sudo port select python python27".

Note: See TracTickets for help on using tickets.