Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a python app with several sub modules. What's the prefered way to install/deploy such a multifile python app? Any user and process should be able to call the app/script without changing into the app's directory. I've placed the app in /usr/shared/myPyApp and created a link in /usr/bin to the main-script But when I call it, the python-app doesn't find it's submodules. I think this happens because the workingdir is the path of the link.

  1. create a bash script, set the working dir, start the python script and pass the cmd arguments
  2. modifiy the python app ?
  3. or?
share|improve this question
    
Does it work OK if called explicitly (/usr/shared/myPyApp/script.py)? – terdon Apr 27 '13 at 12:38
    
Yes, it works if I call it with an absolute or relative path – chriszero Apr 27 '13 at 13:13

The easiest thing would be to simply add the directory where you have the script installed to your path. Add this line to your ~/.bashrc file:

export PATH=$PATH:/usr/shared/myPyApp/script.py

You should then be able to run it by typing script.py.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .