0

I am creating a standalone python executable. The goal is for users to be able to use the program without having a python environment set up on their computers. However, there are some packages that are not wrapped within the executable and I need to install them separately:

pip install nodejs
pip install geckodriver-autoinstaller

I found an answer that describes how to do this by calling pip from within the python code but I was wondering how to install pip from within python code so I can use the method described here or if there is a more efficient way to do this.

Ray234
  • 173
  • 5
  • 15
  • You want to be able to run a command that uses python libraries without python? I'm not sure I understand what you are trying to really accomplish here. Why can't the end-user install python? – joe.dinius Aug 20 '20 at 21:39
  • The executable I have is able to wrap all libraries except these two for which a separate installation is required. The users are not familiar with python and so its a requirement to have a standalone executable – Ray234 Aug 20 '20 at 21:41
  • What is the executable written in? C++? Have you looked for a public API for those packages that is not python-dependent? It looks like Node.js has C++ extensions - https://nodejs.org/api/embedding.html. No C++ API for geckodriver according to github - https://github.com/mozilla/geckodriver – joe.dinius Aug 20 '20 at 21:49

1 Answers1

0

You can make use of pyinstaller https://pypi.org/project/pyinstaller/

pyinstaller /path/to/yourscript.py

This will create the executable file from your script and take care of all used modules.

kevinn-12
  • 13
  • 5
  • That is what I'm doing but nodejs is a dependency of Bokeh that is not imported when Bokeh is imported – Ray234 Aug 21 '20 at 17:20