在Windows中安装Python模块

Mar*_*ios 2 python windows netbeans module pywhois

我正在尝试在我的Windows计算机上安装Python模块.我安装了NetBeans IDE的开发版本以用作我的Python编辑器,似乎他们在自己的程序文件夹下安装Jython 2.5,并强制您使用该安装进行开发.

我一直在尝试安装PyWhois模块半小时,而且我对使用Netbeans在Windows上开发Python的麻烦感到非常愤怒.

有谁知道如何使用此设置安装模块?我是否应该破坏我的开发环境并使用其他不那么愤怒的东西?

Bur*_*lid 5

Jython是Python for Java - 你确定这是你想要的吗?我已经为Windows的"普通"Python回答了这个问题,我认为这就是你所追求的.

要在Windows下使用Python,您需要安装Windows二进制安装程序,您可以从Python下载页面下载安装程序.确保选择二进制安装程序.

接下来,您将需要安装setuptools,您可以从python包索引(pypi)获取.

一旦安装了两者,就可以在Windows下使用Python.您应该能够打开命令提示符并输入"python"来获取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.
>>>
Run Code Online (Sandbox Code Playgroud)

然后,要安装PyWhois,请打开命令提示符并键入:

C:\>easy_install pywhois
Run Code Online (Sandbox Code Playgroud)

你会看到这样的输出:

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
Run Code Online (Sandbox Code Playgroud)

要确认它已安装,您应该能够从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
>>>
Run Code Online (Sandbox Code Playgroud)

Netbeans 7.0已经删除了Python支持(请参阅http://wiki.netbeans.org/Python70Roadmap)以获取更多信息.

http://wiki.python.org/moin/IntegratedDevelopmentEnvironments wiki条目列出了您可以尝试的其他一些IDE.