Python Packaging from Pycharm

I'm creating my first "complex" python package. It's complex to me as it will include multiple python scripts, log files and continuously running processes. 

 

I'm getting to the stage in which I will need to deploy the app to Linux machines. At least the relevant parts. As I am new to this I am wondering what the best way to deploy this is? The things I'm thinking about are the libraries that I have imported, and how to deploy them as part of this package as to avoid importing them from the 'spoke' location. 

 

Appreciate any help on this matter.

0
1 comment

There are multiple ways to publish a package for subsequent deployment. Some popular examples:

- Push to Git repo and clone to target machines

- Publish to PyPi

- Build a Docker image and publish to Docker Hub

The things I'm thinking about are the libraries that I have imported, and how to deploy them as part of this package

The most simple approach is to do `pip freeze > requirements.txt` and on the target machine `pip install -r requirements.txt`.

Using Docker, you can share the complete environment with all the libraries pre-installed in the image.

1

Please sign in to leave a comment.