3

I do not succeed to create a python 3 virtualenv. This is what I get:

poiuytrez$ virtualenv --no-site-packages -p /usr/local/bin/python3.5
Running virtualenv with interpreter /usr/local/bin/python3.5
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/enum/__init__.py", line 371, in __getattr__
    return cls._member_map_[name]
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 23, in <module>
    import subprocess
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 364, in <module>
    import signal
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/Library/Python/2.7/site-packages/enum/__init__.py", line 373, in __getattr__
    raise AttributeError(name)
AttributeError: _convert

I am running OS X 10.11.4

2

1 Answer 1

2

You are using the virtualenv for Python 2.7 to create a virtual environment for Python 3.5, which I don't think will work.

Instead of virtualenv, On Python 3.3+ you could use the built-in pyvenv tool to create a virtual environment instead.

$ pyvenv-3.5 env
$ . env/bin/activate
(env)$ # etc...
Sign up to request clarification or add additional context in comments.

1 Comment

When I do that and run python --version, it says python 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.