2015-08-13 33 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