Python 3.x 无法在带有Python3.5的Ubuntu 16中安装pyinstaller

Python 3.x 无法在带有Python3.5的Ubuntu 16中安装pyinstaller,python-3.x,ubuntu-16.04,pyinstaller,Python 3.x,Ubuntu 16.04,Pyinstaller,我预装了python3.5附带的ubuntu16。我已使用以下方式安装pyinstaller: sudo pip3 install pyinstaller 它运行良好并安装了pyinstaller。然后我运行,pyinstaller它说找不到命令。 我也试着像这样安装它: sudo python3 -m pip install pyinstaller 它运行良好,并表示已满足要求。但无法运行pyinstaller 然后,我使用sudo python3-m pip安装--upgrade pip

我预装了
python3.5
附带的
ubuntu16
。我已使用以下方式安装pyinstaller:

sudo pip3 install pyinstaller
它运行良好并安装了pyinstaller。然后我运行,
pyinstaller
它说找不到命令。 我也试着像这样安装它:

sudo python3 -m pip install pyinstaller
它运行良好,并表示已满足要求。但无法运行pyinstaller

然后,我使用
sudo python3-m pip安装--upgrade pip
升级了pip,然后重新安装了pyinstaller,但这次使用了
--user
标志:

sudo python3 -m pip install pyinstaller --user
在这个命令之后,它也安装了pyinstaller和其他一些软件包

现在,如果我在终端上运行
pyinstaller
,我会得到以下错误:

Traceback (most recent call last):
  File "/home/andrew/.local/bin/pyinstaller", line 5, in <module>
    from PyInstaller.__main__ import run
ImportError: No module named 'PyInstaller'
回溯(最近一次呼叫最后一次):
文件“/home/andrew/.local/bin/pyinstaller”,第5行,在
从PyInstaller.\uuuu main\uuuuu导入运行
ImportError:没有名为“PyInstaller”的模块
运行命令
sudo python3-m pip list
获取所有已安装的软件包,我可以在列表中看到pyinstaller:

pycurl 7.43.0

pygobject 3.20.0

pyinstaller 4.0

pyb 2020.9

PyJWT 1.3.0


为了成功安装并运行
pyinstaller
,我真的很困惑该怎么做。请任何人提供帮助并提出一些好的工作解决方案。谢谢

好的,我想我终于在
ubuntu16
上运行了
pyinstaller

我不确定这是
Ubuntu16
还是
python3.5
的问题,但我们需要升级python版本。因此,我首先使用以下命令安装了python3.6:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
安装后,我确保运行
python3
时调用的是
python3.6
,而不是
python3.5

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

sudo update-alternatives --config python3
在此之后,如果您键入python3,它将启动
python3.6

完成所有操作后,只需升级pip:

sudo python3 -m pip install --upgrade pip
之后,您可以安装pyinstaller:

sudo pip3 install pyinstaller
同时运行以下命令:

sudo apt-get install python3.6-dev 
否则,您将在pyinstaller构建中获得python lib not found错误

它将安装和工作良好


我认为
pyinstaller
不能使用
python3.5
,因为这个python版本也被弃用了。所以我们需要升级python版本。因此,如果任何一个在默认设置为python3.5的
ubuntu16
上,只需升级您的python版本。

您看过这个吗@FadiAbuRaid是的,链接的问题与我的问题不同