无法安装来自pip的任何软件包;wheel构建失败。

huangapple go评论68阅读模式
英文:

Unable to install ANY package from pip; wheel failed to build

问题

每当我尝试从pip安装任何包(例如pip install --upgrade bottle-websocket),我总是得到相同的错误,无法构建wheel。我已经尝试升级setuptools、wheel和pip等所有东西,但仍然收到相同的错误。

pip install --upgrade bottle-websocket
警告:由于无效的元数据条目'name',跳过/usr/local/lib/python3.11/dist-packages/pytube-12.1.3-py3.11.egg-info
正在收集 bottle-websocket
  正在使用缓存的 bottle-websocket-0.2.9.tar.gz(2.0 kB)
  准备元数据(setup.py)... 完成
正在收集 bottle(来自 bottle-websocket)
  正在使用缓存的 bottle-0.12.25-py3-none-any.whl(90 kB)
正在收集 gevent-websocket(来自 bottle-websocket)
  正在使用缓存的 gevent_websocket-0.10.1-py3-none-any.whl(22 kB)
要求已满足:gevent 在 /usr/lib/python3/dist-packages 中(来自 gevent-websocket->bottle-websocket)
正在构建 wheel 以收集的包:bottle-websocket
  正在为 bottle-websocket 构建 wheel(setup.py)... 错误
  错误:子进程以错误退出
  
  python setup.py bdist_wheel 未成功运行。
  退出代码:1
  > [41 行输出]
      正在运行 bdist_wheel
      正在运行 build
      正在运行 build_py
      创建 build
      创建 build/lib
      创建 build/lib/bottle_websocket
      复制 bottle_websocket/plugin.py -> build/lib/bottle_websocket
      复制 bottle_websocket/server.py -> build/lib/bottle_websocket
      复制 bottle_websocket/__init__.py -> build/lib/bottle_websocket
      /usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      
              ********************************************************************************
              请避免直接运行"setup.py"。
              而是使用pypa/build、pypa/installer、pypa/build或其他符合标准的工具。
      
              有关详细信息,请参阅https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html。
              ********************************************************************************
      
        self.initialize_options()
      正在安装到 build/bdist.linux-aarch64/wheel
      正在运行 install
      正在运行 install_lib
      创建 build/bdist.linux-aarch64
      创建 build/bdist.linux-aarch64/wheel
      创建 build/bdist.linux-aarch64/wheel/bottle_websocket
      复制 build/lib/bottle_websocket/plugin.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      复制 build/lib/bottle_websocket/__init__.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      复制 build/lib/bottle_websocket/server.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      正在运行 install_egg_info
      正在运行 egg_info
      正在写入 bottle_websocket.egg-info/PKG-INFO
      正在将依赖项链接写入 bottle_websocket.egg-info/dependency_links.txt
      正在写入要求到 bottle_websocket.egg-info/requires.txt
      正在写入顶级名称到 bottle_websocket.egg-info/top_level.txt
      正在读取清单文件 'bottle_websocket.egg-info/SOURCES.txt'
      正在写入清单文件 'bottle_websocket.egg-info/SOURCES.txt'
      复制 bottle_websocket.egg-info 到 build/bdist.linux-aarch64/wheel/bottle_websocket-0.2.9-py3.11.egg-info
      错误:[Errno 13] 权限被拒绝:'build/bdist.linux-aarch64/wheel/bottle_websocket-0.2.9-py3.11.egg-info/dependency_links.txt'
      [输出结束]
  
  注意:此错误源自子进程,可能与pip无关。
  错误:无法为bottle-websocket构建wheel
  运行 setup.py clean 以清理 bottle-websocket
无法为bottle-websocket构建wheel,这是安装基于pyproject.toml的项目所必需的错误。

这是错误信息。

英文:

Whenever I try to install any package from pip(pip install --upgrade bottle-websocketfor example)

I always get the same error, wheel fails to build, I have already tried to upgrade setuptools and wheel and pip, everything, but still I get the same error.


 pip install --upgrade bottle-websocket
WARNING: Skipping /usr/local/lib/python3.11/dist-packages/pytube-12.1.3-py3.11.egg-info due to invalid metadata entry 'name'
Collecting bottle-websocket                                                                                                          
  Using cached bottle-websocket-0.2.9.tar.gz (2.0 kB)
  Preparing metadata (setup.py) ... done
Collecting bottle (from bottle-websocket)
  Using cached bottle-0.12.25-py3-none-any.whl (90 kB)
Collecting gevent-websocket (from bottle-websocket)
  Using cached gevent_websocket-0.10.1-py3-none-any.whl (22 kB)
Requirement already satisfied: gevent in /usr/lib/python3/dist-packages (from gevent-websocket->bottle-websocket) (22.10.2)
Building wheels for collected packages: bottle-websocket
  Building wheel for bottle-websocket (setup.py) ... error
  error: subprocess-exited-with-error
  
  � python setup.py bdist_wheel did not run successfully.
  ? exit code: 1
  ??> [41 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/bottle_websocket
      copying bottle_websocket/plugin.py -> build/lib/bottle_websocket
      copying bottle_websocket/server.py -> build/lib/bottle_websocket
      copying bottle_websocket/__init__.py -> build/lib/bottle_websocket
      /usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!
      
              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer, pypa/build or
              other standards-based tools.
      
              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************
      
      !!
        self.initialize_options()
      installing to build/bdist.linux-aarch64/wheel
      running install
      running install_lib
      creating build/bdist.linux-aarch64
      creating build/bdist.linux-aarch64/wheel
      creating build/bdist.linux-aarch64/wheel/bottle_websocket
      copying build/lib/bottle_websocket/plugin.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      copying build/lib/bottle_websocket/__init__.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      copying build/lib/bottle_websocket/server.py -> build/bdist.linux-aarch64/wheel/bottle_websocket
      running install_egg_info
      running egg_info
      writing bottle_websocket.egg-info/PKG-INFO
      writing dependency_links to bottle_websocket.egg-info/dependency_links.txt
      writing requirements to bottle_websocket.egg-info/requires.txt
      writing top-level names to bottle_websocket.egg-info/top_level.txt
      reading manifest file 'bottle_websocket.egg-info/SOURCES.txt'
      writing manifest file 'bottle_websocket.egg-info/SOURCES.txt'
      Copying bottle_websocket.egg-info to build/bdist.linux-aarch64/wheel/bottle_websocket-0.2.9-py3.11.egg-info
      error: [Errno 13] Permission denied: 'build/bdist.linux-aarch64/wheel/bottle_websocket-0.2.9-py3.11.egg-info/dependency_links.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bottle-websocket
  Running setup.py clean for bottle-websocket                                                                                        
Failed to build bottle-websocket
ERROR: Could not build wheels for bottle-websocket, which is required to install pyproject.toml-based projects


This is the error

答案1

得分: 0

我成功解决了问题,答案很简单,我必须以root权限执行它,我输入了sudo -i并输入了安装命令,它起作用了!

英文:

So I made it work out, the answer was simple, I had to do it with root privileges, I typed sudo -i and typed in the installation command and it worked!

答案2

得分: -1

尝试运行pip install cmake命令,并确保已安装和升级了wheel、setuptools和pip包。

如果这不起作用,请尝试使用pip3而不是pip,或者如果问题出现在pip上(可能没有正确安装),请尝试使用python -m,像这样:

python -m pip install cmake

python3 -m pip install cmake

英文:

Try to run the pip install cmake command and make sure you have the wheel, setuptools, and pip packages installed and upgraded.

If that doesn't work, try using pip3 instead of pip, or if it is a problem with pip (maybe it is not installed correctly), try using python -m, like this:

python -m pip install cmake
or
python3 -m pip install cmake

huangapple
  • 本文由 发表于 2023年5月11日 16:13:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76225461.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定