是的我想在PyCharm中创建一个运行配置来运行Pyinstaller并获取我的可执行文件。根据Pyinstaller documentation,您应该能够在安装后找到一个名为pyinstaller-folder/pyinstaller.py
的python脚本,但它不存在。然后我仔细观察,发现另一个名为pyinstaller-folder/__main__.py
的应该是相同的
运行后,给我这个错误:
/usr/local/Cellar/python3/3.4.3/bin/python3.4 /usr/local/lib/python3.4/sit
e-packages/PyInstaller/__main__.py --onefile --nowindow --osx-bundle-identifier=jg.optimizer -F --name=genoptimizer optimizer/manage.py
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/PyInstaller/__main__.py", line 26, in <module>
from . import __version__
SystemError: Parent module '' not loaded, cannot perform relative import
Process finished with exit code 1
它似乎需要一个父模块运行,但是,它会是什么样子?
对于那些在Windows上使用Anaconda试图解决这个问题的人,我发现最容易设置一个Bash配置(我相信你需要BashSupport插件),并设置:
pyinstaller
(假设pyinstaller在你的路径中,如果没有,完整路径)C:\Windows\system32\cmd.exe
(是的,bash配置只能使用标准命令程序)/C
script_name.py
(以及任何其他pyinstaller参数)C:\Path\To\Script
在pycharm中安装pyinstaller,然后打开pycharm终端并编写python -m PyInstaller
。