首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何正确安装pyinstaller

问如何正确安装pyinstaller
EN

Stack Overflow用户
提问于 2016-08-03 22:28:29
回答 1查看 19K关注 0票数 9

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

代码语言:javascript
复制
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。

EN

回答 1

Stack Overflow用户

发布于 2016-08-03 23:56:38

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

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

代码语言:javascript
复制
sudo find / -name pyinstaller

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

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

代码语言:javascript
复制
/my/path/to/pyinstaller

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

代码语言:javascript
复制
$PATH = $PATH:/my/path/to

如果您想要永久更改,则需要使用modify a script somewhere。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38746462

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档