trouble with creating a virtual environment in Windows 8, python 3.3

2024/10/2 3:20:39

I'm trying to create a virtual environment in Python, but I always get an error no matter how many times I re-install python-setuptools and pip.

My computer is running Windows 8, and I'm using Python 3.3.

E:\Documents\proj>virtualenv venv --distribute
Using base prefix 'c:\\Python33'
New python executable in venv\Scripts\python.exe
Installing setuptools, pip...Complete output from command E:\Documents\proj\venv\Scripts\python.exe -c "imp
ort sys, pip; pip...ll\"] + sys.argv[1:])" setuptools pip:Traceback (most recent call last):File "<string>", line 1, in <module>File "<frozen importlib._bootstrap>", line 1567, in _find_and_loadFile "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlockedFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\pip-1.5-py2.py3-none-any.whl\pip\__init__.py", line 9, in <module>File "<frozen importlib._bootstrap>", line 1567, in _find_and_loadFile "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlockedFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\pip-1.5-py2.py3-none-any.whl\pip\log.py", line 8, in <module>File "<frozen importlib._bootstrap>", line 1567, in _find_and_loadFile "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlockedFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 2696, in <modul
e>File "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 429, in __init_
_File "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 443, in add_ent
ryFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 1722, in find_i
n_zipFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 1298, in has_me
tadataFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 1614, in _hasFile "c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv_suppo
rt\setuptools-2.0.2-py2.py3-none-any.whl\pkg_resources.py", line 1488, in _zipin
fo_name
AssertionError: c:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\EGG-INFO
\PKG-INFO is not a subpath of c:\Python33\lib\site-packages\virtualenv-1.11-py3.
3.egg\virtualenv_support\setuptools-2.0.2-py2.py3-none-any.whl\
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):File "C:\Python33\Scripts\virtualenv-script.py", line 9, in <module>load_entry_point('virtualenv==1.11', 'console_scripts', 'virtualenv')()File "C:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv.py",
line 820, in mainsymlink=options.symlink)File "C:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv.py",
line 988, in create_environmentinstall_wheel(to_install, py_executable, search_dirs)File "C:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv.py",
line 956, in install_wheel'PIP_NO_INDEX': '1'File "C:\Python33\lib\site-packages\virtualenv-1.11-py3.3.egg\virtualenv.py",
line 898, in call_subprocess% (cmd_desc, proc.returncode))
OSError: Command E:\Documents\proj\venv\Scripts\python.exe -c "import sys, pip;
pip...ll\"] + sys.argv[1:])" setuptools pip failed with error code 1
Answer

I've found a solution to this problem. Only the latest virtualenv (v1.11) which was released just a few days ago has this problem. Remove the egg from your site-packages folder and install the previous version via easy_install virtualenv==1.10.1, virtualenv will work fine.

https://en.xdnf.cn/q/70891.html

Related Q&A

Python imaplib search email with date and time

Im trying to read all emails from a particular date and time. mail = imaplib.IMAP4_SSL(self.url, self.port) mail.login(user, password) mail.select(self.folder) since = datetime.strftime(since, %d-%b-%Y…

cumsum() on multi-index pandas dataframe

I have a multi-index dataframe that shows the sum of transactions on a monthly frequency. I am trying to get a cumsum() on yearly basis that respects my mapid and service multi-index. However I dont kn…

Python SSL Certification Problems in Tensorflow

Im trying to download the MNIST data which is supposedly handled in: tensorflow.examples.tutorials.mnist.input_data.read_data_sets() As far as Im aware read_data_sets sends a pull request to a server t…

How do I get a python program to run instead of opening in Notepad?

I am having some trouble with opening a .py file. I have a program that calls this .py file (i.e. pathname/example.py file.txt), but instead of running the python program, it opens it in Notepad. How t…

How to find a keys value from a list of dictionaries?

How do I get a given keys value from a list of dictionaries? mylist = [{powerpoint_color: blue,client_name: Sport Parents (Regrouped)},{sort_order: ascending,chart_layout: 1,chart_type: bar} ]The numb…

Wandering star - codeabbey task

Im trying to solve this problem and Im not sure what to do next. Link to the problem Problem statement: Suppose that some preliminary image preprocessing was already done and you have data in form of …

Find delimiter in txt to convert to csv using Python

I have to convert some txt files to csv (and make some operation during the conversion).I use csv.Sniffer() class to detect wich delimiter is used in the txt This codewith open(filename_input, r) as f1…

Assert mocked function called with json string in python

Writing some unit tests in python and using MagicMock to mock out a method that accepts a JSON string as input. In my unit test, I want to assert that it is called with given arguments, however I run i…

read certificate(.crt) and key(.key) file in python

So im using the JIRA-Python module to connect to my companys instance on JIRA and it requires me to pass the certificate and key for this. However using the OpenSSL module,im unable to read my local ce…

Admin FileField current url incorrect

In the Django admin, wherever I have a FileField, there is a "currently" box on the edit page, with a hyperlink to the current file. However, this link is appended to the current page url, an…