2017-03-10 64 views
-2

我試圖在Ubuntu 14.06上安裝Python 3.6。我已經嘗試了get-apt命令,並試圖從tarball安裝。無論哪種方式,這是我收到的錯誤。在Ubuntu 14.06上正確安裝Python 3.6以包含IDLE

:~/Downloads$ pip install Python-43.4.6.tar.gz 
Requirement 'Python-43.4.6.tar.gz' looks like a filename, but the file does not exist 
Processing ./Python-43.4.6.tar.gz 
Exception: Traceback (most recent call last): 
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main  status = self.run(options, args) 
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in run  wb.build(autobuilding=True) 
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build  self.requirement_set.prepare_files(self.finder) 
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files  ignore_dependencies=self.ignore_dependencies)) 
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 577, in _prepare_file  session=self.session, hashes=hashes) 
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 798, in unpack_url  unpack_file_url(link, location, download_dir, hashes=hashes) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 705, in unpack_file_url  unpack_file(from_path, location, content_type, link) File "/usr/lib/python2.7/dist-packages/pip/utils/__init__.py", line 620, in unpack_file  tarfile.is_tarfile(filename) or 
File "/usr/lib/python2.7/tarfile.py", line 2622, in is_tarfile  t = open(name) 
File "/usr/lib/python2.7/tarfile.py", line 1673, in open  return func(name, "r", fileobj, **kwargs) 
File "/usr/lib/python2.7/tarfile.py", line 1738, in gzopen  fileobj = gzip.GzipFile(name, mode, compresslevel, fileobj) 
File "/usr/lib/python2.7/gzip.py", line 94, in __init__  fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb') 
IOError: [Errno 2] No such file or directory: '/home/michael/Downloads/Python-43.4.6.tar.gz' 

You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 

:~/Downloads$ pip install --upgrade pip 
Collecting pip 
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)  100% |████████████████████████████████| 1.3MB 662kB/s Installing collected packages: pip 
Successfully installed pip-8.1.1 
You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 

~/Downloads$ pip -V 
pip 9.0.1 from /home/michael/.local/lib/python2.7/site-packages (python 2.7) 

~/Downloads$ python -V 
Python 2.7.12 

~/Downloads$ python3 -V 
Python 3.5.2 

難道我下載的壓縮包錯誤或者是有辦法,以確保我沒有與Python 2.7版安裝?另外,pip版本錯誤是否相關?

TIA

+0

沒有Ubuntu 14.06。 –

+0

'Python-43.4.6.tar.gz'不是有效的tarball。使用pip來安裝Python是沒有意義的。 –

+0

一個bash腳本。沒有tarball。 https://conda.io/docs/install/quick.html#linux-miniconda-install –

回答

1

首先嚐試在PIP使用升級命令,看看是否能解決問題的版本

pip3 install --upgrade pip 

否則我會建議卸載並執行全新安裝。

使用下列命令設置蟒

sudo apt-get update 
sudo apt-get -y upgrade 
sudo apt-get install python3.6 python3-pip idle3 
pip3 install numpy 
pip3 install spyder 

PIP3是用於使用Python安裝程序爲python3該命令。

使用IDLE3,只需鍵入到命令窗口

idle3 

我建議使用PIP 3作爲Spyder的是一種更先進的空閒可同時跟蹤變量和代碼編寫安裝Spyder的。使它在定位錯誤等方面更容易一些。

+0

太棒了!非常感謝! – prophet

0

許多Linux發行版都提供tkinter,IDLE(使用tkinter)和turtle(它也使用tkinter)作爲獨立的發行版。搜索SO [tkinter] install tkinter on ubuntu顯示以前的問題和答案。

sudo apt-get install python3-tk 

可能是你需要的,但細節可能會改變,因爲以前的答案。