Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.