Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing module from network

Is there a way to get python to read modules from a network?

We have many machines and it would be a too much effort to update each machine manually each time I change a module so I want python to get the modules from a location on the network.

Any ideas?

like image 611
Jared Avatar asked Dec 29 '22 02:12

Jared


2 Answers

Mount your network location into your file-system and add that path to your PYTHONPATH. That way, Python on your local machine will be able to see the modules which are present in the remote location. You cannot directly import from modules remotely, like specifying a js file in html.

like image 123
Senthil Kumaran Avatar answered Dec 30 '22 16:12

Senthil Kumaran


How I ended up doing this:

Control Panel\All Control Panel Items\System >> Advanced >> Environment Variables >> System Variables >> New >> Name = PYTHONPATH, value = \server\scriptFolder

Thanks everyone for all the help :)

like image 31
Jared Avatar answered Dec 30 '22 15:12

Jared