4
我使用在MacOS Python和我必須設置一個問題python2.7環境。我已經在系統上安裝了python2.7和python3.6。並運行下面的代碼來設置python2.7環境。我不知道爲什麼我得到這個錯誤。從輸出我看到它使用/anaconda/lib/python3.6
目錄。我怎樣才能讓它使用python2.7
環境?如何通過virtualenv創建python2.7環境?
$ virtualenv --python=/usr/bin/python2.7 venv/
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /Users/joey/dev/jump/jump-api/venv/bin/python2.7
Traceback (most recent call last):
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2869, in <module>
main()
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 1231, in install_python
copy_exe_shared_libs_and_symlinks(executable, py_executable, home_dir)
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2828, in copy_exe_shared_libs_and_symlinks
of = codefile(f, rpaths)
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2799, in codefile
return machofile(file, list(initial_rpaths_transitive))
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2422, in __init__
_, sos = zip(*mach_o_find_dylibs(file))
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2386, in mach_o_find_dylibs
do_file(ofile, find_lc_load_dylib, offset_size(), results, regex)
File "/anaconda/lib/python3.6/site-packages/virtualenv.py", line 2355, in do_file
do_file(file, offset_size(offset, size), *args)
TypeError: do_file() takes at least 4 arguments (3 given)
您正在使用Anaconda ...你見過[documentations](https://conda.io/docs/using/envs.html)嗎? – Pouria
我如何使用的virtualenv,而不是蟒蛇的? –