pycharm安装removebg modules的时候报错,请大神帮我指点一下如何解决。谢谢

查看 96|回复 8
作者:潇麟   
Collecting removebg
  Downloading removebg-0.04.tar.gz (2.2 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  python setup.py egg_info did not run successfully.
  exit code: 1
  
  [18 lines of output]
  C:\Users\Administrator\pythonpro\pythonProject\.venv\Lib\site-packages\setuptools\dist.py:320: InformationOnly: Normalizing '0.04' to '0.4'
    self.metadata.version = self._normalize_version(
  C:\Users\Administrator\pythonpro\pythonProject\.venv\Lib\site-packages\setuptools\dist.py:510: SetuptoolsDeprecationWarning: Invalid dash-separated options
  !!
  
          ********************************************************************************
          Usage of dash-separated 'description-file' will not be supported in future
          versions. Please use the underscore name 'description_file' instead.
  
          This deprecation is overdue, please update your project and remove deprecated
          calls to avoid build errors in the future.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    opt = self.warn_dash_deprecation(opt, section)
  error: [WinError 6] �����Ч��: 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-pip-egg-info-uax1vzmw\\removebg.egg-info\\tmp1f5_mwqd' -> 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-pip-egg-info-uax1vzmw\\removebg.egg-info\\PKG-INFO'
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[notice] A new release of pip is available: 23.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip

帮我, 大神

zhuiyu   

试下升级pip。
python.exe -m pip install --upgrade pip
潇麟
OP
  


zhuiyu 发表于 2024-10-28 10:51
试下升级pip。
python.exe -m pip install --upgrade pip

升级了还这样子,而后运行pycharm报错C:\Users\Administrator\pythonpro\pythonProject\.venv\Scripts\python.exe "C:\Users\Administrator\pythonpro\pythonProject\.venv\Include\hello world.py"
Traceback (most recent call last):
  File "C:\Users\Administrator\pythonpro\pythonProject\.venv\Include\hello world.py", line 1, in
    import removebg
ModuleNotFoundError: No module named 'removebg'
进程已结束,退出代码为 1
lisongmei   


潇麟 发表于 2024-10-28 15:08
升级了还这样子,而后运行pycharm报错C:%users\Administrator\pythonpro\pythonProject\.venv\Scripts\py ...

提示缺少包,安装包
pip install removebg
潇麟
OP
  


lisongmei 发表于 2024-10-28 15:12
提示缺少包,安装包
pip install removebg

C:\Windows\System32>pip install removebg
Collecting removebg
  Using cached removebg-0.04.tar.gz (2.2 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Collecting setuptools>=40.8.0
        Using cached setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
      Using cached setuptools-75.2.0-py3-none-any.whl (1.2 MB)
      Installing collected packages: setuptools
      ERROR: Could not install packages due to an OSError: [WinError 6] 句柄无效。: 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-build-env-dm8bmovl\\overlay\\Lib\\site-packages\\setuptools-75.2.0.dist-info\\INSTALLERt0y7ud38.tmp' -> 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-build-env-dm8bmovl\\overlay\\Lib\\site-packages\\setuptools-75.2.0.dist-info\\INSTALLER'
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
运行之后报错,就是因为报错我才过来咨询的。
lisongmei   


潇麟 发表于 2024-10-28 15:15
lisongmei 发表于 2024-10-28 15:12
提示缺少包,安装包
pip install removebg

C:\Users\Administrator\pythonpro\pythonProject\.venv\Lib\site-packages\setuptools\dist.py:510: SetuptoolsDeprecationWarning: Invalid dash-separated options
  !!
好像这个过期了。不再支持破折号分割符dash-separated,支持下划线underscore 。
please update your project and remove deprecated
叫你升级你的产品,但是具体哪个我就不晓得了
要不你看看那个dist.py文件里有没有 破折号分割符.....以上猜测,仅作参考,我暂没遇到过这类问题。
潇麟
OP
  


lisongmei 发表于 2024-10-28 15:31
C:%users\Administrator\pythonpro\pythonProject\.venv\Lib\site-packages\setuptools\dist.py:510: Set ...

哥们,这里面没看到破折号分隔符呀,是不是问题就不好解决了
挥泪踏红尘   

你可以尝试以下解决方法:
1. 更新 pip:首先,根据提示升级你的 pip 工具。你可以运行以下命令来更新 pip 到最新版本:
    python -m pip install --upgrade pip
2. 清除缓存:有时候包安装过程中的问题可能是由于缓存引起的。你可以尝试清除 pip 的缓存,然后再次尝试安装包:
    python -m pip cache purge
3. 手动安装:如果上述方法不起作用,你可以尝试手动下载 `removebg` 包的源码,并进行安装。你可以从它的源代码仓库或者官方发布页面下载源码,并使用以下命令进行安装:
    pip install /path/to/removebg-0.04.tar.gz
潇麟
OP
  


挥泪踏红尘 发表于 2024-10-30 16:54
你可以尝试以下解决方法:
1. 更新 pip:首先,根据提示升级你的 pip 工具。你可以运行以下命令来更新 pip ...

removebg安装包的源码从哪里下载呀?
您需要登录后才可以回帖 登录 | 立即注册

返回顶部