【发布时间】:2020-12-11 17:49:43
【问题描述】:
我有一台 Macbook Air,想安装 pip。我有更新的python版本。我按照所有说明进行操作,但无法安装任何软件包。
我研究了 1 个多小时,看了很多文章和问题,但我想不通。
这是我尝试安装 pip 时在终端上显示的内容,然后安装了一个名为 beautifulsoup 的包:
arnau@MacBook-Air-de-Arnau ~ % python --version
Python 2.7.16
arnau@MacBook-Air-de-Arnau ~ % curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1840k 100 1840k 0 0 320k 0 0:00:05 0:00:05 --:--:-- 439k
arnau@MacBook-Air-de-Arnau ~ % python get-pip.py
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
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.2
Uninstalling pip-20.2.2:
Successfully uninstalled pip-20.2.2
WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/arnau/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
NOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.
Successfully installed pip-20.2.2
arnau@MacBook-Air-de-Arnau ~ % pip install beautifulsoup4
zsh: command not found: pip
arnau@MacBook-Air-de-Arnau ~ %
我不明白发生了什么或我应该怎么做才能解决错误。
【问题讨论】:
-
我一直在关注这个教程:ahmadawais.com/install-pip-macos-os-x-python 被许多堆栈溢出用户推荐,但它不起作用
标签: python macos python-2.7 terminal pip