[英]Why am I getting these "WARNING: Target Directory <directory> already exists." when I pip install a module?
Here's an example, I just installed pyimgur to show what's going on.这是一个例子,我刚刚安装了 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.
Also when I reinstall modules that are already installed it prints out similar warnings instead of saying the module is already installed.此外,当我重新安装已安装的模块时,它会打印出类似的警告,而不是说模块已安装。
It says you have already installed that packages.它说您已经安装了这些软件包。 Then why need to worry but if you want to install packages again and again try this command.那么为什么需要担心,但是如果您想一次又一次地安装软件包,请尝试使用此命令。
pip3 install [package_name] --upgrade
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.