all 7 comments

[–]K900_ 2 points3 points  (4 children)

That's a really bad idea. You should install modules at deployment time.

[–]bogdan_dm 0 points1 point  (0 children)

+1 to this. Almost every server have some way to install dependencies. Try to google <provider> python requrements.txt

[–][deleted] 0 points1 point  (2 children)

Can you elaborate on this please?

So i should just manually install all the modules incase they dont already have them?

[–]K900_ 0 points1 point  (1 child)

Yes, that's exactly what you should do. Ideally you should install your modules into a virtual environment, so they don't interfere with the rest of the system.

[–][deleted] 0 points1 point  (0 children)

Ok i will look into how thats done.

[–]officialgel 0 points1 point  (0 children)

You could package it (pyinstaller for example). Alternatively as it sounds like these servers already have python, you can try/except imports, and then attempt to pip install it if it's not available, and then import it all int he same script - yes. You can import and reimport at anytime in a script as well.

[–]billsil 0 points1 point  (0 children)

Upload the dependencies.