所以我的问题是它在哪里?
有什么方法可以改变它吗?
我的Windows 8计算机出了问题。
PYTHONPATH=C:\Python27;C:\Python27\Lib
python的输出:
>>> import sys
>>> sys.prefix
'C:\\Python27'
同样在这里:
python -c "import sys; print sys.prefix"
C:\Python27
来自ipython:
ipython -c "import sys; print sys.prefix"
Defaulting color scheme to 'NoColor'
c:\Python27 # low c
最后我遇到了virtualenv
:
Traceback (most recent call last):
File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\virtualenv.py", line 832, in main
symlink=options.symlink)
File "c:\python27\lib\site-packages\virtualenv.py", line 994, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "c:\python27\lib\site-packages\virtualenv.py", line 1192, in install_python
copy_required_modules(home_dir, symlink)
File "c:\python27\lib\site-packages\virtualenv.py", line 1130, in copy_required_modules
dst_filename = change_prefix(filename, dst_prefix)
File "c:\python27\lib\site-packages\virtualenv.py", line 1095, in change_prefix
(filename, prefixes)
AssertionError: Filename C:\Python27\Lib\os.py does not start with any of these prefixes: ['c:\\python27']
为什么他们不同?
如此快速的解决方案就是用低'c'来改变PYTHONPATH
,这看起来很难看。