怎么在windows安装python模块_在Windows中安装Python模块

I'm trying to install a Python module on my Windows computer. I installed the development version of the NetBeans IDE to use as my Python editor, and it seems that they install Jython 2.5 under their own program folder, and force you to use that installation for development.

I've been trying to install the PyWhois module for half an hour now, and I'm getting pretty infuriated with the kludginess of developing Python on Windows with Netbeans.

Does anyone know how to install modules with this setup? Should I destroy my dev environment and use something else that would be less rage-inducing?

解决方案

Jython is Python for Java - are you sure this is what you want? I have answered this for "normal" Python for Windows, I assume this is what you are after.

To use Python under Windows, you need to install the Windows binary installer, which you can download from the Python download page. Make sure you choose the binary installer.

Next, you will need to install setuptools, which you can get from the python package index (pypi).

Once you have installed both, you have Python available under Windows. You should be able to open a command prompt and type "python" to get the python prompt, it should look like this:

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on

win32

Type "help", "copyright", "credits" or "license" for more information.

>>>

Then, to install PyWhois, open a command prompt and type:

C:\>easy_install pywhois

You'll see output like this:

Searching for pywhois

Reading http://pypi.python.org/simple/pywhois/

Best match: pywhois 0.1

Downloading http://pypi.python.org/packages/source/p/pywhois/pywhois-0.1.tar.gz#

md5=b888dcd990574b7b284d9a9f4b300776

Processing pywhois-0.1.tar.gz

Running pywhois-0.1\setup.py -q bdist_egg --dist-dir c:\docume~1\40843\locals~1\

temp\easy_install-hugnul\pywhois-0.1\egg-dist-tmp-aarhii

Adding pywhois 0.1 to easy-install.pth file

Installing pywhois-script.py script to C:\Python27\Scripts

Installing pywhois.exe script to C:\Python27\Scripts

Installing pywhois.exe.manifest script to C:\Python27\Scripts

Installed c:\python27\lib\site-packages\pywhois-0.1-py2.7.egg

Processing dependencies for pywhois

Finished processing dependencies for pywhois

To confirm it is installed, you should be able to import it from Python:

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on

win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import pywhois

>>>

Netbeans 7.0 has removed Python support (see http://wiki.netbeans.org/Python70Roadmap) for more information.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值