Virtualenv - IOError: [Errno 1] Операция не разрешена: '/ bin / easy_install' - PullRequest
0 голосов
/ 16 мая 2018

При выполнении этой команды:

$ sudo virtualenv ENV --python=python2.7

Я получаю следующее:

Running virtualenv with interpreter /usr/local/bin/python2.7

New python executable in /Users/bo3423/git/My-Project/ENV/bin/python2.7
Not overwriting existing python script /Users/bo3423/git/My-Project/ENV/bin/python (you must use /Users/bo3423/git/My-Project/ENV/bin/python2.7)
Please make sure you remove any previous custom paths from your /Users/bo3423/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
  Complete output from command /Users/bo3423/git/...ie/ENV/bin/python2.7 - setuptools pip wheel:
  The directory '/Users/bo3423/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/bo3423/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/8c/10/79282747f9169f21c053c562a0baa21815a8c7879be97abd930dbcf862e8/setuptools-39.1.0-py2.py3-none-any.whl (566kB)
Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_set.py", line 731, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 841, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 1040, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 476, in move_wheel_files
    generated.extend(maker.make(spec))
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 353, in make
    self._make_script(entry, filenames, options=options)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 257, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 231, in _write_script
    self._fileop.write_binary_file(outname, script_bytes)
  File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 388, 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 "/Library/Python/2.7/site-packages/virtualenv.py", line 2327, in <module>
    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/bo3423/git/...ie/ENV/bin/python2.7 - setuptools pip wheel failed with error code 2

У меня установлен python2.7, но также и python3, что может вызывать конфликт. Мне не удалось полностью удалить python3.

Каталог и файл / bin / easy_install не существуют, есть ли способ настроить virtualenv, чтобы он указывал на правильный каталог, где находится easy_install?

Я запускаю это на macOS. Любая помощь от любого, кто сталкивался с чем-то подобным, очень ценится!

1 Ответ

0 голосов
/ 17 мая 2018

Разобрался.Удалены все версии Python, virtualenv и easy_install.И переустановил все кроме Python3.

...