2

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?

4

1 回答 1

5

Jython 是用于 Java 的 Python - 您确定这是您想要的吗?我已经为 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.
>>>

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

C:\>easy_install pywhois

你会看到这样的输出:

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

要确认它已安装,您应该能够从 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 已删除 Python 支持(请参阅http://wiki.netbeans.org/Python70Roadmap)以获取更多信息。

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

于 2011-11-14T05:43:42.937 回答