Home > Operation and Maintenance > Linux Operation and Maintenance > What should I do if the pip command cannot be found in Linux?

What should I do if the pip command cannot be found in Linux?

WBOY
Release: 2022-07-19 16:43:14
Original
8726 people have browsed it

Solution: 1. Use "vim /etc/sudoers" to edit "/etc/sudoers" and change "Defaults env_reset" to "Defaults !env_reset"; 2. Use "vim ~/.bashrc" , add "alias sudo='sudo env PATH=$PATH'".

What should I do if the pip command cannot be found in Linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What to do if the pip command cannot be found in Linux

Problem description:

After we install pip for Linux and use pip install to install the python package, we still prompt: sudo: pip: command not found

Solution:

(1) Edit /etc/sudoers:

sudo vim /etc/sudoers
Copy after login

Modify Defaults env_reset to:

Defaults !env_reset
Copy after login

(2) Edit the configuration file ~/.bashrc:

sudo vim ~/.bashrc
Copy after login

Add:

alias sudo='sudo env PATH=$PATH'
Copy after login

Make the modification effective:

source ~/.bashrc
Copy after login

At this time, use sudo The pip installation can be installed successfully.

Recommended learning: Linux video tutorial

The above is the detailed content of What should I do if the pip command cannot be found in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template