Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python SQLAlchemy Basics Introduction to SQLAlchemy What is SQLAlchemy?

Bodie Ponder
Bodie Ponder
2,808 Points

I'm having a very hard time installing my virtual environment in VsCode.

I was able to run and install the " py -m pip install --user virtualenv " But when I try and run " python -m venv env "

it returns this:

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

I'm new to VsCode and I really want to find a solution so I'm able to use it. I couldn't figure out any solutions from the internet so I'm pretty lost.

Thanks in advance.

Jeff Muday
Jeff Muday
Treehouse Moderator 28,720 Points

Which operating system are you using? This will make a bit of difference on how you set it up.

Bodie Ponder
Bodie Ponder
2,808 Points

I'm using windows 10 right now.

1 Answer

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,720 Points

Hey Bodie-- I think you're missing the "Python" extension in Visual Studio Code.

On the left margin of Visual Studio Code (I'll call it VSC) search for "Extensions". (it's icon should look like three blocks together and a fourth block detached). Click on it.

In the search field type Python. The top extension should be Python (from Microsoft). In the right pane click on "Install". It takes a minute or two to install.

Once it is installed, hit F1 on your keyboard. In the center top there will be a prompt, type in Python: select interpreter hit Enter. On the drop down selection select + Enter interpreter path with the mouse. Now you can navigate to find the exact "python.exe" that is in your virtual environment. It will be a long pathname I expect, but everything is relative to that path.

Now you should be ready to use the correct Python to run your files.

If that doesn't get you working, you should follow the tutorial from Microsoft on this website (for Python). It is definitely worthwhile to set it up.

https://code.visualstudio.com/docs/python/python-tutorial

I am a big advocate of have MULTIPLE IDEs-- sometimes you just need to switch. So I also recommend Jetbrains Pycharm EDU version or the Pro version if you want more features. Or my old-school favorite, Wingware Personal or Wingware Pro if you need more features.

Bodie Ponder
Bodie Ponder
2,808 Points

Thank you very much Jeff! Problem is solved!!