Python 安装 xlwt
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25083202/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing xlwt
提问by aSea
I am having issues installing the xlwt module in python. Using 64-bit windows operating system. Not sure exactly which folder the unzipped folder should be placed in. Currently I have put it in:
我在 python 中安装 xlwt 模块时遇到问题。使用 64 位 windows 操作系统。不确定解压后的文件夹应该放在哪个文件夹中。目前我已经把它放在了:
C:\Python27\Lib\site-packages
C:\Python27\Lib\site-packages
I have tried using easy_install to install the file but haven't had any luck. Appreciate the feedback!
我曾尝试使用 easy_install 来安装该文件,但没有任何运气。感谢反馈!
import easy install
runfile('C:/Python27/Lib/site-packages/xlwt-0.7.5/setup.py', wdir=r'C:/Python27/Lib/site-packages/xlwt-0.7.5')
Output
输出
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
回答by aSea
Ok - using cmd.exe install using these steps.
好的 - 使用这些步骤使用 cmd.exe 安装。
Launch cmd.exe and change current working directory to location where the xlwt is. For me its: C:\Python27\Lib\site-packages\xlwt-0.7.5
启动 cmd.exe 并将当前工作目录更改为 xlwt 所在的位置。对我来说:C:\Python27\Lib\site-packages\xlwt-0.7.5
cd C:\Python27\Lib\site-packages\xlwt-0.7.5
python setup.py install
Then should be up and running. Hope this helps - it wasn't super clear when reading other documentation.
然后应该启动并运行。希望这会有所帮助 - 在阅读其他文档时并不是很清楚。
回答by BlueTrin
Most of Python packages are installed by running the following command:
大多数 Python 包是通过运行以下命令安装的:
python setup.py install
But I recommend you to do the following:
但我建议您执行以下操作:
- install setuptools
- install pip
- use pip to install xlwt, using the following command
pip install xlwt
Pip makes managing packages alot easier, this is even more true when you use Windows.
Pip 使管理包变得更加容易,当您使用 Windows 时更是如此。
回答by akhil kailasa
you can install by typing the following command in cmd:
您可以通过在cmd中键入以下命令进行安装:
python -m pip install xlwt



