Visual Studio Code sees no virtual environment



  • There are two python versions in the car. 3.8 and 3.9. Path is 3.9, because default reveals everything as the last version. Created a virtual environment for the project, both through the command line and through the VSCode itself, activated. The editor doesn't catch her. I mean, in the line of the state, instead of... venv/Scripts/python.exe, it's shown by. I tried to hand-written the piton file inside the project, but instead, it downloads a virtual environment from pit 3.8, although the piton version in Project 3.9. Opened, closed the VScode, opened through the project folder - useless. Is there something wrong with my editorial design? Tell me where to watch. введите сюда описание изображения



  • He doesn't have to download anything after he activated it.

    conda activate ./myenv 
    

    Piton's on herll.

    python app.py 
    

    python.exe finds itself in myenv. It's only necessary from inside. virtualenv shell I' binarys. numpy I can only launch anacon of console. Check the Piton version:

    python --version
    

    Where the improvised libs are:

    import sys
    print(sys.path)
    

    Although if it's not anaconda, try to redesign the path like this, Set ./.vscode/settings.json so:

    {
    "python.pythonPath": "myenv\\python.exe"
    "terminal.integrated.shell.windows" : "C:\\Windows\\system32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
    "/K","activate.bat"
    ]
    }
    

    Then the right button of mouse on the launch squeak and Run Python File in Terminal. So I started anaconda (venv) projects until the numpy pyd stopped loading, now everything through shell. It's possible to automate after shell activated (or through cmd or through settings.json)- Circumstances by the right button of mouse on the launch violin and Run Python File in Terminal. Everything works. PS. It happens that even after that, I didn't see that the virtual environment was in another folder, rebooting, asking for the same interpreter (as in settings.jsonson) and putting the same into works, I guess.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2