Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为什么在终端上安装xlwings会产生错误?_Python_Python 3.x_Pip_Xlwings - Fatal编程技术网

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

Python 为什么在终端上安装xlwings会产生错误?,python,python-3.x,pip,xlwings,Python,Python 3.x,Pip,Xlwings,我对Python比较陌生,我现在只是在做一个私人项目。为此,我希望安装xlwing,以便能够从Excel运行python代码。然而,似乎我不能安装它。我尝试通过以下方式安装: C:\Users\Rafi>python -m pip install --user xlwings 因为我安装了我所有的其他东西 现在,当我把它放入终端时,它显示了下面的(长)错误。然而,我找不到解决办法,不管我怎么做,也许你们有一些建议 ***Running setup.py install for comty

我对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.
***
***正在为comtypes运行setup.py安装。。。错误:命令出错,退出状态1:命令:“C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\Python.exe'-u-C”导入系统,设置工具,标记化;sys.argv[0]=“C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py”“”__文件=“””'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py“”;f=getattr(标记化,“‘打开’”,打开)(文件);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'--外部管理的单一版本--compile--user--prefix=cwd:C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\完整输出(276行):运行安装运行生成运行生成创建生成创建生成\lib创建生成\lib\comtypes复制comtypes\automation.py->build\lib\comtypes复制comtypes\connectionpoints.py->build\lib\comtypes复制
.
.
.
错误:安装脚本中出错:命令“bdist\u wininst”没有这样的选项“install\u script” 错误:命令出错,退出状态为1:'C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\Python.exe'-u-C'导入系统,设置工具,标记化;sys.argv[0]=“C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py”“”_文件=“””'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py“”;f=getattr(标记化,“‘打开’”,打开)(文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(compile(代码,_文件,“'exec'”)'install--record'C:\Users\Rafi\AppData\Local\Temp\pip-record-qtr4pqm3\install record.txt'--single version externally managed--compile--user--prefix=检查日志以获得完整的命令输出。 ***
此错误源于安装xlwings:comtypes的依赖项

谷歌快速搜索显示,您的问题可能是由旧版本的wheels引起的。按如下方式升级控制盘,然后重试:

pip install --upgrade wheel

嗨,菲利克斯!非常感谢,我只是在谷歌上搜索了安装xlwings的一般错误,不知道具体要搜索什么,非常感谢:)如果它解决了你的问题,你能接受@Rafii1的答案吗?实际上我还有一个问题,我的代码说它找不到名为“win32api”的模块。我用谷歌搜索了这个问题,并尝试了所有我能找到的解决方案,但没有成功。我试着在命令终端上分别安装它。我想可能是我的python是64位的,而Win32 API是32位python的问题吧?我试图搜索64位版本,但找不到适合我的版本。您需要安装
pip install pywin32
-这适用于64位和32位系统。我已经尝试过了。我得到的消息是
要求已经满足:c:\users\-
中的pywin32,但是当我尝试使用xlwings运行代码时,它会告诉我它找不到win32api