为什么得到这些“警告:目标目录<目录>已存在”。当我点安装模块?

时间:2019-12-03 17:01:46

标签: 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.

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

1 个答案:

答案 0 :(得分:0)

它表示您已经安装了这些软件包。那么为什么要担心,但是如果您想一次又一次地安装软件包,请尝试使用此命令。

pip3 install [package_name] --upgrade