当前位置:   article > 正文

Python-share package安装问题解决方案_error: subprocess-exited-with-error 脳 python setup

error: subprocess-exited-with-error 脳 python setup.py bdist_wheel did not r

报错:

  1. C:\Users\jingsheng.liu>pip install Share
  2. Collecting Share
  3. Using cached share-1.0.4.tar.gz (5.9 kB)
  4. Preparing metadata (setup.py) ... done
  5. Building wheels for collected packages: Share
  6. Building wheel for Share (setup.py) ... error
  7. error: subprocess-exited-with-error
  8. × python setup.py bdist_wheel did not run successfully.
  9. │ exit code: 1
  10. ╰─> [60 lines of output]
  11. running bdist_wheel
  12. running build
  13. running build_py
  14. creating build
  15. creating build\lib
  16. creating build\lib\share
  17. copying share\config.py -> build\lib\share
  18. copying share\data.py -> build\lib\share
  19. copying share\server.py -> build\lib\share
  20. copying share\sock.py -> build\lib\share
  21. copying share\tran_server.py -> build\lib\share
  22. copying share\__init__.py -> build\lib\share
  23. running build_scripts
  24. creating build\scripts-3.8
  25. copying and adjusting bin\share -> build\scripts-3.8
  26. installing to build\bdist.win-amd64\wheel
  27. running install
  28. running install_lib
  29. creating build\bdist.win-amd64
  30. creating build\bdist.win-amd64\wheel
  31. creating build\bdist.win-amd64\wheel\share
  32. copying build\lib\share\config.py -> build\bdist.win-amd64\wheel\.\share
  33. copying build\lib\share\data.py -> build\bdist.win-amd64\wheel\.\share
  34. copying build\lib\share\server.py -> build\bdist.win-amd64\wheel\.\share
  35. copying build\lib\share\sock.py -> build\bdist.win-amd64\wheel\.\share
  36. copying build\lib\share\tran_server.py -> build\bdist.win-amd64\wheel\.\share
  37. copying build\lib\share\__init__.py -> build\bdist.win-amd64\wheel\.\share
  38. running install_data
  39. creating build\bdist.win-amd64\wheel\share-1.0.4.data
  40. creating build\bdist.win-amd64\wheel\share-1.0.4.data\data
  41. Traceback (most recent call last):
  42. File "<string>", line 2, in <module>
  43. File "<pip-setuptools-caller>", line 34, in <module>
  44. File "C:\Users\jingsheng.liu\AppData\Local\Temp\pip-install-dizvi0q1\share_3bec5e901da746d894346812606cc50e\setup.py", line 11, in <module>
  45. setup(
  46. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\core.py", line 148, in setup
  47. dist.run_commands()
  48. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 966, in run_commands
  49. self.run_command(cmd)
  50. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
  51. cmd_obj.run()
  52. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\site-packages\wheel\bdist_wheel.py", line 335, in run
  53. self.run_command('install')
  54. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
  55. self.distribution.run_command(command)
  56. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
  57. cmd_obj.run()
  58. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\install.py", line 61, in run
  59. return orig.install.run(self)
  60. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\command\install.py", line 557, in run
  61. self.run_command(cmd_name)
  62. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
  63. self.distribution.run_command(command)
  64. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
  65. cmd_obj.run()
  66. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\command\install_data.py", line 56, in run
  67. dir = convert_path(f[0])
  68. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\util.py", line 122, in convert_path
  69. raise ValueError("path '%s' cannot be absolute" % pathname)
  70. ValueError: path '/etc' cannot be absolute
  71. [end of output]
  72. note: This error originates from a subprocess, and is likely not a problem with pip.
  73. ERROR: Failed building wheel for Share
  74. Running setup.py clean for Share
  75. Failed to build Share
  76. Installing collected packages: Share
  77. Running setup.py install for Share ... error
  78. error: subprocess-exited-with-error
  79. × Running setup.py install for Share did not run successfully.
  80. │ exit code: 1
  81. ╰─> [47 lines of output]
  82. running install
  83. running build
  84. running build_py
  85. creating build
  86. creating build\lib
  87. creating build\lib\share
  88. copying share\config.py -> build\lib\share
  89. copying share\data.py -> build\lib\share
  90. copying share\server.py -> build\lib\share
  91. copying share\sock.py -> build\lib\share
  92. copying share\tran_server.py -> build\lib\share
  93. copying share\__init__.py -> build\lib\share
  94. running build_scripts
  95. creating build\scripts-3.8
  96. copying and adjusting bin\share -> build\scripts-3.8
  97. running install_lib
  98. byte-compiling c:\users\jingsheng.liu\appdata\local\programs\python\python38\Lib\site-packages\share\server.py to server.cpython-38.pyc
  99. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\Lib\site-packages\share\server.py", line 187
  100. except Fault, f:
  101. ^
  102. SyntaxError: invalid syntax
  103. running install_data
  104. Traceback (most recent call last):
  105. File "<string>", line 2, in <module>
  106. File "<pip-setuptools-caller>", line 34, in <module>
  107. File "C:\Users\jingsheng.liu\AppData\Local\Temp\pip-install-dizvi0q1\share_3bec5e901da746d894346812606cc50e\setup.py", line 11, in <module>
  108. setup(
  109. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\core.py", line 148, in setup
  110. dist.run_commands()
  111. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 966, in run_commands
  112. self.run_command(cmd)
  113. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
  114. cmd_obj.run()
  115. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\install.py", line 61, in run
  116. return orig.install.run(self)
  117. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\command\install.py", line 557, in run
  118. self.run_command(cmd_name)
  119. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
  120. self.distribution.run_command(command)
  121. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
  122. cmd_obj.run()
  123. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\command\install_data.py", line 56, in run
  124. dir = convert_path(f[0])
  125. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\util.py", line 122, in convert_path
  126. raise ValueError("path '%s' cannot be absolute" % pathname)
  127. ValueError: path '/etc' cannot be absolute
  128. [end of output]
  129. note: This error originates from a subprocess, and is likely not a problem with pip.
  130. error: legacy-install-failure
  131. × Encountered error while trying to install package.
  132. ╰─> Share
  133. note: This is an issue with the package mentioned above, not pip.
  134. hint: See above for output from the failure.

分析:

无法处理/etc

  1. File "c:\users\jingsheng.liu\appdata\local\programs\python\python38\lib\distutils\util.py", line 122, in convert_path
  2. raise ValueError("path '%s' cannot be absolute" % pathname)
  3. ValueError: path '/etc' cannot be absolute

解决:

打开util.py

  1. if os.sep == '/':
  2. return pathname
  3. if not pathname:
  4. return pathname
  5. '''根据报错增加的代码段'''
  6. if pathname.startswith('/etc'):
  7. paths = pathname.split('/')
  8. return '\\etc\\' + paths[-1]
  9. '''根据报错增加的代码段'''
  10. if pathname[0] == '/':
  11. raise ValueError("path '%s' cannot be absolute" % pathname)
  12. if pathname[-1] == '/':
  13. raise ValueError("path '%s' cannot end with '/'" % pathname)

修改后重新安装:安装成功

  1. C:\Users\jingsheng.liu>pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ share==1.0.4
  2. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
  3. Collecting share==1.0.4
  4. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f5/fb/07e73d2551046cb23a37cd423c490bdcc5151f6cf79b8fdf5e3f6df318dd/share-1.0.4.tar.gz (5.9 kB)
  5. Preparing metadata (setup.py) ... done
  6. Building wheels for collected packages: share
  7. Building wheel for share (setup.py) ... done
  8. Created wheel for share: filename=share-1.0.4-py3-none-any.whl size=8989 sha256=fac7bc4626cce9859bfee784ffb6b960167b1cef0a15c54147a3382c02fa1728
  9. Stored in directory: c:\users\jingsheng.liu\appdata\local\pip\cache\wheels\e8\18\2f\394482d27600a54bda5e1848ec9eecbd553052c75663d8191b
  10. Successfully built share
  11. Installing collected packages: share
  12. Successfully installed share-1.0.4

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/47050
推荐阅读
相关标签
  

闽ICP备14008679号