0
我有Python 2.6中的Windows 7上我的默認的Python,我試圖讓虛擬包膜與Python 2.7VIRTUALENV不同的Python版本不能在Windows工作
我有蟒蛇2.6在C: \ Python26和Python 2.7在C:\ Python27
當我嘗試使用virtualenv -p
我得到這個
C:\web\xxx>virtualenv -p "C:\Python27\python.exe" --no-site-packages venv
Running virtualenv with interpreter C:\Python27\python.exe
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\virtualenv.py", line 2577, in <module>
main()
File "C:\Python26\lib\site-packages\virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "C:\Python26\lib\site-packages\virtualenv.py", line 1081, in create_environment
site_packages=site_packages, clear=clear))
File "C:\Python26\lib\site-packages\virtualenv.py", line 1277, in install_python
copy_required_modules(home_dir)
File "C:\Python26\lib\site-packages\virtualenv.py", line 1215, in copy_required_modules
dst_filename = change_prefix(filename, dst_prefix)
File "C:\Python26\lib\site-packages\virtualenv.py", line 1185, in change_prefix
(filename, prefixes)
AssertionError: Filename C:\Python26\Lib\os.py does not start with any of these prefixes: ['C:\\Python27']
我做錯什麼了嗎?
,這似乎是做一個聰明的方式,但virtualenv未安裝python27,僅適用於python26。 C:\ Python27 \ python virtualenv --no-site-packages venv' 'C:\ Python27 \ python:無法打開文件'virtualenv':[Errno 2 ]沒有這樣的文件或目錄' – apelliciari 2013-04-28 09:43:27
@avastreg - 我的壞,我應該使用virtualenv.py的整個路徑和擴展名。它不是特定於版本的,所以它應該可以使用2.7以及2.6。 – tdelaney 2013-04-28 19:40:01