2017-02-22 83 views
0

我收到以下错误,每当我做virtualenv venv。我已经通过sudo pip install --user virtualenvIO错误,而这样做的virtualenv VENV在Python的Mac OSX

New python executable in /Users/rajrohit/Desktop/Work/LambdaAnsible/TestLambda/venv/bin/python 
Please make sure you remove any previous custom paths from your /Users/rajrohit/.pydistutils.cfg file. 
Installing setuptools, pip, wheel... 
    Complete output from command /Users/rajrohit/Desk...mbda/venv/bin/python - setuptools pip wheel: 
    Collecting setuptools 
    Using cached setuptools-34.2.0-py2.py3-none-any.whl 
Collecting pip 
Collecting wheel 
Collecting packaging>=16.8 (from setuptools) 
    Using cached packaging-16.8-py2.py3-none-any.whl 
Collecting appdirs>=1.4.0 (from setuptools) 
    Using cached appdirs-1.4.0-py2.py3-none-any.whl 
Collecting six>=1.6.0 (from setuptools) 
    Using cached six-1.10.0-py2.py3-none-any.whl 
Collecting pyparsing (from packaging>=16.8->setuptools) 
    Using cached pyparsing-2.1.10-py2.py3-none-any.whl 
Installing collected packages: six, pyparsing, packaging, appdirs, setuptools, pip, wheel 
Exception: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 784, in install 
    **kwargs 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 851, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 1064, in move_wheel_files 
    isolated=self.isolated, 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 478, in move_wheel_files 
    generated.extend(maker.make(spec)) 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 372, in make 
    self._make_script(entry, filenames, options=options) 
    File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.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 "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.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 "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 407, 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 "/Library/Python/2.7/site-packages/virtualenv.py", line 713, in main 
    symlink=options.symlink) 
    File "/Library/Python/2.7/site-packages/virtualenv.py", line 945, in create_environment 
    download=download, 
    File "/Library/Python/2.7/site-packages/virtualenv.py", line 901, in install_wheel 
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) 
    File "/Library/Python/2.7/site-packages/virtualenv.py", line 797, in call_subprocess 
    % (cmd_desc, proc.returncode)) 
OSError: Command /Users/rajrohit/Desk...mbda/venv/bin/python - setuptools pip wheel failed with error code 2 

如何与这个权限错误的工作,使工作的virtualenv正确安装的virtualenv?

+0

你可以参考这个stackoverflow后http://askubuntu.com/questions/675296/changing-ownership-operation-not-permitted-even-as-root –

+0

为什么你使用sudo吨安装virtualenv? –

回答