2017-09-16 101 views
0

我有一個問題。當我在沒有sodo的情況下在centos 7上運行pip3 commnad時,它可以正常工作。所以pip3 --version outpus這無法使用sudo在centOs上運行pip3 7

pip 9.0.1 from /root/projects/venv/lib/python3.6/site-packages (python 3.6) 

,但是當我有這樣的sudo pip3 --version須藤運行它,我得到命令未找到錯誤。

sudo: pip3: command not found 

有人可以幫我嗎?我想安裝uswgi,當我不使用sudo時安裝會終止。這是錯誤

compilation terminated. 

---------------------------------------- 
Command "/root/projects/venv/bin/python3.6 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-build- 
2usl184a/uwsgi/setup.py';f=getattr(tokenize, 'open', open) 
(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
/tmp/pip-gv2qp3l0-record/install-record.txt --single-version- 
externally-managed --compile --install-headers 
/root/projects/venv/include/site/python3.6/uwsgi" failed with error 
code 1 in /tmp/pip-build-2usl184a/uwsgi/ 

回答

1

試試這個:

sudo yum install python34-setuptools 
sudo easy_install pip 
+0

這個作品!你能解釋發生了什麼,爲什麼這能解決問題? – Reza

+0

您可能在用戶配置文件上安裝了pip,但未將其安裝到root用戶,因此sudo(root)沒有命令pip。以這種方式安裝它將爲root用戶安裝。 –

相關問題