ahehaoyu 发表于 2024-8-31 19:43

求大佬救救孩子,Pyqt6安装失败

本帖最后由 ahehaoyu 于 2024-9-10 10:42 编辑

2024.09.10   真是mmp安装python64位就没这个问题了

萌新学习pyqt6,死在第一步

问GPT也没问出个所以然来{:301_972:}

Python版本3.7.0

(base) C:\Users\Administrator\Desktop\pyqt>pip install PyQt6
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting PyQt6
Using cached https://mirrors.aliyun.com/pypi/ ... /PyQt6-6.6.1.tar.gz (1.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─>
      Querying qmake about your Qt installation...
      pyproject.toml: line 7: using '' to specify the project metadata is deprecated and will be removed in SIP v7.0.0, use '' instead
      Traceback (most recent call last):
      File "d:\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
      File "d:\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
      File "d:\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
      File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-d5odxe2a\overlay\Lib\site-packages\sipbuild\api.py", line 47, in build_wheel
          arguments=_convert_config_settings(config_settings))
      File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-d5odxe2a\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 92, in bootstrap
          project.setup(pyproject, tool, tool_description)
      File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-d5odxe2a\overlay\Lib\site-packages\sipbuild\project.py", line 603, in setup
          self.update(tool)
      File "project.py", line 165, in update
      sipbuild.exceptions.UserException
      Traceback (most recent call last):
      File "d:\anaconda3\lib\weakref.py", line 624, in _exitfunc
          f()
      File "d:\anaconda3\lib\weakref.py", line 548, in __call__
          return info.func(*info.args, **(info.kwargs or {}))
      File "d:\anaconda3\lib\tempfile.py", line 795, in _cleanup
          _shutil.rmtree(name)
      File "d:\anaconda3\lib\shutil.py", line 507, in rmtree
          return _rmtree_unsafe(path, onerror)
      File "d:\anaconda3\lib\shutil.py", line 395, in _rmtree_unsafe
          onerror(os.rmdir, path, sys.exc_info())
      File "d:\anaconda3\lib\shutil.py", line 393, in _rmtree_unsafe
          os.rmdir(path)
      PermissionError: 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\tmpy4jiakmg'
      

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.

hrpzcf 发表于 2024-8-31 20:19

把Python 3.7删了,装3.8以上版本,建议3.9+

T4DNA 发表于 2024-8-31 20:35

1、以管理员模式打开试试
2、打开lib\site-packages\pip\compat\__init__.py,第75行把return s.decode(‘utf_8’)改为return s.decode(‘cp936’) 试试

ahehaoyu 发表于 2024-8-31 20:45

T4DNA 发表于 2024-8-31 20:35
1、以管理员模式打开试试
2、打开lib\site-packages\pip\compat\__init__.py,第75行把return s.decode(‘ ...

我这里好像没有compat这个文件夹呢

似水流年2015 发表于 2024-8-31 20:46

PermissionError:   这报的是权限错误吧,卸载重新安装3.86,然后重启电脑再试试

ahehaoyu 发表于 2024-8-31 20:47

似水流年2015 发表于 2024-8-31 20:46
PermissionError:   这报的是权限错误吧,卸载重新安装3.86,然后重启电脑再试试

我试了重装好几次 都不行

T4DNA 发表于 2024-8-31 20:49

ahehaoyu 发表于 2024-8-31 20:47
我试了重装好几次 都不行

是所有包都不能装还是只有PyQt5

ahehaoyu 发表于 2024-8-31 20:54

T4DNA 发表于 2024-8-31 20:49
是所有包都不能装还是只有PyQt5

就pyqt6不能安装

xuyanhenry 发表于 2024-8-31 21:01

试试通过whl离线安装包安装呢

刘统宝 发表于 2024-8-31 21:20

实在不行就重新安装电脑系统,一个干干净净的系统很灵的,我就是这样做的
页: [1] 2 3
查看完整版本: 求大佬救救孩子,Pyqt6安装失败