【发布时间】:2021-05-21 20:26:56
【问题描述】:
我使用pip3 install pyinstaller成功安装了pyinstaller
Requirement already satisfied: pyinstaller in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (4.2)
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from pyinstaller) (49.2.1)
Requirement already satisfied: altgraph in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from pyinstaller) (0.17)
Requirement already satisfied: macholib>=1.8; sys_platform == "darwin" in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from pyinstaller) (1.14)
Requirement already satisfied: pyinstaller-hooks-contrib>=2020.6 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from pyinstaller) (2020.11)
顺便说一句,我的echo $PATH 返回:
/Users/apple/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin
但是,当我尝试在同一目录中的终端中运行以下代码时,它不起作用:
apple@apples-MBP-2 app4.1_using_OOP % pyinstaller --onefile --windowed frontend.py
它有错误:
zsh: command not found: pyinstaller
我尝试了很多方法,包括:
- 将 pip 降级到 18.1 并再次运行
pip3 install pyinstaller - 使用了
apple@apples-MBP-2 app4.1_using_OOP % python -m PyInstaller frontend.py,它确实可以运行,并且有一个光盘文件夹,其中有一个名为frontend.app的文件,但我无法打开它。
问题:
- 为什么有时候我可以直接使用
pip3下载的模块,有时候却不能? - 如果我想添加到我的
$PATH,我要添加/Library/Frameworks吗?
【问题讨论】:
标签: python python-3.x macos pyinstaller