1

Closed

add virtual env failed, path with UnicodeDecodeError

description

hi,
i`m new to python&PTVS, when i create a new django project, i got this error:

(from pip log)

C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip__main__.py run on 07/08/14 16:59:43
Downloading/unpacking https://go.microsoft.com/fwlink/?LinkID=317969
Downloading from URL https://go.microsoft.com/fwlink/?LinkID=317969
Cannot determine compression type for file c:\users\中文名字\appdata\local\temp\pip-87au6t-unpack\fwlink.obj
Running setup.py (path:c:\users\中文名字\appdata\local\temp\pip-oa8y3e-build\setup.py) egg_info for package from https://go.microsoft.com/fwlink/?LinkID=317969
running egg_info
creating pip-egg-info\virtualenv.egg-info
writing pip-egg-info\virtualenv.egg-info\PKG-INFO
writing top-level names to pip-egg-info\virtualenv.egg-info\top_level.txt
writing dependency_links to pip-egg-info\virtualenv.egg-info\dependency_links.txt
writing entry points to pip-egg-info\virtualenv.egg-info\entry_points.txt
writing manifest file 'pip-egg-info\virtualenv.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

reading manifest file 'pip-egg-info\virtualenv.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'docs\_templates'
warning: no previously-included files matching '*' found under directory 'docs\_build'
writing manifest file 'pip-egg-info\virtualenv.egg-info\SOURCES.txt'
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 1234, in prepare_files
req_to_install.assert_source_matches_version()
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 464, in assert_source_matches_version
% (display_path(self.source_dir), version, self))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd6 in position 19: ordinal not in range(128)

i believe this is due to my no-ascii characters in the path, but i don`t know how to handle this, can you help me?
thanks in advance.
Closed Jul 14 at 9:16 PM by Zooba
Limitation of Python 2.x

comments

Zooba wrote Jul 8 at 12:34 PM

I don't think I put an option in this script to change the download location, so your best bet is probably to install pip yourself. The pip documentation for this is at http://pip.readthedocs.org/en/latest/installing.html#install-pip

If you're still running into the same issue after pip is installed, you can create a config file as described at http://pip.readthedocs.org/en/latest/user_guide.html#configuration and set:
[install]
build=<a path with only ascii characters>
Also, I'd expect pip to work fine for Python 3; this issue probably only exists for Python 2.

PinoPino wrote Jul 9 at 2:13 AM

hi Zooba,
i followed your hint, but still got the same error.
i try to install pip individually and it seems like the download zip file will always be put on path like this: 'c:\users\中文字符\appdata\local\temp\tmpdrg4_t\pip.zip\pip\' :(

so, i user second method. this is my pip.ini file:
[install]
build = e:\
and i put it just in the root of e: (e:)
well, at last i still get the same error.

am i misunderstood something?
thank you.

PinoPino wrote Jul 9 at 2:53 AM

sorry, my apology.
forget about the second method. (it requires the pip was installed successfully)
so, the first method i tried was still give me the error msg. is there any other workaround i can handle this?
thank you

PinoPino wrote Jul 10 at 7:36 AM

hi,
at last i found the solution, a simple one:
just modify the evn variable 'TEMP'&'TMP'
'%USERPROFILE%\AppData\Local\Temp' => 'path without no-ascii characters\AppData\Local\Temp'

that`s all. hope this will help others who encounter the same question :)

Zooba wrote Jul 14 at 9:15 PM

Glad that was resolved. Python 3.x should work fine, FYI; one of the main changes was intended to prevent issues like this.