为什么在终端上安装xlwings会产生错误?

2024-05-02 12:07:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我对Python比较陌生,我现在只是在做一个私人项目。为此,我希望安装xlwing,以便能够从Excel运行python代码。然而,似乎我不能安装它。我尝试通过以下方式安装:

C:\Users\Rafi>python -m pip install --user xlwings

因为我安装了我所有的其他东西

现在,当我把它放入终端时,它显示了下面的(长)错误。然而,我找不到解决办法,不管我怎么做,也许你们有一些建议

***Running setup.py install for comtypes ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"'; __file='"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file, '"'"'exec'"'"'))' install --record 'C:\Users\Rafi\AppData\Local\Temp\pip-record-qtr4pqm3\install-record.txt' --single-version-externally-managed --compile --user --prefix= cwd: C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\ Complete output (276 lines): running install running build running build_py creating build creating build\lib creating build\lib\comtypes copying comtypes\automation.py -> build\lib\comtypes copying comtypes\connectionpoints.py -> build\lib\comtypes copying<br/>
.<br/>
.<br/>
.<br/>
error: error in setup script: command 'bdist_wininst' has no such option 'install_script'
ERROR: Command errored out with exit status 1: 'C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"'; _file='"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file, '"'"'exec'"'"'))' install --record 'C:\Users\Rafi\AppData\Local\Temp\pip-record-qtr4pqm3\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
***

Tags: installpippybuildlocalsyssetuprecord