简体   繁体   English

为什么我会收到这些“警告:目标目录<directory>已经存在。”当我 pip 安装模块时?

[英]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.

相关问题 python pip 模块安装产生警告目标目录/python/bin 已存在 - python pip module installations produces WARNING Target directory /python/bin already exists 使用 pip 下载模块时收到警告 - I am getting a warning while downloading a module using pip Pip已经安装:但我没有得到名为lxml的模块 - Pip is already installed: but I am getting no module named lxml 为什么我收到错误没有这样的文件或目录? - Why am I getting the error no such file or directory? 点安装到目标目录失败 - pip install to target directory fail 在尝试设置virtualenv时,为什么会出现此错误(与pip和easy_install相关)? - Why am I getting this error (related to pip and easy_install) when trying to setup a virtualenv? 为什么我收到错误消息:“FileExistsError: [WinError 183] 当文件已存在时无法创建文件”? - Why am I getting the error: "FileExistsError: [WinError 183] Cannot create a file when that file already exists"? PyDev - 为什么我在同一目录中获得未解析的模块(文件)导入? - PyDev - why am I getting unresolved import for a module (file) in the same directory? 为什么我无法在工作目录中导入模块? - Why am I unable to import a module in my working directory? pip 安装本地包到目标目录 - pip install local package to target directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM