在Windows中安装Python模块 [英] Installing a Python module in Windows

查看:107
本文介绍了在Windows中安装Python模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

我已经尝试安装PyWhois模块了半个小时,而对于使用Netbeans在Windows上开发Python的狂热态度,我感到非常恼火.

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是Java的Python-您确定这就是您想要的吗?我已经针对Windows的普通" Python回答了这个问题,我想这就是您所追求的.

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.

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

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.

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

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

同时安装了这两个软件之后,您就可以在Windows下使用Python.您应该能够打开命令提示符并键入"python"以获取python提示符,它应如下所示:

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.
>>>

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

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

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导入它:

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删除了对Python的支持(请参见 http://wiki.netbeans.org/Python70Roadmap )有关更多信息.

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

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

This http://wiki.python.org/moin/IntegratedDevelopmentEnvironments wiki entry lists some other IDEs you can try.

这篇关于在Windows中安装Python模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆