current position:Home>Ubuntu has Python libraries installed and cannot run command not found from the command line

Ubuntu has Python libraries installed and cannot run command not found from the command line

2022-07-25 10:30:20Haulyn5


For example, the library is installed runlike , But enter the command directly and prompt after entering Command not found, Refer to the following solutions .( take runlike Replace with the name of the library you installed )

programme 1:

If you only need to execute once , In a hurry, you can use this one-time solution . Add  ~/.local/bin, Use absolute path . Examples of the original command and the modified corresponding command are as follows .

#runlike   Using the command directly will prompt  command not found,  Add the previous path according to the following command to successfully execute 

programme 2:

Once and for all , Direct will ~/.local/bin/ Path join PATH, In this way, it will be retrieved in this path when executing relevant commands .

export PATH="$HOME/.local/bin:$PATH"


Need to use recently docker, Long ago run The container of , Want to run A similar , Then I found it runlike library , Requirements can be fulfilled .runlike It's a python The library of , But the execution is directly in bash Internal input runlike Executive . However, the actual operation encountered Command not found.

At first, it was speculated that python2 and python3 Problems with multiple versions , But in fact, it's not . The general reason is linux Next , Executable scripts are put into  ~/.local/bin This directory . However, this directory has not been added PATH, So lead to bash The program couldn't find runlike. Students who are not familiar with script programming can add PATH Relevant knowledge .

Maybe the wrong roast :Python2 Total abandonment ,Python3 Many versions stop supporting 2022 year ,Ubuntu Use pip and python And mark python3 perhaps pip3, tired .

Roast again : What does the quality of the new article suggest ……It looks like it discriminates against blogs with less than 1000 words.

Reference material

copyright notice
author[Haulyn5],Please bring the original link to reprint, thank you.

Random recommended