首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows中安装Python模块

在Windows中安装Python模块
EN

Stack Overflow用户
提问于 2011-11-14 11:29:09
回答 1查看 20.1K关注 0票数 2

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

我已经尝试安装PyWhois模块半个小时了,我对在Windows上使用Netbeans开发Python的笨拙感到非常恼火。

有人知道如何使用此安装程序安装模块吗?我应该破坏我的开发环境,使用其他不那么容易引起愤怒的东西吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-14 13:43:43

Jython是用于Java的Python --你确定这是你想要的吗?我已经为Windows的“普通”Python回答了这个问题,我想这就是你想要的。

要在Windows下使用Python,您需要安装可以从the Python download page下载的Windows二进制安装程序。确保选择二进制安装程序。

接下来,您将需要安装setuptools,您可以从python package index (pypi)获得它。

安装了这两个工具之后,就可以在Windows下使用Python了。你应该能够打开一个命令提示符,然后输入" python“来得到python提示符,它应该是这样的:

代码语言:javascript
复制
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,请打开命令提示符并键入:

代码语言:javascript
复制
C:\>easy_install pywhois

您将看到如下所示的输出:

代码语言:javascript
复制
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导入它:

代码语言:javascript
复制
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
>>>

NetBeans7.0删除了对Python的支持(参见http://wiki.netbeans.org/Python70Roadmap)以获取更多信息。

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

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8116986

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档