简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM