1

Goal: Make a symbolic link to pip.exe in a folder (C:\StacklessPython33) that is in the PATH so it gets recognized as callable application.

I do this command:

mklink "C:\StacklessPython33\pip.exe" "C:\StacklessPython33\Scripts\pip.exe"

However, when I call pip.exe from command line i get the response: Cannot open C:\StacklessPython33\pip-script.py"

pip-script.py is also a file in C:\StacklessPython33\Scripts\, but I did not link to that file.

and it gets even better... When I create a hard link, it works, with the same command.

mklink \H "C:\StacklessPython33\pip.exe" "C:\StacklessPython33\Scripts\pip.exe"

What is happening here?

EDIT: Doing right click on the symbolic link and looking it up with dir, both shows the correct target C:\StacklessPython33\Scripts\pip.exe.

throwaway17434
  • 821
  • 3
  • 13
  • 22
  • 1
    It sounds as if `pip.exe` is expecting to find the file `pip-script.py` in the same directory as itself. When you launch the symbolic link, Windows considers the symbolic link to be the executable path. When you launch the hard link, it considers the target to be the executable path. The latter behaviour is puzzling to me. (You can use Process Explorer to see what the executable path is for a given process.) – Harry Johnston Nov 17 '14 at 01:19

0 Answers0