当前位置:   article > 正文

【已解决】 error: subprocess-exited-with-error × python setup.py egg_info did not run successfully._error: subprocess-exited-with-error 脳 python setup

error: subprocess-exited-with-error 脳 python setup.py develop did not run s

问题描述

        今天遇到这个问题:ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/visionx/anaconda3/envs/gdem/lib/python3.8/site-packages/pkg_resources/__init__.py),其实这种问题很常见,希望给大家统一讲一下如何处理的,我们从头开始!

        具体描述为:

  1. Collecting torch_sparse
  2. Using cached torch_sparse-0.6.18.tar.gz (209 kB)
  3. Preparing metadata (setup.py) ... error
  4. error: subprocess-exited-with-error
  5. × python setup.py egg_info did not run successfully.
  6. exit code: 1
  7. ╰─> [8 lines of output]
  8. Traceback (most recent call last):
  9. File "<string>", line 2, in <module>
  10. File "<pip-setuptools-caller>", line 34, in <module>
  11. File "/tmp/pip-install-mu4fnmkw/torch-sparse_7b1f67db8d584e36bedf832159648d4b/setup.py", line 11, in <module>
  12. from torch.utils.cpp_extension import (
  13. File "/home/visionx/anaconda3/envs/gdem/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 28, in <module>
  14. from pkg_resources import packaging # type: ignore[attr-defined]
  15. ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/visionx/anaconda3/envs/gdem/lib/python3.8/site-packages/pkg_resources/__init__.py)
  16. [end of output]
  17. note: This error originates from a subprocess, and is likely not a problem with pip.
  18. error: metadata-generation-failed
  19. × Encountered error while generating package metadata.
  20. ╰─> See above for output.
  21. note: This is an issue with the package mentioned above, not pip.
  22. hint: See above for details.
  23. (gdem) visionx@visionx:/media/visionx/monica/project24/GDEM$ pip install torch_sparse
  24. Collecting torch_sparse
  25. Using cached torch_sparse-0.6.18.tar.gz (209 kB)
  26. Preparing metadata (setup.py) ... error
  27. error: subprocess-exited-with-error
  28. × python setup.py egg_info did not run successfully.
  29. exit code: 1
  30. ╰─> [8 lines of output]
  31. Traceback (most recent call last):
  32. File "<string>", line 2, in <module>
  33. File "<pip-setuptools-caller>", line 34, in <module>
  34. File "/tmp/pip-install-11nj3e0o/torch-sparse_e89b9d926f354738a403de89b0c3a695/setup.py", line 11, in <module>
  35. from torch.utils.cpp_extension import (
  36. File "/home/visionx/anaconda3/envs/gdem/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 28, in <module>
  37. from pkg_resources import packaging # type: ignore[attr-defined]
  38. ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/visionx/anaconda3/envs/gdem/lib/python3.8/site-packages/pkg_resources/__init__.py)
  39. [end of output]
  40. note: This error originates from a subprocess, and is likely not a problem with pip.
  41. error: metadata-generation-failed
  42. × Encountered error while generating package metadata.
  43. ╰─> See above for output.
  44. note: This is an issue with the package mentioned above, not pip.
  45. hint: See above for details.

        看图: 

原因分析和解决

        1、在我的主页搜索torch

        2、结果如下,点击113这个

        3、选择这个网址https://pytorch-geometric.com/whl/

        4、选择对应版本安装,命令为:

pip install torch_sparse-0.6.18+pt21cu118-cp38-cp38-linux_x86_64.whl

        5、解决 

相关链接

Python Setup.py Egg_info Error Code (Solution) | Master Data Skills + AIWhile working with Python packages, programmers may encounter a specific error — 'python setup.py egg_info' failed with error code 1. This error is related to the package installation process and can arise due to several reasons, such as outdated or improperly installed pip or other package installation tools. You can fix the 'python setup.py egg_info'icon-default.png?t=N7T8https://blog.enterprisedna.co/python-setup-py-egg_info-error-code/https://pytorch-geometric.com/whl/torch-2.1.2%2Bcu118.htmlicon-default.png?t=N7T8https://pytorch-geometric.com/whl/torch-2.1.2%2Bcu118.html

完结撒花

        结束了,都结束了。

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号