2016-08-18 152 views
1

ubuntu 14.04在python3中安裝一個包含pip(或pip3)的包

我是python的新手,我在安裝軟件包時遇到問題。我已經看過類似的問題,但很難說它是否相關並且是最新的。

我不知道我需要做些什麼才能使其工作。

pip --version 
The program 'pip' is currently not installed. You can install it by typing: 
sudo apt-get install python-pip 


pip3 --version 
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4) 

我有幾個版本的python,最新的;

python3 
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux 

當我試圖安裝一個軟件包

pip3 install copy 
Downloading/unpacking copy 
Could not find any downloads that satisfy the requirement copy 
Cleaning up... 
No distributions at all found for copy 
Storing debug log for failure in /home/ben/.pip/pip.log 

我在類似計算器的問題看見了,那人去了日誌,並公佈這一點。

------------------------------------------------------------ 
/usr/bin/pip3 run on Thu Aug 18 20:25:27 2016 
Downloading/unpacking copy 
Getting page https://pypi.python.org/simple/copy/ 
Could not fetch URL https://pypi.python.org/simple/copy/: 404 Client    Error: Not Found 
Will skip URL https://pypi.python.org/simple/copy/ when looking for download links for copy 
Getting page https://pypi.python.org/simple/ 
URLs to search for versions for copy: 
* https://pypi.python.org/simple/copy/ 
Getting page https://pypi.python.org/simple/copy/ 
Could not fetch URL https://pypi.python.org/simple/copy/: 404 Client Error: Not Found 
Will skip URL https://pypi.python.org/simple/copy/ when looking for download links for copy 
Could not find any downloads that satisfy the requirement copy 
Cleaning up... 
Removing temporary dir /tmp/pip_build_ben... 
No distributions at all found for copy 
Exception information: 
Traceback (most recent call last): 
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main 
status = self.run(options, args) 
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run 
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
File "/usr/lib/python3/dist-packages/pip/req.py", line 1178, in prepare_files 
url = finder.find_requirement(req_to_install, upgrade=self.upgrade) 
File "/usr/lib/python3/dist-packages/pip/index.py", line 277, in find_requirement 
raise DistributionNotFound('No distributions at all found for %s' % req) 
pip.exceptions.DistributionNotFound: No distributions at all found for copy 

其他答案這樣說 「你需要獲取的PyPI通過HTTPS,而不是HTTP。」但我並不真正瞭解這一點,或者我需要做些什麼來解決這個問題。

所以我的問題是,我需要做什麼才能安裝python3版本的軟件包?我需要安裝點子,還是使用pip3更好?

+1

[我無法在PyPI上找到一個包'copy'](https://pypi.python.org/pypi/copy/)。你確定這是你想要安裝的軟件包嗎? –

+0

像@NilsWerner說的,你的問題是你正在嘗試安裝的軟件包不存在。這使問題的其餘部分沒有意義。 – edwinksl

回答

0

如果您有多個版本的python,請確保在要使用的python版本的目錄中導航,轉到'Scripts'文件夾並在其中運行pip命令。希望這可以工作。

0

看來這個包在PyPi上不可用。你想要安裝什麼? 你的點子版本是相當老 - 點1.5.4。 current version is 8.1.2

您還可以使用pip install -v在安裝時獲取更多信息。