Skip to content


Subversion checkout URL

You can clone with
Download ZIP


now python2.7 requires _weakrefset #76

vbabiy opened this Issue · 6 comments

1 participant


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.

--- a/        2010-09-14 21:48:58.078562930 +0200
+++ b/        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:


the trace of the error:

$ python2.7 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/", line 67, in <module>

    import os

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

    import UserDict

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

    import _abcoll

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

    from abc import ABCMeta, abstractmethod

  File "./tmp/lib/python2.7/", 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

And the related changeset in Python source code:

Original Comment By: flox
  • Changed status from new to resolved.

Original Comment By: Jannis Leidel

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

Was working on the Pylons install script '' 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

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.

Original Comment By: Name:">flox

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
Something went wrong with that request. Please try again.