Skip to content

ImportError for Python3 #625

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saulshanabrook opened this issue Jun 27, 2014 · 5 comments
Closed

ImportError for Python3 #625

saulshanabrook opened this issue Jun 27, 2014 · 5 comments

Comments

@saulshanabrook
Copy link

Virtualenv fails to create a python 3 environment, but works on 2.7:

$  python3 --version
Python 3.4.1
$ virtualenv --version
1.11.6
$ virtualenv --python=/usr/local/bin/python3 python3project
Running virtualenv with interpreter /usr/local/bin/python3
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 14, in <module>
    import shutil
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shutil.py", line 11, in <module>
    import fnmatch
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/fnmatch.py", line 15, in <module>
    import functools
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py", line 21, in <module>
    from collections import namedtuple
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/collections/__init__.py", line 17, in <module>
    from reprlib import recursive_repr as _recursive_repr
  File "/usr/local/lib/python2.7/site-packages/reprlib.py", line 3, in <module>
    from repr import *
ImportError: No module named 'repr'
@dstufft
Copy link
Member

dstufft commented Dec 24, 2014

I had to revert the fix to this, because 12.0 was severely broken and nothing I could do seemed to fix it. Details - https://etherpad.openstack.org/p/pydistutils-issues.

@rsyring
Copy link

rsyring commented Jul 16, 2015

A workaround for this problem I found was to uninstall the pies2overrides package in my system python.

@furins
Copy link

furins commented Jul 17, 2015

+1 getting this as well. As a workaround I solved it by typing:

python3.4 `which virtualenv` --python=`which python3.4` --no-site-packages myvirtualenv

the key was to call the virtualenv script directly from python3.4.

@guyskk
Copy link

guyskk commented Nov 7, 2015

ImportError: cannot import name 'IntEnum'

My computer is windows installed python 2.7 and python 3.5.

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\virtualenv.py", line 23, in <module>
    import subprocess
  File "c:\python35\lib\subprocess.py", line 364, in <module>
    import signal
  File "c:\python35\lib\signal.py", line 4, in <module>
    from enum import IntEnum as _IntEnum
ImportError: cannot import name 'IntEnum'
Running virtualenv with interpreter c:\python35\python.exe

ERROR: InvocationError: C:\Python27\python.exe -m virtualenv --python c:\python35\python.exe py35 (see E:\work\py\validater\.tox\py35\log\py35-0.log)

It seems IntEnum not exists in python 2.7

E:\work\py\validater\.tox\py35>py2
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from enum import IntEnum
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name IntEnum
>>>
^C
E:\work\py\validater\.tox\py35>pip2 install enum -U
Requirement already up-to-date: enum in c:\python27\lib\site-packages
Requirement already up-to-date: setuptools in c:\python27\lib\site-packages (from enum)

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@stale stale bot closed this as completed Jan 22, 2019
@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants