Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create a python 3 virtualenv

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

like image 968
poiuytrez Avatar asked May 08 '26 16:05

poiuytrez


1 Answers

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...
like image 95
kennytm Avatar answered May 10 '26 04:05

kennytm