Code deployment

Answered

I've finished writing my Python project and now need to move it to a new PC which is located in a local area network without any remote access, so I need to transfer my project via a flash drive. What is the simplest way to package all used libraries to my project folder and how do I modify my project to use them?

0
3 comments

Hi Ragnaruk! Are you going to continue develop this project on a new machine or do you want to create an executable and transfer it? Can't you access PyPI on this new machine?

If you're going to develop your project further I would try to create new virtual environment inside my project (do not forget to exclude it from indexing) with --relocatable flag, then zip project and transfer whole archive. --relocatable is a experimental feature, so I'm not sure it would work ok in your specific case. Another variant that comes into my mind is to build Docker image with all dependencies and transfer project source code and this image to a new machine and use Python interpreter inside Docker container build with this image.

0
Avatar
Permanently deleted user

Thanks for the answer, I'll try it. I need to create an executable and transfer; and no I can't, otherwise, it would've been much easier.

0

I see, for creating an executable please check this stackoverflow discussion: https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency there're a couple of libraries for this task mentioned there.

0

Please sign in to leave a comment.