2

I am stumped by this problem, which probably has nothing to do specifically with winpdb. To get winpdb to the current version I wound up installing and uninstalling several times. It now works, but I can't start it using the command "winpdb", even though it is on my path. And I get "No such file or directory" rather than "command not found" even if I'm the directory where it lives. However, when I'm in that directory, I can run it with ./winpdb. This [https://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists] is the closest I've come to an answer, suggesting that it has to do with a broken symbolic link. But ls -l turns up no such link.

Here's a rundown. I used copy/paste on the cd to the full path name, so it's not just a typo. It runs at the end, and I get the next command prompt when I quit out of it:

localhost:~ nat$ winpdb
-bash: /usr/local/bin/winpdb: No such file or directory
localhost:~ nat$ nonexistentcommand
-bash: nonexistentcommand: command not found
localhost:~ nat$ cd /usr/local/bin/
localhost:bin nat$ ls -l winpdb
ls: winpdb: No such file or directory
localhost:bin nat$ echo $PATH
/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/Users/nat/Library/android-sdk-mac_x86-1.5_r3/tools
localhost:bin nat$ cd /Library/Frameworks/Python.framework/Versions/2.7/bin
localhost:bin nat$ ls -l winpdb
-rwxr-xr-x  1 root  admin  2175 Dec 31 23:54 winpdb
localhost:bin nat$ winpdb
-bash: /usr/local/bin/winpdb: No such file or directory
localhost:bin nat$ ./winpdb
localhost:bin nat$ 

Any help appreciated!

Community
  • 1
  • 1
Nat Kuhn
  • 9,493
  • 5
  • 18
  • 26
  • Is `/Library/Frameworks/Python.framework/Versions/2.7/bin/winpdb` a shell script wrapper or calling a shell script that attempts to call/open `/usr/local/bin/winpdb`? – Wintermute Jan 01 '15 at 14:29
  • Thanks! Assuming a "shell script wrapper" is what it sounds like, yes, it is a wrapper for Python code and starts with the line `#!/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python`. It doesn't seem to refer to `/usr/local/bin/winpdb` and I'm assuming that if it did, `./winpdb` would not work. – Nat Kuhn Jan 01 '15 at 14:34

1 Answers1

6

Try a new shell session and/or try hash -r and then run the command.

Your shell is probably "remembering" the previously seen /usr/local/bin/winpdb path it found.

\winpdb and/or command winpdb might also work (as a temporary way to avoid the hashed location lookup) but I'm not sure.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148