Can't find Python executable “python”

后端 未结 4 1201
慢半拍i
慢半拍i 2020-12-24 11:54

When i install iconv with npm got the following error:

iconv@2.1.0 install /root/Dropbox/nodeApps/nodeApp/node_modules/iconv

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 12:36

    For anyone encountering this issue on Ubuntu 16.04...
    node-gyp can't use Python 3.5.X which seems to the be the default that ships with 16.04. I read somewhere that 16.04 was supposed to ship with Python2 as well but I can't find it on my install.

    I fixed the above issue by:

    apt-get update     
    apt-get install python2.7    
    ln -s /usr/bin/python2.7 /usr/bin/python 
    

    Now when node-gyp goes looking for python it will hit your Python2.7 install and load correctly.

提交回复
热议问题