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'm sorry if this question is asked in a different way before. I did my due search effort on Google and StackOverFlow(SOF), but the search terms that I tried haven't returned the answer I was looking for.

The problem is: I have installed Python virtualenv locally (that is, in "~/.local/") because I don't have sudo access to my school machine. The virtualenv now sits in "~/Download/modules/virtualenv-1.9.1/" and when I try to use it, I always have to type in something like:

$ python ~/Download/modules/virtualenv-1.9.1/virtualenv.py --distribute venv

I would like to do something like

$ virtualenv --distribute venv

I know I can add "alias" in "~/.cshrc" (or bash equivalent), but I'm wondering if there is alternative way to do this rather than adding more aliases. Sincere apology if this is a repeated (and naive/beginner) question. As I mentioned before, I wasn't successful in coming up with correct search terms to figure out the solution on Google/SOF. Thank you for your help.

share|improve this question

migrated from stackoverflow.com Jun 7 '13 at 4:43

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Sure, you can set a local variable. Try this out:

export MY_CUSTOM_VAR=/Users/YOURUSERNAMEHERE/Download/modules/virtualenv-1.9.1

Then you should be able to use $MY_CUSTOM_VAR in place of that directory in any command.

share|improve this answer

I would probably put a script in ~/bin/venv

#/bin/sh
exec python \
    ~/Download/modules/virtualenv-1.9.1/virtualenv.py \
    --distribute venv \
    "$@"

(make that executable with chmod u+x ~/bin/venv).

Don't forget to put ~/bin in your $PATH.

share|improve this answer

Your Answer

 
discard

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