![](/img/trans.png)
[英]how to install python2 packages via pip when I have both python2 and python3?
[英]How to completely remove python2 from OSX so that Brew Install NEOVIM and have the latest version of Python
請包括終端步驟以刪除此 pip 錯誤和 python2
|===> pip install homebrew
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: homebrew in ./Library/Python/2.7/lib/python/site-packages (0.2.1)
|===> pip install homebrew
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: homebrew in ./Library/Python/2.7/lib/python/site-packages (0.2.1)
____________________
|===> brew install neovim
-bash: brew: command not found
____________________
|===> pip install brew
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting brew
Downloading brew-0.1.4.zip (48 kB)
|████████████████████████████████| 48 kB 386 kB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0q/n_flnz9j637ds046sshnyvzc0000gp/T/pip-install-K9LQMe/brew/setup.py'"'"'; __file__='"'"'/private/var/folders/0q/n_flnz9j637ds046sshnyvzc0000gp/T/pip-install-K9LQMe/brew/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/0q/n_flnz9j637ds046sshnyvzc0000gp/T/pip-pip-egg-info-jnO1ML
cwd: /private/var/folders/0q/n_flnz9j637ds046sshnyvzc0000gp/T/pip-install-K9LQMe/brew/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/0q/n_flnz9j637ds046sshnyvzc0000gp/T/pip-install-K9LQMe/brew/setup.py", line 22, in <module>
with open('requirements.txt') as fid:
IOError: [Errno 2] No such file or directory: 'requirements.txt'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
|===> pip uninstall python2
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Skipping python2 as it is not installed.
單獨安裝本機 python2 macos,您的某些系統實用程序可能需要它。
如果需要homebrew安裝python3,請執行以下操作:
xcode-select --install, developer.apple.com/downloads or Xcode
然后,在命令行上:
如圖所示在這里:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
或按照那里的建議:
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
安裝homebrew
后,您可以brew install python3
,如解釋here
pip install homebrew
將安裝Python包管狀的,你可以從蟒蛇進口。 IDK 那個包是做什么的,但很有可能它是一個使用 python 來幫助生成brew installable
應用程序的實用程序 - 可能不是你想要的!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.