python - 为什么我在 pip 安装模块时得到这些 "WARNING: Target Directory <directory> already exists."?

标签 python python-3.x pip

这是一个例子,我刚刚安装了 pyimgur 来展示发生了什么。

C:\Users\MYSTERY_PERSON3000\programming\python\books\automate-the-boring-stuff-with-python>python -m pip install pyimgur
Collecting pyimgur
  Downloading https://files.pythonhosted.org/packages/07/8b/99df63567b53d5fa040f0048160fa0aa327b478821c2d8660841f6d45bea/pyimgur-0.6.0.tar.gz
Collecting requests
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl
Collecting certifi>=2017.4.17
  Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Installing collected packages: idna, chardet, urllib3, certifi, requests, pyimgur
    Running setup.py install for pyimgur ... done
Successfully installed certifi-2019.11.28 chardet-3.0.4 idna-2.8 pyimgur-0.6.0 requests-2.22.0 urllib3-1.25.7
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\certifi already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\certifi-2019.11.28.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\chardet already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\chardet-3.0.4.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\idna already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\idna-2.8.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\requests already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\requests-2.22.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\urllib3 already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\urllib3-1.25.7.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\MYSTERY_PERSON3000\AppData\Local\Programs\Python\Python38\Lib\bin already exists. Specify --upgrade to force replacement.

此外,当我重新安装已经安装的模块时,它会打印出类似的警告,而不是说模块已经安装。

最佳答案

它说你已经安装了那个包。那么为什么需要担心,但如果您想一次又一次地安装软件包,请尝试此命令。

pip3 install [package_name] --upgrade

关于python - 为什么我在 pip 安装模块时得到这些 "WARNING: Target Directory <directory> already exists."?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59162014/

相关文章:

python - Flask jwt扩展仅保护指定的请求方法

python - 在 AWS Lambda 函数中使用 python 运行 ffmpeg 命令的问题

python - 如何在 Windows 中离线更新整个 Anaconda Python 发行版?

python - 在python中将MAC地址转换为字节数组

python - Flask python 设置 : oauthlib version problems while installing

python - 如何将 "groupby()"生成的组作为列表获取?

python - 消费完所有消息后如何关闭kafka消费者?

python - 在元组中搜索集合

python - apt-get 安装旧版本的软件包(Ubuntu)

python - pip install rasterio 时遇到错误