突然设置新的env时,Python virtualenv找不到'mac_ver'属性

时间:2015-06-29 08:54:18

标签: python virtualenv setuptools virtualenvwrapper

今天早上,我在Yosemite(10.10.3)的Macbook Pro上遇到了Virtualenv的问题:

  $ virtualenv ENV
  New python executable in ENV/bin/python2.7
  Also creating executable in ENV/bin/python
  Installing setuptools, pip, wheel...
    Complete output from command /Users/USER/Docu...jp/ENV/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module>
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/__init__.py", line 72, in load_module
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 967, in <module>
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 970, in Environment
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 260, in get_supported_platform
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 424, in _macosx_vers
  AttributeError: 'module' object has no attribute 'mac_ver'
  ----------------------------------------
  ...Installing setuptools, pip, wheel...done.
  Traceback (most recent call last):
    File "/usr/local/bin/virtualenv-3.4", line 9, in <module>
      load_entry_point('virtualenv==13.0.3', 'console_scripts', 'virtualenv-3.4')()
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 832, in main
      symlink=options.symlink)
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
      install_wheel(to_install, py_executable, search_dirs)
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
      'PIP_NO_INDEX': '1'
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
      % (cmd_desc, proc.returncode))
  OSError: Command /Users/USER/Docu...jp/ENV/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1

我正在使用与brew安装的virtualenv:

  $ which virtualenv
  /usr/local/bin/virtualenv

注意,我正在使用fishshell但是在bash下试过,我有类似的症状。卸载python,pyenv和virtualenv并开始新鲜(使用自制程序)并没有解决问题。可能是什么问题?我很挣扎。

谢谢你的帮助

0 个答案:

没有答案