python 3.x - virtualenv: cannot import name 'main' -
i'm having little trouble virtualenv on mac os x yosemite. after couldn't run virtualenv @ first, installed python 3 via brew
(previously installed via package on python.org). linked installation of python3, updated pip , ran pip3 install virtualenv
. when try run virtualenv (e.g. $ virtualenv --python=python3 ../virtualenv
), following error message.
traceback (most recent call last): file "/usr/local/bin/virtualenv", line 7, in <module> virtualenv import main file "/usr/local/bin/virtualenv.py", line 7, in <module> virtualenv import main importerror: cannot import name 'main'
can me this?
your virtualenv executable /usr/local/bin/virtualenv
importing virtualenv package /usr/local/bin/virtualenv.py
. guess package not 1 executable should importing. reason choosing 1 because in same directory.
first, check real virtualenv package is. in python3 terminal:
>>> import virtualenv >>> virtualenv.__file__
if not /usr/local/bin/virtualenv.py
, simplest way /usr/local/bin/virtualenv
import instead of /usr/local/bin/virtualenv.py
delete /usr/local/bin/virtualenv.py
(or can undo if doesn't work, rename virtualenv.py
else xvirtualenvx.py
).
Comments
Post a Comment