We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
|
7
2
|
Having trouble with virtualenv on Windows 7. I run:
It returns:
I have the following environment variables:
Installed ActiveState Python:
I updated the PYTHONPATH=C:\Python27;C:\Python27\Lib Still looking for a solution, I found and removed AppData/Python*. Reinstalled Python and now have a different error:
I hacked Lib/socket.py and inserted:
Above
The reason was that I was able to import socket from straight python prompt! So stuffed my existing path. I haven't narrowed down exactly which directory made it happy. It at least will reveal to someone else why I am getting the error without it. Ideas? Suggestions? Thank you. :) I hacked Lib/socket.py and inserted:
Above
| ||||||||||||||||
|
|
11
|
Try to set This can be done at the command prompt by typing | ||||||||
|
|
5
|
3 year old question, but hopefully this answer can still help someone. Rather than setting the environment variables (which mysteriously didn't work for me), you can pass the path to your Python installation when setting up the virtual environment. In Windows, you have to path out to python.exe, but it seems that in Linux/OS X you just path to the folder. Examples: Windows:
Linux/Mac:
Both create a virtual environment in subfolder "venv" in current directory. | ||
|
4
|
For the _socket error, change your pythonpython path to:
| ||
|
2
|
Its strange but from the error message
It seems, it expects the path-name for the file As the path to the library is derived from like
| ||||
|
|
1
|
I hate "summary" answers, but as I just went through a very similar issue I thought I would post my solution here as well which draws from several of these answers.
The full PYTHONPATH environment variable should look follows:
| ||
|
1
|
I have added
to virtualenv.py and it works. | ||
|
0
|
I also ran into this problem on Windows 7. My Python27 installation was under C:\Program Files, which obviously contains a space in the path. So, on a separate Windows 7 system that did not contain Python, I did a fresh install of Python27 under C:\Python27 (the default installation path), followed by an install of setuptools (for easy_install). Afterwards, I was able to install virtualenv CLEANLY without the above assertion error (I used easy_install). I know that the OP's system is already using the default path, but I thought I would add my experience here as a possible solution for certain specific cases. | |||
|
0
|
This issue is presumably a hangover from other more case-sensitive file systems. Complete solution:
The only change I made to fix the bug was as follows. The change should take effect for any new command / terminal sessions (close your open cmd.exe / powershell / etc. windows).
If you have any other items in your PYTHONPATH, you might as well change those too, but it probably won't affect virtualenv's ability to run. | |||
|
0
|
Change "virtualenv.py" --> change_prefix with:
| ||
|
0
|
I had the same assertion error from a slightly different cause. The error was | ||
|
0
|
This is an error already submitted to the Python development team:https://github.com/pypa/virtualenv/pull/697 In the meanwhile why not just change the Python installation folder name to (ptyhon27) to make the assertion work, or if you feel more confortable with that just reinstall python using the alternative location. It works with no issue. |
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
|
7
2
|
Having trouble with virtualenv on Windows 7. I run:
It returns:
I have the following environment variables:
Installed ActiveState Python:
I updated the PYTHONPATH=C:\Python27;C:\Python27\Lib Still looking for a solution, I found and removed AppData/Python*. Reinstalled Python and now have a different error:
I hacked Lib/socket.py and inserted:
Above
The reason was that I was able to import socket from straight python prompt! So stuffed my existing path. I haven't narrowed down exactly which directory made it happy. It at least will reveal to someone else why I am getting the error without it. Ideas? Suggestions? Thank you. :) I hacked Lib/socket.py and inserted:
Above
| ||||||||||||||||
|
|
11
|
Try to set This can be done at the command prompt by typing | ||||||||
|
|
5
|
3 year old question, but hopefully this answer can still help someone. Rather than setting the environment variables (which mysteriously didn't work for me), you can pass the path to your Python installation when setting up the virtual environment. In Windows, you have to path out to python.exe, but it seems that in Linux/OS X you just path to the folder. Examples: Windows:
Linux/Mac:
Both create a virtual environment in subfolder "venv" in current directory. | ||
|
4
|
For the _socket error, change your pythonpython path to:
| ||
|
2
|
Its strange but from the error message
It seems, it expects the path-name for the file As the path to the library is derived from like
| ||||
|
|
1
|
I hate "summary" answers, but as I just went through a very similar issue I thought I would post my solution here as well which draws from several of these answers.
The full PYTHONPATH environment variable should look follows:
| ||
|
1
|
I have added
to virtualenv.py and it works. | ||
|
0
|
I also ran into this problem on Windows 7. My Python27 installation was under C:\Program Files, which obviously contains a space in the path. So, on a separate Windows 7 system that did not contain Python, I did a fresh install of Python27 under C:\Python27 (the default installation path), followed by an install of setuptools (for easy_install). Afterwards, I was able to install virtualenv CLEANLY without the above assertion error (I used easy_install). I know that the OP's system is already using the default path, but I thought I would add my experience here as a possible solution for certain specific cases. | |||
|
0
|
This issue is presumably a hangover from other more case-sensitive file systems. Complete solution:
The only change I made to fix the bug was as follows. The change should take effect for any new command / terminal sessions (close your open cmd.exe / powershell / etc. windows).
If you have any other items in your PYTHONPATH, you might as well change those too, but it probably won't affect virtualenv's ability to run. | |||
|
0
|
Change "virtualenv.py" --> change_prefix with:
| ||
|
0
|
I had the same assertion error from a slightly different cause. The error was | ||
|
0
|
This is an error already submitted to the Python development team:https://github.com/pypa/virtualenv/pull/697 In the meanwhile why not just change the Python installation folder name to (ptyhon27) to make the assertion work, or if you feel more confortable with that just reinstall python using the alternative location. It works with no issue. |

1121








