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

后端 未结 9 2478
感情败类
感情败类 2020-12-07 13:44

I am working on mac OS X Yosemite, version 10.10.3.

I installed python2.7 and pip using macport as done in http://johnlaudun.org/20150512-installing-and-setting-pip

9条回答
  •  臣服心动
    2020-12-07 14:08

    check your $PATH

    tox has a command line mode:

    audrey:tests jluc$ pip list | grep tox
    tox (2.3.1)
    

    where is it?

    (edit: the 2.7 stuff doesn't matter much here, sub in any 3.x and pip's behaving pretty much the same way)

    audrey:tests jluc$ which tox
    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/tox
    

    and what's in my $PATH?

    audrey:tests jluc$ echo $PATH
    /opt/chefdk/bin:/opt/chefdk/embedded/bin:/opt/local/bin:..../opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin...
    

    Notice the /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin? That's what allows finding my pip-installed stuff

    Now, to see where things are from Python, try doing this (substitute rosdep for tox).

    $python
    >>> import tox
    >>> tox.__file__
    

    that prints out:

    '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/__init__.pyc'
    

    Now, cd to the directory right above lib in the above. Do you see a bin directory? Do you see rosdep in that bin? If so try adding the bin to your $PATH.

    audrey:2.7 jluc$ cd /opt/local/Library/Frameworks/Python.framework/Versions/2.7
    audrey:2.7 jluc$ ls -1
    

    output:

    Headers
    Python
    Resources
    bin
    include
    lib
    man
    share
    

提交回复
热议问题