pip installation /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

后端 未结 19 1132
再見小時候
再見小時候 2020-11-28 19:58

I don\'t know what\'s the deal but I am stuck following some stackoverflow solutions which gets nowhere. Can you please help me on this?

  Monas-MacBook-Pro:         


        
19条回答
  •  温柔的废话
    2020-11-28 20:36

    I got same problem. If I run brew link --overwrite python2. There was still zsh: /usr/local/bin//fab: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory.

    cd /usr/local/opt/
    mv python2 python
    

    Solved it! Now we can use python2 version fabric.

    === 2018/07/25 updated

    There is convinient way to use python2 version fab when your os python linked to python3. .sh for your command.

    # fab python2
    cd /usr/local/opt
    rm python
    ln -s python2 python
    
    # use the fab cli
    ...
    
    # link to python3
    cd /usr/local/opt
    rm python
    ln -s python3 python
    

    Hope this helps.

提交回复
热议问题