老师,我用python2.7 还有python3.6都有这个问题,C:\Users\娜娜> virtualenv testvir
Using base prefix 'c:\\users\\娜娜\\appdata\\local\\programs\\python\\python36'
New python executable in C:\Users\娜娜\testvir\Scripts\python.exe
Failed to import the site module
Traceback (most recent call last):
File "C:\Users\娜娜\testvir\lib\site.py", line 703, in <module>
main()
File "C:\Users\娜娜\testvir\lib\site.py", line 670, in main
virtual_install_main_packages()
File "C:\Users\娜娜\testvir\lib\site.py", line 554, in virtual_install_main_packages
sys.real_prefix = f.read().strip()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 13: illegal multibyte sequence
ERROR: The executable C:\Users\娜娜\testvir\Scripts\python.exe is not functioning
ERROR: It thinks sys.prefix is 'c:\\users\\娜娜' (should be 'c:\\users\\娜娜\\testvir')
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 appropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.