如何在ubuntu 13上安装pyinstaller?

时间:2014-06-20 20:06:38

标签: python pyinstaller ubuntu-13.10

我试过:(参考pyinstaller手册)

pip install PyInstaller

但它给出了错误:

creating /usr/local/lib/python2.7/dist-packages/PyInstaller

error: could not create '/usr/local/lib/python2.7/dist-packages/PyInstaller': Permission denied

----------------------------------------

Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-pratik/pyinstaller/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wrGEjP-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-pratik/pyinstaller

Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 139, in main
status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 271, in run
requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1185, in install
requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 592, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 662, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-pratik/pyinstaller/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wrGEjP-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-pratik/pyinstaller

我是从pip.log

获取的

我该如何解决这个问题?

3 个答案:

答案 0 :(得分:3)

sudo pip install PyInstaller

权限问题表示您无权创建目录。 sudo授予您许可。

答案 1 :(得分:2)

尝试使用sudo权限执行此操作。

您在行中收到权限被拒绝错误:

error: could not create '/usr/local/lib/python2.7/dist-packages/PyInstaller': Permission denied

答案 2 :(得分:0)

不使用sudo进行安装:

pip install PyInstaller --user