[Python] pip installs packages successfully, but executables not found from command line

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    I installed python2.7 and pip following these instructions, on MacOS X Yosemite, version 10.10.3.

    I can successfully install packages and import them inside my python environment and python scripts. However, any executable associated with a package that can be called from the command line in the terminal are not found.

    For example, I tried to install a package called "rosdep" as instructed here. I can run sudo pip install -U rosdep which installs without errors and the corresponding files are located in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages. However, sudo rosdep init subsequently reports that the rosdep command is not found.

    I even tried adding the above site-packages path to my $PATH, but the executables are still not found on the command line, even though the packages work perfectly from within python.

    Why does this happen, and how can I fix it?


    See also: Unable to import a module that is definitely installed - these two problems often have the same root cause.

    Continue reading...

Compartilhe esta Página