'sudo pip install' is not recognized. 'pip install' is recognized.
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. |
Quote:
You can change that behaviour in the sudoers file. See https://www.sudo.ws/man/1.8.15/sudoe...nd_environment. Or you first run sudo -i, then enter the virtual environment. Here is another discussion of this problem: https://askubuntu.com/questions/2347...lenv-with-sudo. |
All times are GMT -5. The time now is 04:27 PM. |