2016-03-27 181 views
3

當我嘗試使用virtualenv創建新環境時,我遇到了此錯誤。我不認爲我應該用sudo運行命令。嘗試使用brew &然後virtualenv重新安裝python,但沒有任何救援。os上的virtualenv錯誤X

manishs-MacBook-Pro:manish Manish$ virtualenv manish 

New python executable in /Users/Manish/manish/manish/bin/python2.7 
Not overwriting existing python script /Users/Manish/manish/manish/bin/python (you must use /Users/Manish/manish/manish/bin/python2.7) 
Please make sure you remove any previous custom paths from your /Users/Manish/.pydistutils.cfg file. 
Installing setuptools, pip, wheel... 
    Complete output from command /Users/Manish/manish/manish/bin/python2.7 - setuptools pip wheel: 
    Collecting setuptools 
    Using cached setuptools-20.3.1-py2.py3-none-any.whl 
Collecting pip 
Collecting wheel 
Installing collected packages: setuptools, pip, wheel 
Exception: 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main 
    status = self.run(options, args) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run 
    prefix=options.prefix_path, 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_set.py", line 732, in install 
    **kwargs 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_install.py", line 835, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_install.py", line 1030, in move_wheel_files 
    isolated=self.isolated, 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 477, in move_wheel_files 
    generated.extend(maker.make(spec)) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 372, in make 
    self._make_script(entry, filenames, options=options) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 276, in _make_script 
    self._write_script(scriptnames, shebang, script, filenames, ext) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 250, in _write_script 
    self._fileop.write_binary_file(outname, script_bytes) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 401, in write_binary_file 
    with open(path, 'wb') as f: 
IOError: [Errno 1] Operation not permitted: '/bin/easy_install' 
---------------------------------------- 
...Installing setuptools, pip, wheel...done. 
Traceback (most recent call last): 
    File "/usr/local/bin/virtualenv", line 11, in <module> 
    sys.exit(main()) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 708, in main 
    symlink=options.symlink) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 941, in create_environment 
    download=download, 
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 897, in install_wheel 
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) 
    File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 792, in call_subprocess 
    % (cmd_desc, proc.returncode)) 
OSError: Command /Users/Manish/manish/manish/bin/python2.7 - setuptools pip wheel failed with error code 2 
+2

可能安裝了兩個蟒蛇(一個在系統級,通過自制另 - 一般'在/ usr/local/bin目錄/ easy_install'應該在首先是路徑,而不是'/ bin/easy_install')。您可以嘗試運行「釀造醫生」並檢查有關該路徑的投訴嗎? –

+0

'''brew doctor'''helps並提示我'''〜/ .pydistutils.cfg'''可能會導致一些問題。 – yeelan

回答

14

我刪除~/.pydistutils.cfg &它的工作

+2

這背後有什麼想法? – wolendranh

+0

如果您在項目根目錄中有'setup.cfg',請嘗試刪除它。爲我工作。 –