用virtualenv创建一个独立的Python运行环境时报错

dorothy@dorothy-XPS-8700:~/桌面/myproject$ virtualenv --no-site-packages p1
New python executable in /home/dorothy/桌面/myproject/p1/bin/python
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 14: ordinal not in range(128)
ERROR: The executable /home/dorothy/桌面/myproject/p1/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/home/dorothy/\u684c\u9762/myproject' (should be u'/home/dorothy/\u684c\u9762/myproject/p1')
ERROR: virtualenv is not compatible with this system or executable

报错。

解决:

将文件夹的路径更改到没有汉字的地方,比如,将文件夹建立在home下:

dorothy@dorothy-XPS-8700:~/ZX/myproject$ virtualenv --no-site-packages p1
New python executable in /home/dorothy/ZX/myproject/p1/bin/python
Installing setuptools, pip, wheel...done.
dorothy@dorothy-XPS-8700:~/ZX/myproject$ 

成功。

你可能感兴趣的:(报错记录)