我一直在关注本教程: https://python-guide.readthedocs.org/en/latest/dev/virtualenvs/
当我在终端输入时:
virtualenv venv
正如预期的那样,我的目录中会弹出一个文件夹,但是没有激活'文件。只有python,python2和python2.7
我试过这只是为了找不到命令。
AJs-MacBook-Pro-4:petrarch AJ$ source venv/bin/python2.7
-bash: ????: command not found
抱歉!请帮助这个新手。
当我再次输入virtualenv venv
时,我明白了:
AJs-MacBook-Pro-4:petrarch AJ$ virtualenv venv
New python executable in venv/bin/python
Installing setuptools, pip...
Complete output from command /Users/AJ/Desktop/st...arch/venv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "//anaconda/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/__init__.py", line 9, in <module>
File "//anaconda/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/log.py", line 8, in <module>
File "//anaconda/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/backwardcompat/__init__.py", line 66, in <module>
File "//anaconda/lib/python2.7/urllib2.py", line 94, in <module>
import httplib
File "//anaconda/lib/python2.7/httplib.py", line 71, in <module>
import socket
File "//anaconda/lib/python2.7/socket.py", line 47, in <module>
import _socket
ImportError: dlopen(/Users/AJ/Desktop/stanford-ner-2014-06-16/phoenix_pipeline/petrarch/petrarch/venv/lib/python2.7/lib-dynload/_socket.so, 2): Symbol not found: __PyInt_AsInt
Referenced from: /Users/AJ/Desktop/stanford-ner-2014-06-16/phoenix_pipeline/petrarch/petrarch/venv/lib/python2.7/lib-dynload/_socket.so
Expected in: dynamic lookup
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "//anaconda/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.11.6', 'console_scripts', 'virtualenv')()
File "//anaconda/lib/python2.7/site-packages/virtualenv.py", line 824, in main
symlink=options.symlink)
File "//anaconda/lib/python2.7/site-packages/virtualenv.py", line 992, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "//anaconda/lib/python2.7/site-packages/virtualenv.py", line 960, in install_wheel
'PIP_NO_INDEX': '1'
File "//anaconda/lib/python2.7/site-packages/virtualenv.py", line 902, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/AJ/Desktop/st...arch/venv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1