python没有这个xlwt模块_ImportError:没有名为xlwt的模块

My sytem: Windows, Python 2.7

I downloaded a package and want to include it in my script.

After I unzipped the package, here is my folder structure:

Work

xlwt-0.7.3 (contains a setup.py)

xlwt (contains __init__.py among others)

My script runs from the top-level (Work) folder.

Using import xlwt in my script produces:

ImportError: No Module named xlwt

How do I import xlwt?

解决方案

First off, try using easy_install or pip to install it into your pythonpath:

easy_install xlwt

or

pip install xlwt

These are python package managers/installers and make the whole process so much easier. But if you have already downloaded it manually, you still need to install it:

python setup.py install

Then it will be available in your python path for import. If you find that you don't have easy_install, manually download this: http://peak.telecommunity.com/dist/ez_setup.py and do python ez_setup.py, and then continue the instructions. Best choice though is to install pip and use it for your package installations. If you have easy_install, but not pip, you can do easy_install pip

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值