删除python2.7后,mkvirtualenv不工作

删除python2.7后,mkvirtualenv不工作,python,pip,easy-install,Python,Pip,Easy Install,在我从笔记本电脑上删除python2.7之后,我开始出现这个错误。 我正在尝试使用/bin/easy\u install使用mkvirtualenv创建虚拟环境 我已经试过这个命令了 ╭─ fsadykov ~ ╰─() mkvirtualenv --python=`which python` example 这个呢 ╭─ fsadykov ~ ╰─() mkvirtualenv example

在我从笔记本电脑上删除python2.7之后,我开始出现这个错误。 我正在尝试使用
/bin/easy\u install
使用
mkvirtualenv
创建虚拟环境
我已经试过这个命令了

╭─ fsadykov ~
╰─() mkvirtualenv --python=`which python` example
这个呢

╭─ fsadykov ~
╰─()  mkvirtualenv  example                                                                                                                                              1 ↵
New python executable in /Users/fsadykov/virtualenvs/example/bin/python
Please make sure you remove any previous custom paths from your /Users/fsadykov/.pydistutils.cfg file.
Installing setuptools, pip, wheel...

  Complete output from command /Users/fsadykov/virt...s/example/bin/python - setuptools pip wheel:
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in links: /Library/Python/2.7/site-packages/virtualenv_support
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl
Collecting pip
  Using cached https://files.pythonhosted.org/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/easy_install'

----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 10, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 810, in main
    symlink=options.symlink,
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1105, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 952, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1042, in _install_wheel_with_search_dir
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 903, in call_subprocess
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /Users/fsadykov/virt...s/example/bin/python - setuptools pip wheel failed with error code 1
Python版本

╭─ fsadykov ~
╰─() python --version
Python 3.7.4
我想从我的MacBookPro中删除python2.7,如果它可以用于所有python3.7。但由于某种原因,我得到了这个错误

注意:此文件不存在
/bin/easy\u install

Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/easy_install'

嗨,我只能给你提个建议。您应该重新安装Python,然后再试一次—似乎缺少一些文件。然后将python和pip更新为最新版本。

嗨,这里我只能给你一些建议。您应该重新安装Python,然后再试一次—似乎缺少一些文件。然后将python和pip更新到最新版本。

我对VirtualEnvrapper不熟悉,但从日志记录来看,python 2.x似乎仍在使用。另外,您是否注意到日志记录中的警告:
请确保从/Users/fsadykov/.pydistutils.cfg文件中删除任何以前的自定义路径。
我不确定此文件的用途,但它可能包含Python 2.x安装的路径??权限错误可能是因为您需要root访问权限(
sudo
)才能写入
/bin
。谢谢您的评论。我试过使用
sudo
,但仍然面临这个错误<代码>sudo pip安装烧瓶收集烧瓶下载要求已满足:ITShazard>=0.24 in/usr/local/lib/python3.7/site-packages(来自烧瓶)(0.24)安装收集的软件包:Jinja2,Werkzeug,烧瓶错误:由于环境错误而无法安装软件包:[错误号1]不允许操作:'/bin/flask'我不熟悉VirtualEnvrapper,但从日志记录来看,Python 2.x似乎仍在使用。另外,您是否注意到日志记录中的警告:
请确保从/Users/fsadykov/.pydistutils.cfg文件中删除任何以前的自定义路径。
我不确定此文件的用途,但它可能包含Python 2.x安装的路径??权限错误可能是因为您需要root访问权限(
sudo
)才能写入
/bin
。谢谢您的评论。我试过使用
sudo
,但仍然面临这个错误<代码>sudo pip安装烧瓶收集烧瓶下载要求已满足:其危险>=0.24 in/usr/local/lib/python3.7/site-packages(来自烧瓶)(0.24)安装收集的软件包:Jinja2,Werkzeug,烧瓶错误:由于环境原因无法安装软件包错误:[Errno 1]不允许操作:'/bin/flask'
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/easy_install'