DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on • Edited on

31 3

/bin/sh: 1: python: not found in VS Code [Solved]

/bin/sh: 1: python: not found occurs when you have python3 installed . For example, you can check your python version:

Image description
You can see something like this. Now check if you have python3 installed or not.

Image description
It works . If it does not work for you, then install python3 in the latest version.

Follow these steps to install python3:

Step 1: Update and Refresh Repository Lists



sudo apt update


Enter fullscreen mode Exit fullscreen mode

Step 2: Install Supporting Software



sudo apt install software-properties-common


Enter fullscreen mode Exit fullscreen mode

Step 3: Add Deadsnakes PPA



sudo add-apt-repository ppa:deadsnakes/ppa


Enter fullscreen mode Exit fullscreen mode

The system will prompt you to press enter to continue. Do so, and allow it to finish. Refresh the package lists again:



sudo apt update


Enter fullscreen mode Exit fullscreen mode

Step 4: Install Python 3
Go to this page and look for the latest version of python3 : https://www.python.org/downloads/



sudo apt install python3.10.4


Enter fullscreen mode Exit fullscreen mode

python3.10.4 was the latest version when I was creating the blog.

Now, check the version



python3 --version


Enter fullscreen mode Exit fullscreen mode

You can read this blog for more ways to install python into Ubuntu.

Now we have python3 installed .
Image description
Still python does not work.
Let's tell our system that python3 is python.

Image description
Now it works perfectly.

Now, go to your VS Code and the problem will be solved.

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (8)

Collapse
 
viditsharma7 profile image
Vidit Sharma

simply use
sudo apt install python-is-python3

Collapse
 
vittor profile image
Vittor Fonseca Serra

Valeu
Salvou muito!

Collapse
 
srisha2953 profile image
srisha2953

It worked like a charm, Thanks!

Collapse
 
hamzahndev profile image
Hamzah nDev

Now it works perfectly !
😊

Collapse
 
igorbrizack profile image
Igor Brizack

It worked for me!! Thanks!!!

Collapse
 
stormytalent profile image
StormyTalent

Perfect!

Collapse
 
clivepato93 profile image
clivepato93

thank you

Collapse
 
viditsharma7 profile image
Vidit Sharma

sudo add-apt-repository ppa:deadsnakes/ppa
return an error
TimeoutError: [Errno 110] Connection timed out

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay