如何正确安装pyins

2024-06-17 08:31:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用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。


Tags: installpipyouforversionpackageswheelssetuptools
1条回答
网友
1楼 · 发布于 2024-06-17 08:31:16

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

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

sudo find / -name pyinstaller

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

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

/my/path/to/pyinstaller

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

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

如果你想永久地改变,你需要modify a script somewhere

相关问题 更多 >