1、使用命令
python3 -m site --user-site /Users/nxy/Library/Python/3.9/lib/python/site-packages
2、安装插件
pip3 install pytz Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pytz in /Library/Python/3.7/site-packages (2022.1)
3、解决方案:
python3 -m pip install --upgrade pip DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (22.1.1) Collecting pip Downloading pip-22.1.2-py3-none-any.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 34.7 kB/s eta 0:00:00 Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 22.1.1 Uninstalling pip-22.1.1: Successfully uninstalled pip-22.1.1
4、再次安装发现神奇的好了
pip3 install pytz DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Collecting pytz Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.5/503.5 kB 42.4 kB/s eta 0:00:00 Installing collected packages: pytz DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Successfully installed pytz-2022.1