【问题标题】:How to correctly install pyinstaller如何正确安装pyinstaller
【发布时间】:2016-12-09 08:16:04
【问题描述】:

我尝试使用 pip 安装 pyinstaller(在 Ubuntu 16.0.4 上):

pip3 install pyinstaller

Collecting pyinstaller
  Using cached PyInstaller-3.2.tar.gz
Collecting setuptools (from pyinstaller)
  Using cached setuptools-25.1.3-py2.py3-none-any.whl
Building wheels for collected packages: pyinstaller
  Running setup.py bdist_wheel for pyinstaller ... done
  Stored in directory: /home/.../.cache/pip/wheels/fc/b3/10/006225b1c1baa34750a7b587d3598d47d18114c06b696a8e0e
Successfully built pyinstaller
Installing collected packages: setuptools, pyinstaller
Successfully installed pyinstaller setuptools-20.7.0
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

但是,如果我随后尝试调用 pyinstaller,则会收到错误 pyinstaller: command not found

当 pip 安装似乎成功时,为什么我无法运行 pyinstaller。

【问题讨论】:

  • 你需要确保你的路径上有可执行文件
  • 如果你运行which pyinstaller会发生什么?
  • 没有找到which pyinstaller
  • 看来你需要build a bootloader
  • 也可以尝试通过模块调用:python -m PyInstaller [...]

标签: python pip pyinstaller


【解决方案1】:

pyinstaller 似乎已正确安装,但该命令在PATH 上不可用。您需要找到可执行文件的放置位置。这将取决于您的系统配置、您是否使用 virtualenv 以及其他系统和使用相关因素。

您可以尝试的一件事是使用find 来定位可执行文件:

sudo find / -name pyinstaller

这递归地查找名为pyinstaller 的文件,从文件系统的根目录开始。如果您知道可执行文件的放置位置,可以将搜索范围缩小到该目录。

获得可执行文件的绝对路径后,您可以直接调用它:

/my/path/to/pyinstaller

或者,如果您没有使用 virtualenv 或其他任何东西,您可以修改 PATH 以包含可执行文件的父目录:

$PATH = $PATH:/my/path/to

如果您想让该更改永久生效,您需要modify a script somewhere

【讨论】:

  • 在ubuntu中pyinstaller会位于~/.local/bin/pyinstaller
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-09-07
  • 2012-06-01
  • 2018-11-14
  • 2019-11-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多