简体   繁体   中英

How to get VSCode's terminal to recognize python

I'm just getting started with learning python and this is my first project. I'm trying to write a bot for a simple game and I'm trying to run a command in the terminal at the bottom of vs code to check if pyautogui is installed correctly in my workspace. I can do "pip list" from my computers terminal and I see pyautogui from the list but vscode terminal window says

The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct, and try again.

At line:1 char:1

  • pip list
  •  + CategoryInfo: ObjectNotFound: (pip:String) [], CommandNotFoundException + FullyQualifiedErrorId: CommandNotFoundException

Thanks for the feedback

VScode uses a virtual environment, so you have to install the modules from VScode.

try to use pip3 instead of pip (if you use python3.x). otherwise try to install pip with 'python get -pip.py'.

This has happened to me a few times before and I believe that it is a path issue in Windows. So, the easiest way to fix this is to let Anaconda do it for you.

Go this link: https://www.anaconda.com/products/individual#windows

Then, click on the download button. Once it is downloaded, the installer will ask if you would like to let Anaconda modify your path, say yes. Let anaconda make the alterations that it needs.

Then, restart your visual studios code and try pip again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM