I created a Python 3 virtualenv, like this:
mkproject -p python3 flowerid
But when I try to install anything with pip (inside this virtualenv) I get this error:
cd flowerid
pip install ipython
Traceback (most recent call last):
File "/Users/nicolas/.virtualenvs/flowerid/bin/pip", line 11, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pkg_resources/__init__.py", line 560, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2648, in load_entry_point
return ep.load()
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2302, in load
return self.resolve()
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2308, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pip/__init__.py", line 28, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pip/index.py", line 31, in <module>
from pip.wheel import Wheel, wheel_ext
File "/Users/nicolas/.virtualenvs/flowerid/lib/python3.6/site-packages/pip/wheel.py", line 6, in <module>
import compileall
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/compileall.py", line 20, in <module>
from concurrent.futures import ProcessPoolExecutor
File "/Library/Python/2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/Library/Python/2.7/site-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
Everything looks normal until the 'futures' import that goes to "/Library/Python/2.7".
I tried to set "--no-site-packages" when creating the virtualenv, but that doesn't change anything (and it shouldn't as it's the default).
I tried to use pip3 instead, same thing.
I tried to reinstall pip (in the virtualenv) with easy_install pip
, same thing...
Any other ideas? Thanks for your help.
Note: I usually use Python 2.7 - I do have many Python 2.7 packages installed globally - perhaps that's what create the conflicts?
I'm on OSX El Capitan.
Update: My virtualenv seems activated - it starts off using the pip and python from my virtualenv. And 'which python' uses python from the virtualenv.
(flowerid) nicolas@~/venv_projects/flowerid$ which python
/Users/nicolas/.virtualenvs/flowerid/bin/python