skip to Main Content

Working in VSCode (1.86.2) on an iMac (14.3.1): I created a conda environment and selected python 3.10 as the interpreter (one of the libraries I am working with doesn’t work with anything above 3.10), then start a new terminal and I can see that the environment is activated.

I then start installing things and it switches to 3.11? What is that about? I checked with python --version and I get Python 3.10.13. I checked the .conda/bin and the libraries are there.

Terminal says this (/path/to/directory/Project/.conda) (.conda) (base) My-iMac:Project D$

screenshot

2

Answers


  1. please try to follow these steps:

        $ conda create -n myenv python=3.10
        $ conda activate myenv
        $ python --version
        $ conda install --no-update-deps <package-name-here> # if you need to install any package in this env
        $ which python
    

    The output should point to the Python interpreter in your conda environment.

    So, just use this env created in your VSCode.

    PS – If it doesn’t, you might need to adjust your PATH variable.

    Login or Signup to reply.
  2. First of all, the kernel you choose for jupyter has nothing to do with the terminal, it doesn’t affect the terminal’s python environment.

    If you choose an interpreter (virtual environment) for .py scripts,

    Ctrl+Shift+P –> Python: Select Interpreter

    enter image description here

    then a new terminal will automatically activate the environment.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search