Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Pycharm to run Pyinstaller

Tags:

Yes I want to create a run configuration in PyCharm to run Pyinstaller and get my executable. According to the Pyinstaller documentation you should be able to locate an python script called pyinstaller-folder/pyinstaller.py after the installation, but it wasn't there. Then I look carefully and found this other one named pyinstaller-folder/__main__.py which should be the same <--(me wild guessing), so I set up my running configuration like this:

enter image description here

After running it, is giving me this error:

/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 

It seems to require a parent module to run but, how would that look like?

like image 408
gerosalesc Avatar asked Nov 25 '15 00:11

gerosalesc


People also ask

Do you need Python to run a PyInstaller exe?

They do not need to have Python installed at all. The output of PyInstaller is specific to the active operating system and the active version of Python. This means that to prepare a distribution for: a different OS.


1 Answers

After more than two years, perhaps there is a better option.

In the PyCharm menu go to File -> Settings.
In the Settings dialog find Tools -> External tools and use the green + to add a new external tool.

For example:

enter image description here

Then, the IDE will allow you to run it on any python script. Right click on the file and the context menu will show External tools -> PyInstaller.

like image 194
aerobiomat Avatar answered Sep 22 '22 22:09

aerobiomat