2016-08-03 120 views
2

我试图使用PIP安装pyinstaller(在Ubuntu 16.0.4):如何正确安装pyinstaller

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。

+0

你需要确保你的路径上有可执行文件 –

+0

我该怎么做? – 218

+0

如果你运行'哪个pyinstaller',会发生什么? – jpmc26

回答

5

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

有一两件事你可以尝试使用find找到可执行:

sudo find/-name pyinstaller 

这递归查找名为pyinstaller,开始在文件系统的根文件。如果您对可执行文件的放置位置有所了解,则可以将搜索范围缩小到该目录。

一旦你有了可执行文件的绝对路径,你可以直接把它叫做:

/my/path/to/pyinstaller 

或者,如果你不使用的virtualenv或任何东西,你可以修改PATH包括可执行文件的父目录:

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

如果您想使该更改永久化,您需要modify a script somewhere