-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unable to create vrtualenv with 1.11 (when virtualenv installed by ez_install/setuptools) #524
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
Comments
+1 |
Same issue here
|
I have different problem with the same virtualenv version. Instead of traceback I'm getting |
marking for 1.11.1 |
I can replicate this. this occurs when virtualenv is installed with easy_install (or "python setup.py install") cc @pfmoore |
this is related to the zip imports that are now occurring. |
Yep, I see it too. Looks like a setuptools bug - the assertion error occurs in pkg_resources and it looks like it's because we have a zipfile on sys.path (i.e., we're using zipimport) where the zipfile is inside a setuptools "unpacked egg" format package, Beyond that, I don't know - I don't know why pkg_resources is making this check. Maybe @jaraco can comment? |
Not sure that pypa/pip#1422 will help - we'll still be using |
better to fix the setuptools bug, but one thought if pip is independent of setuptools, is to not add the wheels to pythonpath (which leads to the zip pkg_resources failures) but rather to make the the pip wheel executable (not exactly sure how that works), and use it as such in the virtualenv creation |
That might work. And it might also be a useful feature anyway - to have a |
Is this the same issue as I'm having? Virtualenv works when installed with pip but not with easy_install. I have a different stacktrace to the OP though. The ones using ez_setup.py have these versions:
whereas the ones using distribute_setup.py have
The following are all done on a clean vagrant 'precise64' Ubuntu box. WORKING:
WORKING:
WORKING:
WORKING:
NOT WORKING:
NOT WORKING:
NOT WORKING:
NOT WORKING:
The NOT WORKING ones all produce this output:
|
@pfmoore not sure if you're monitoring the setuptools issue, but that's fairly well understood now, and I opened a PR for discussion, if you care to make any comment. https://bitbucket.org/pypa/setuptools/pull-request/32 the point being is that I don't think we have to rely on a pip-only solution to this |
@qwcode yes, I saw your fix, looks OK to me (although I haven't actually tested it myself, as I can't do much more than apply the patch and try reproducing this issue, which I guess you've done). I'd certainly much rather it get fixed in setuptools. If we get a new setuptools release, I assume we need to do a quick virtualenv release to bundle the updated setuptools. Not sure if ensurepip also needs updating. |
Reverting virtualenv to version 1.10.1 (instead of 1.11) fixes the issue. |
@flyte likely the same issue, although I'm not sure why your trace reports differently with a pkg_resources ImportError @jaytaylor yes, this bug is a compatibility issue with a new virtualenv-1.11 feature and setuptools. |
the setuptools PR for this (https://bitbucket.org/pypa/setuptools/pull-request/32) has been merged and will be released in setuptools 2.0.3 I've tested an easy_install'ed virtualenv, that included a tip-built setuptools (that has the fix), and it works. leaving this open, until the 2.03 release, when we can bundle it into virtualenv_support. |
closing, as the fixed setuptools (v2.1) is now included in virtualenv_support in 1.11.X |
This still happens on 1.11.1 - I'm opening a different issue for this: #552 |
This is still causing issues for me:
Versions:
|
@therealprologic your error is different than the others above. the error is "Could not find an activated virtualenv (required)" I'm guessing you're setting @pfmoore has this come up in an issue already? thinking we should specifically unset |
On Wed, Mar 5, 2014 at 3:17 PM, Marcus Smith [email protected]:
Downgrading virtualenv to James Mills / prologic E: [email protected] |
I scanned the vitualenvwrapper code but don't see it setting anything. |
On Wed, Mar 5, 2014 at 3:27 PM, Marcus Smith [email protected]:
Problem is I'm not doing this anywhere. James Mills / prologic E: [email protected] |
roger that. just saying that something is setting it. : ) |
On Wed, Mar 5, 2014 at 3:35 PM, Marcus Smith [email protected]:
If you can think of anything else that might, I'm happy to check! James Mills / prologic E: [email protected] |
do you have any PIP_* env variables, or anything custom in pip.conf? |
On Wed, Mar 5, 2014 at 3:45 PM, Marcus Smith [email protected]:
Ahh now we're talking! See:
So I have no idea where the James Mills / prologic E: [email protected] |
that's it. you need to unset it before running your mkvirtualenv command.
not PIP_REQUIRE_VIRTUALENV |
Except that this is my work OS X desktop and I don't set any such env bars
|
@qwcode yeah, unsetting |
Just FYI, the virtualenv 1.11.5 (Mar. 3 release) regressed with same issue. Downgraded to 1.11.2 solve the problem. Please check my question, https://stackoverflow.com/questions/23448796/creating-new-virtualenv-failed-with-setuptools-issue |
THX to all ,I fix my problem |
Hi Everyone, Not sure if this is the same issue, but I'm getting the following 'errors' when I try to use virtualenv (it also happens for version 1.10.1 and 1.11.6):
I'm using python 3.4.2 and pip 1.5.6. Both python and pip were installed using MacPorts, and virtualenv installed using pip. I'm on a mac (Yosemite). Thanks |
That's extremely weird, Template should be a standard python library class. |
I've seen that type of ImportError when some package 'foo' is in sys.path ahead of the standard library package of the same name. |
Looks like a similar error, Please help! New python executable in venv/bin/python ...Installing setuptools, pip, wheel...done. |
I am having a similar error on Centos 7 with Python 3.3. Has anyone been able to solve this?? Here's my command:
And Error:
|
I had a very similar issues on my Windows 7 machine. Both paths, to python and to my VE had spaces in it. Couple of months before it worked fine. I found the following note on virtualenv website: Windows Notes
So at least the Anaconda (python) installation simple, non space-pollutted path was crucial. Maybe win32api installation was also important. Not sure. |
@gkoshyk I have the exact same issue as you did. Did you solve it? |
I was recently getting this error on OS X 10.10.4. I ended up doing a fresh install of python (2.7.9) with brew, reopened my terminal and "virtualenv venv" worked fine. |
When I recently ran in to this problem within a Windows installation of Python 2.7.10 and the latest update for virtualenv and setuptools, I hit the internet and found nothing but "this is already fixed" messages from 2014. Thank you to @ellockie for suggesting the simple solution of making sure Python is installed in a path without any spaces. I uninstalled my current installation (c:\DevTools\Python 27), and reinstalled to a new directory (c:\DevTools\Python27) and it worked the first time. Cheers! |
@shuaiw I was not able to resolve it. |
I just did a "brew install python" on Yosemite followed by "virtualenv flaskapp" but it still conks out with "OSError: Command /Users/foo/src/python/flaskapp/bin/python -c "import sys, pip; sys...d"] + sys.argv[1:]))" setuptools pip failed with error code 1" |
on the pip install it mentions: "AttributeError: 'module' object has no attribute 'mac_ver'" in: File "/Library/Python/2.7/site-packages/virtualenv_support/pip-6.0.8-py2.py3-none-any.whl/pip/_vendor/pkg_resources/init.py", line 352, in _macosx_vers |
Hi there, could all new comments with a similar problem please open a new issue instead of posting a comment. This issue is getting far too convoluted, and its hard to see if problems mentioned are all coming from the same source or have differences. |
This will work for virtualenv pip wheel errorcode1 problems and also E unable to locate package problems
|
Even i was having the same problem with python virtualenv It got corrected by a simple restart
|
Is there any more info that I can provide?
The text was updated successfully, but these errors were encountered: