sudo easy_install pip
然后当我运行时
我明白。
Searching for pip
Best match: pip 1.4.1
Processing pip-1.4.1-py2.7.egg
pip 1.4.1 is already the active version in easy-install.pth
Installing pip script to /home/nyzlfc/.local/bin
Installing pip-2.7 script to /home/nyzlfc/.local/bin
Using /home/nyzlfc/.local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
然后当我运行时
sudo pip install -U pyyaml nltk
我明白。
sudo: pip: command not found
/.local/lib/python-ver/目录下,相应的可执行文件则会被放置在/.local/bin/目录中。因此,将~/.local/bin加入到你的$PATH环境变量中,然后你就可以非sudo方式使用pip了。 - lazyPowersudo apt install python3-pip
安装Python包管理器,然后使用pip3 install xxx
来安装您的软件包。 - Ng Sek Long