Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've just installed pypy, and I've made a symlink from /pypy to my pypy installation.

How can I turn this into a command, so that I can just type pypy myfile.py instead of having to type /pypy myfile.py?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

if you are on Snow leopard or on Lion the way to do it is as follows:

go to /etc/paths.d then

sudo touch pypy

then edit the pypy file (with vim, nano or whatever) to include the path to pypy

/path/to/pypy

the restart the terminal. For instance, I installed julia (http://julialang.org/) and I added a julia file in paths.d

$ cd /etc/paths.d
$ ls 
50-X11   MacGPG2  TeX      TeXbin   git      julia
$ cat julia 
/usr/local/julia

HTH

share|improve this answer
add comment

It depends on your shell. Check your $SHELL and $PATH variables

Symlinks should be executable by default, so you might just link your pypy to a directory already in your path. /usr/local/bin is a good choice for this sort of thing unless you have more intricate needs to separate things.

share|improve this answer
    
I've currently stored the binary next to the python framework, so I believe it's in /system/lybrary/frameworks, there I've created a directory called pypy, which now stores that. I'll look into the variables now. –  bigblind Apr 17 '12 at 12:45
    
I think I should add my pypy directory to the $PATH variable, looking up how to do that now. –  bigblind Apr 17 '12 at 12:47
    
I've edited my .profile file, so that it contains export PATH=/pypy:$PATH but that doesn't work. –  bigblind Apr 17 '12 at 12:55
add comment

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.