How to make it easy for the end user to install all of my dependencies in Python?

Question:

I’ve built a program that has a couple of dependencies, and I am wondering how to make it as easy as possible for end-users at my company to install and use the program.

They will have no problem downloading Python and getting the program to run, and I can help them troubleshoot a bit. But I don’t want to make them run multiple pip commands, especially not more involved ones like for the python snowflake connector (installation info here) which requires them to run pip commands where they need to input their python version and the desired version of the package to download.

It seems like a simple requirements.txt might not be sufficient, since the snowflake connector requires downloading the list of dependencies from a live webpage. I considered using setup.py, which seems interesting, but apparently this is for python packages, and my program is rather a simulation and not a tool to be used by other programmers, as such I didn’t think of it as a package.

As such I would benefit greatly from any recommendations on best practices to help my users install their dependencies – some degree of work is okay (it doesn’t have to be just a one-click-install), but I’m looking for an alternative that is easier than running a bunch of verion-dependent pip commands.

The program will use Python 3.9, which is the most recent version compatible with my dependencies.

Asked By: doublefelix

||

Answers:

You can use PyInstaller (Normal Users)

PyInstaller can bundle your script and all its dependencies into a
single executable named myscript (myscript.exe in Windows).

https://pyinstaller.org/en/stable/operating-mode.html

You can dockerize your app (Developer Users)

https://www.docker.com/blog/how-to-dockerize-your-python-applications/