Skip to content
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

Fails to create python 3 virtualenv #35

Closed
saulshanabrook opened this issue Jun 25, 2014 · 12 comments
Closed

Fails to create python 3 virtualenv #35

saulshanabrook opened this issue Jun 25, 2014 · 12 comments

Comments

@saulshanabrook
Copy link

$ vf new --python=/usr/local/bin/python3 finance-scraper3
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.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shutil.py", line 11, in <module>
    import fnmatch
  File "/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/fnmatch.py", line 15, in <module>
    import functools
  File "/usr/local/Cellar/python3/3.4.0/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.0/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'
Error: The virtualenv wasn't created properly.
virtualenv returned status 1.
@daisylb
Copy link
Collaborator

daisylb commented Jun 25, 2014

Do you get the same error when you run virtualenv --python=/usr/local/bin/python3 $VIRTUALFISH_HOME/finance-scraper3? Have you tried upgrading virtualenv, or installing Python 3.4.1?

@saulshanabrook
Copy link
Author

The virtualenv command fails, but pyvenv-3.4 ~/.virtualenvs/finance-scraper3 succeeds. Does it make sense to use pyvenv instead of virtualenv?
https://docs.python.org/dev/library/venv.html

@justinmayer
Copy link
Owner

For what it's worth, I use Virtualfish to create Python 3 virtual environments quite frequently, and I have never encountered that error. (Mac OS X 10.9, Homebrewed Python 3.4.1)

I don't think it makes sense to use pyvenv instead of virtualenv, at least at this stage. Consistency across Python 2.7 and 3.x seems like a higher priority.

@saulshanabrook
Copy link
Author

Apparently virtualenv uses pyvenv in 3 anyway.

The Python 3 version of virtualenv actually subclasses the standard library's implementation and provides hooks to automatically install setuptools and pip into the environment which pyvenv doesn't do on it's own.
I raised this issue on the virtualenv page (pypa/virtualenv#625), because it seems to not be related to the virtualfish part.

@Ivoz
Copy link

Ivoz commented Jun 27, 2014

@saulshanabrook as a maintainer of virtualenv, sorry to say that that SO answer is false :/ It's something we're looking towards for the future though.

@daisylb
Copy link
Collaborator

daisylb commented Dec 28, 2015

I've since run into this one myself, and I've found that a workaround is to install virtualenv and virtualfish in Python 3.5 - although, that probably only works because nothing else is installed globally in 3.5 on my machine.

Since this bug has been unfixed in virtualenv for at least a year, I'm wondering whether it might be worthwhile trying to work around it in virtualfish?

@justinmayer
Copy link
Owner

For what it's worth, I just upgraded my global Python 2.7 site-packages to Pip 8.0.2, Setuptools 20.0, and Virtualenv 14.0.6 and ran vf new -p python3 foo without any problems. Perhaps the aforementioned issue has been resolved.

@Ivoz
Copy link

Ivoz commented Feb 12, 2016

Hopefully by >=14.0 from pypa/virtualenv#805

@daisylb
Copy link
Collaborator

daisylb commented Feb 12, 2016

Oh, good. That saves us a lot of effort on our end. Thankyou, @LVoz!

@sunu
Copy link

sunu commented May 13, 2016

Unfortunately I'm on virtualenv 15.0.1 and pip 8.1.2 and I still face this issue 😞

@Ivoz
Copy link

Ivoz commented May 21, 2016

@sunu feel free to report it on main virtualenv repo to get looked at, if relevant

@findways
Copy link

findways commented Jun 7, 2016

I was having this issue as well and nothing was working. I uninstalled anaconda2 and installed anaconda3 and there was no problem making a virtualenv for 3.4 after this update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants