GithubHelp home page GithubHelp logo

Python was not found about vscode.py HOT 5 OPEN

codewithswastik avatar codewithswastik commented on August 26, 2024
Python was not found

from vscode.py.

Comments (5)

CodeWithSwastik avatar CodeWithSwastik commented on August 26, 2024 2

Will fix this soon 👍

from vscode.py.

ashrauma avatar ashrauma commented on August 26, 2024 1

More info, the problem is in build/extension.js file.

Solution: Get current activated virtualenv in VSCode and use that python to run python. Else get python from global environment.

from vscode.py.

Nicholas-Schaub avatar Nicholas-Schaub commented on August 26, 2024

Any updates on this? I am building a vscode extension that needs the environment set in vscode. I'm probably going to hack together a solution so I can continue building this out.

I'm happy to contribute to a solution as well. If you want to give me a broad explanation of how you would like to approach this, I can work through it.

from vscode.py.

Nicholas-Schaub avatar Nicholas-Schaub commented on August 26, 2024

I think I actually figured out how to resolve this. It comes with only a few minor code changes. It basically works like this:

  1. Get the path the current active environment path from the vscode-python extension api
    https://github.com/microsoft/vscode-python

  2. When running extension.py, replace python3 with the path to the active python environment.

This seems to work. One other thing I've added is changing the working directory to the workspace directory prior to running the script. The main reason is that I am creating an extension that inspects and runs code in the current workspace.

I can open up one or more PRs for this if that would be helpful.

from vscode.py.

SmartManoj avatar SmartManoj commented on August 26, 2024

Python is installed in C:\Users\x\AppData\Local\Programs\Python\Python311\python.exe, but it checked at C:\Python310\python.exe

take path from which python or where python command

from vscode.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.