Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

now python2.7 requires _weakrefset #76

Closed
vbabiy opened this Issue Mar 14, 2011 · 6 comments

Comments

Projects
None yet
1 participant
Contributor

vbabiy commented Mar 14, 2011

There's a recent change in Python 2.7 which requires the inclusion of a new module in REQUIRED MODULES.

It is an issue for people using SVN checkout of Python 2.7, and for the upcoming Python 2.7.1.

#!diff
--- a/virtualenv.py        2010-09-14 21:48:58.078562930 +0200
+++ b/virtualenv.py        2010-09-14 21:46:20.650769346 +0200
@@ -51,6 +51,8 @@ REQUIRED_FILES = ['lib-dynload', 'config

 if sys.version_info[:2] >= (2, 6):
     REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc'])
+    if sys.version_info[:2] >= (2, 7):
+        REQUIRED_MODULES.extend(['_weakrefset'])
 if sys.version_info[:2] <= (2, 3):
     REQUIRED_MODULES.extend(['sets', '__future__'])
 if is_pypy:

Contributor

vbabiy commented Mar 14, 2011

the trace of the error:

$ python2.7 virtualenv.py tmp

New python executable in tmp/bin/python2.7

Also creating executable in tmp/bin/python

Traceback (most recent call last):

  File "./tmp/lib/python2.7/site.py", line 67, in <module>

    import os

  File "./tmp/lib/python2.7/os.py", line 398, in <module>

    import UserDict

  File "./tmp/lib/python2.7/UserDict.py", line 83, in <module>

    import _abcoll

  File "./tmp/lib/python2.7/_abcoll.py", line 11, in <module>

    from abc import ABCMeta, abstractmethod

  File "./tmp/lib/python2.7/abc.py", line 8, in <module>

    from _weakrefset import WeakSet

ImportError: No module named _weakrefset

ERROR: The executable tmp/bin/python2.7 is not functioning

ERROR: It thinks sys.prefix is '.' (should be './tmp')

ERROR: virtualenv is not compatible with this system or executable

Original Comment By: flox
Contributor

vbabiy commented Mar 14, 2011

And the related changeset in Python source code:
http://svn.python.org/view?view=rev&revision=84230


Original Comment By: flox
Contributor

vbabiy commented Mar 14, 2011

  • Changed status from new to resolved.

Original Comment By: Jannis Leidel
Contributor

vbabiy commented Mar 14, 2011

Thank you for this insight...wow..banged my head for hours trying to figure
this out.

Was working on the Pylons install script 'go-pylons.py' after changing Python
environments...updated with the new version check code above after line 43 and
it worked like a champ!


Original Comment By: Anonymous
Contributor

vbabiy commented Mar 14, 2011

I must be new enough that I'm missing something - what are the steps to solve
this issue? I'm getting the same trace shown by Name: ">flox above.
Thanks.


Original Comment By: Name:">flox
Contributor

vbabiy commented Mar 14, 2011

Anonymous -- if you're getting the above error when you try to create a
virtualenv with Python 2.7, the solution that worked for me was upgrading to
virtualenv 1.5.1+.


Original Comment By: Paul Bissex

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment