2015-08-13 37 views
0

已搜索其他類似的問題,但沒有成功。我是否必須回到Python 2.7?ubuntu14.04 python3.4無法pip3 matplotlib

英特爾32b桌面上的ubuntu 14.04。使用Python2.7一切正常。現在使用Ubuntu軟件中心爲Python3.4安裝了Idle。它的工作原理,但

import matplotlib 

結果

matplotlib not found 

然後

pip3 install matplotlib 

導致巨大的良性尋找輸出量,但有錯誤結束。這裏是最後的PIP日誌文件:

running install_lib 

copying pylab.py -> /usr/local/lib/python3.4/dist-packages 

error: [Errno 13] Permission denied: 
'/usr/local/lib/python3.4/dist-packages/pylab.py' 

---------------------------------------- Cleaning up... 
>Removing temporary dir /tmp/pip_build_jim... Command /usr/bin/python3 -c 
"import setuptools, 
tokenize;__file__='/tmp/pip_build_jim/matplotlib/setup.py';exec(compile(getattr(tokenize, 
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
'exec'))" install --record /tmp/pip-77rf26vy-record/install-record.txt 
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_jim/matplotlib 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 283, in 
run 
    requirement_set.install(install_options, global_options, root=options.root_path) File 
"/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install 
    requirement.install(install_options, global_options, *args, **kwargs) File "/usr/lib/python3/dist-packages/pip/req.py", line 707, in install 
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) File 
"/usr/lib/python3/dist-packages/pip/util.py", line 715, in 
call_subprocess 
    % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command /usr/bin/python3 -c "import 
setuptools, 
tokenize;__file__='/tmp/pip_build_jim/matplotlib/setup.py';exec(compile(getattr(tokenize, 
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
'exec'))" install --record /tmp/pip-77rf26vy-record/install-record.txt 
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_jim/matplotlib 

回答

0

此錯誤

error: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/pylab.py' 

表示腳本試圖在目錄/usr/local寫。

超級用戶運行以下命令:

sudo pip3 install matplotlib 
+0

是的!這使得所有的錯誤消失,現在安裝了matplotlib。 – jimdallasco