Skip to content
Advertisement

Running and installing missing modules for script through SSH

I want to run a python script on a Linux Box(I’m connecting to it through SSH on OSX terminal). In order for this script to run, the computer must have the SUDS module installed. I was wondering what would be the best way to install SUDS on computers that run my script and do not have SUDS installed in them. My script is in a folder the has a virtual env. The structure of my folder is:

MainFolder
-------script.py, env folder 
                  |----------binFolder, includeFolder, libFolder

Should I code my script to install SUDS from the script itself?Or is there a better method to achieve this?

Also, I would like to know if there’s a way to run my virtualenv through the SSH and use pip to install in the Linux Box?

Advertisement

Answer

Well it depends if you are deploying it only on this server and do not want to distribute the code than you would have to run the following command (assuming you have pip and python-tools)

sudo pip install SUDS

but if you get an error back saying that the command pip is not installed you will need to run the following command

sudo apt-get install python-pip python-dev build-essential 

If you want to distribute it than I would do open source on github with the instructions of how to use the program and run it I would add a dependencies list of all the external modules you used for your script.

Hope this helped.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement