Python virtualenv ImportError:没有名为_vendor的模块

时间:2016-09-14 13:46:59

标签: python pip virtualenv

我在我的系统上安装了virtualenv但是当我想要实际创建虚拟环境时,我收到以下错误:

...
Successfully installed virtualenv-15.0.3
$ virtualenv venv
New python executable in /Users/.../venv/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /Users/.../venv/bin/python - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 578, in get_data
    loader = get_loader(package)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 464, in get_loader
    return find_loader(fullname)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 474, in find_loader
    for importer in iter_importers(fullname):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 430, in iter_importers
    __import__(pkg)
ImportError: No module named _vendor
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 944, in create_environment
    download=download,
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/.../venv/bin/python - setuptools pip wheel failed with error code 1

为什么会失败的任何建议?

1 个答案:

答案 0 :(得分:1)

这似乎是pip与本机OS X版Python结合使用的问题。我从https://www.python.org/下载了python,并且能够正确安装pipvirtualenv