Article 5693P 'sudo pip install' is not recognized. 'pip install' is recognized.

'sudo pip install' is not recognized. 'pip install' is recognized.

by
MrBright2019
from LinuxQuestions.org on (#5693P)
On Ubuntu 20, I created a virtual environment(venv) like this:
sudo python3 -m venv my-env

I do activate and I get into the venv:
(code-env) mr@ubuntu:~/code-env$ sudo pip install git+https://github.com/user/c-gnmi
[sudo] password for mr:
sudo: pip: command not found

Then if I attempt without 'sudo', it is recognized but I get an error stating permission denied.
(code-env) mr@ubuntu:~/code-env$ pip install git+https://github.com/user/certain-script

Running setup.py clean for c-gnmi
Failed to build c-gnmi
Installing collected packages: six, pycparser, cffi, cryptography, grpcio, protobuf, c-gnmi
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/c/code-env/lib/python3.8/site-packages/six.py'
Consider using the `--user` option or check the permissions.

Can someone explain how 'sudo pip install' is not recognized? I tried pip3 and same behavior.latest?d=yIl2AUoC8zA latest?i=DByrEVytPzg:30FDEvCS34c:F7zBnMy latest?i=DByrEVytPzg:30FDEvCS34c:V_sGLiP latest?d=qj6IDK7rITs latest?i=DByrEVytPzg:30FDEvCS34c:gIN9vFwDByrEVytPzg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments