2015-10-18 32 views
1

我是烧瓶开发的初学者。virtualenv与此系统或可执行文件不兼容。

虽然我试图使用virtualenv,但它不断显示我的错误。 我通过网络搜索并尝试了他们推荐的所有内容,例如升级virtualenv,移动DLL文件夹,移动Python35.dll文件等,但它不起作用!

我也有问题,激活, C:\用户\형철\ VENV \激活 它也没有工作...

请给我一个help..for这2个问题。

我的Python版本是3.5 我使用窗口8.

Microsoft Windows [Version 6.3.9600] 
(c) 2013 Microsoft Corporation. All rights reserved. 

C:\Users\형철>virtualenv venv 
Using base prefix 'c:\\users\\형철\\appdata\\local\\programs\\python\\python35' 
New python executable in venv\Scripts\python.exe 
Failed to import the site module 
Traceback (most recent call last): 
File "C:\Users\형철\venv\lib\site.py", line 703, in <module> 
main() 
File "C:\Users\형철\venv\lib\site.py", line 670, in main 
virtual_install_main_packages() 
File "C:\Users\형철\venv\lib\site.py", line 554, in virtual_install_main_packa 
ges 
sys.real_prefix = f.read().strip() 
UnicodeDecodeError: 'cp949' codec can't decode byte 0xed in position 9: illegal 
multibyte sequence 
ERROR: The executable venv\Scripts\python.exe is not functioning 
ERROR: It thinks sys.prefix is 'c:\\users\\형철' (should be 'c:\\users\\형철\\ve 
nv') 
ERROR: virtualenv is not compatible with this system or executable 
Note: some Windows users have reported this error when they installed Python for 
"Only this user" or have multiple versions of Python installed. Copying the app 
ropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem. 

回答

0

也许有一些解决这个其他ENV设置,但我会重写WORKON_HOME变量(决定了virtualenvs存储)使用的东西没有韩文字符,似乎与这些斗争。我能够重现:

.whogan:~/tmp$ export WORKON_HOME=~/tmp/형철 
.whogan:~/tmp$ mkvirtualenv django-dev 
New python executable in django-dev/bin/python 
Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 17: ordinal not in range(128) 
ERROR: The executable django-dev/bin/python is not functioning 
ERROR: It thinks sys.prefix is u'/home/whogan/tmp/\ud615\ucca0' (should be u'/home/whogan/tmp/\ud615\ucca0/django-dev') 
ERROR: virtualenv is not compatible with this system or executable 

切换WORKON_HOME到其他路径解决了这个:

.whogan:~/tmp$ export WORKON_HOME=~/tmp/venvs 
.whogan:~/tmp$ mkvirtualenv django-dev 
New python executable in django-dev/bin/python 
Installing setuptools, pip, wheel...done. 
(django-dev).whogan:~/tmp$ 

也许设置为C:\ virtualenvs或相似。

编辑:作为@davidism指出,这是不使用virtualenvwrapper所以WORKON_HOME建议是无效的。相反,您可以先cd到另一个目录:

mkdir c:\virtualenvs 
cd C:\virtualenvs 
virtualenv (the virtualenv name) 
+0

该操作未使用virtualenvwrapper,因此'WORKON_HOME'是一个红色鲱鱼。尽管你在路径上关于unicode字符的观点可能仍然是正确的。 – davidism

+0

啊,是的,完全错过了,它已经有一段时间了,因为我是无包装的:) –

相关问题