不能在 centOs 7 上使用 sudo 运行 pip3

Can't run pip3 with sudo on centOs 7

我有一个无线问题。当我 运行 在没有 sodo 的 centos 7 上使用 pip3 commnad 时,它可以工作。所以pip3 --version输出这个

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

但是当我 运行 它像这样使用 sudo 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/

试试这个:

sudo yum install python34-setuptools
sudo easy_install pip