报错内容:
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting weditor
Downloading https://mirrors.aliyun.com/pypi/packages/ab/8a/dfe8a1b803ab71644140a5a6d4ce4ad8db0c6e1f92634072c4290f58193c/weditor-0.7.3.tar.gz (2.2 MB)
---------------------------------------- 2.2/2.2 MB 102.8 kB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
Error parsing
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\core.py", line 105, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\util.py", line 272, in cfg_to_args
pbr.hooks.setup_hook(config)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\hooks\__init__.py", line 25, in setup_hook
metadata_config.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\hooks\base.py", line 27, in run
self.hook()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\hooks\metadata.py", line 25, in hook
self.config['version'] = packaging.get_version(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\packaging.py", line 854, in get_version
version = _get_version_from_pkg_metadata(package_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-r025ptjk\normal\Lib\site-packages\pbr\packaging.py", line 822, in _get_version_from_pkg_metadata
pkg_metadata = email.message_from_file(pkg_metadata_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Programs\Python\Python312\Lib\email\__init__.py", line 53, in message_from_file
return Parser(*args, **kws).parse(fp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Programs\Python\Python312\Lib\email\parser.py", line 52, in parse
while data := fp.read(8192):
^^^^^^^^^^^^^
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 795: illegal multibyte sequence
error in setup command: Error parsing C:\Users\Administrator\AppData\Local\Temp\pip-install-2v0l5n0h\weditor_94090597853c480390dfa10df5372647\setup.cfg: UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 795: illegal multibyte sequence
[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.
解决办法:
办法1:
1. 清理一下pip缓存
pip cache purge
2. 更改一下python的命令行编码
set PYTHONUTF8=1
3. 使用命令安装即可
pip install weditor -i https://pypi.tuna.tsinghua.edu.cn/simple
办法2:
1. 进入控制面板 >> 点击更改时间。。。
2. 点击管理 >> 更改系统区域设置
3. 选择Beta版...重启电脑即可
办法3:
降低安装版本
pip install weditor==0.6.4 -i https://pypi.tuna.tsinghua.edu.cn/simple