我已经在Python 2.7
中安装了easy_install
和setuptools
。我在用easy_install pip
安装pip
时做了一个噩梦。我已经关注了我的SO文章和博客,但仍然没有帮助。
以下是我在窗口中收到的错误cmd
:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Download error: [Errno 10061] No connection could be made because the target mac
hine actively refused it -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error: [Errno 10061] No connection could be made because the target mac
hine actively refused it -- Some packages may not be found!
No local packages or download links found for pip
Best match: None
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1712, in main
with_ei_usage(lambda:
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1700, in with_ei_usage
return f()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
211, in run
self.easy_install(spec, not self.no_deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
434, in easy_install
self.local_index
File "C:\Python27\lib\site-packages\setuptools\package_index.py", line 475, in
fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
我认为在您尝试的过程中,您不知怎么搞砸了Python的设置。虽然我确信您可以使用python.org上的CPython安装程序(我和许多其他人都这样做了),但我强烈建议重新开始(完全删除您目前拥有的内容)并安装一个具有更多功能的python发行版,例如:
它们附带了几个额外的安装包,包括pip。他们的安装程序还可以正确设置Windows路径。因此,在运行安装程序之后,您可以继续,启动
cmd.exe
,然后运行python
或pip install ...
可以找到EPD的免费版本here。我自己在EPD和Python(x,y)方面也有很好的经验。Here是标准Python(x,y)安装程序附带的“插件”列表。注意,对于Windows,EPD和Python(x,y)都只提供32位版本。。。但是,activepythonforwindows64位是免费的(PyPM包对于64位不是免费的)。根据您的需要,这可能不是问题。
我做到了,我在Windows7x64上工作。
https://www.python.org/download/releases/2.7.2 --------Windows x86 MSI安装程序(2.7.2)(sig)
在安装了Python2.7之后(我默认安装在c:\ python27),这样就可以了。
下载文件get-pip.py
https://raw.github.com/pypa/pip/master/contrib/get-pip.py
保存在一个已知的文件夹中:c:\ pip\
转到Windows-Run-Type cmd.exe
内部cmd.exe类型:
cd c:\ python27(或安装python的路径)
你会看到:
c:\Python27
现在输入(记住保存get-pip.py我们的Case c:\ pip的路径)。
c:\python27\python.exe c:\pip\get-pip.py
将安装Pip。
现在安装了Python和Pip,转到Windows-Run-Type cmd.exe
内部cmd.exe类型:
cd c:\Python27
你会看到:
c:\Python27
现在键入
python.exe-m pip安装xxxxxxx
Pip将安装您想要的xxxxxx包。
示例: pip安装Django==1.6.2
注意:本指南适用于PYTHON和WINDOWS的新手。
问候
erick.alfaro@adtein.com网址 www.adtein.com网站
我去了https://pypi.python.org/pypi/pip 有一个tar你可以从那里下载。 下载后,只需在Python\Scripts文件夹的命令提示符下运行“easy_install pip-1.3.1.tar.gz”。 似乎能完成任务。 希望这有帮助
相关问题 更多 >
编程相关推荐