Can't install packages in python conda environment

32 Views Asked by At

I'm kinda new to python and it's the first time managing environments with Anaconda.

There's some discrepancy that I can't figure out between my conda environment and my visual studio code, I'll explain:

I created a conda environment with python 3.8.11, recognised by vscode: vscode config

But if I open a terminal inside vscode, the environment selected is another one:

# conda environments:
#
base                  *  /opt/homebrew/anaconda3
quant                    /opt/homebrew/anaconda3/envs/quant

And this to me is already strange, I would expect the terminal environment to match the conda environment that I'm using for my project but okay.

So I switch to the "quant" environment:

❯ conda activate quant
❯ conda info --envs
# conda environments:
#
base                     /opt/homebrew/anaconda3
quant                 *  /opt/homebrew/anaconda3/envs/quant

but if I run python --version I get:

❯ python --version
Python 3.11.8

but I created the quant environment with python 3.8.11...why is it different? This trickle down to why I can't install new packages (I think), because if I try to install something, like "schedule"

❯ pip install schedule
Requirement already satisfied: schedule in /opt/homebrew/lib/python3.11/site-packages (1.2.1)

everything runs correctly, but then if I try to import the package I get: Import "schedule" could not be resolved

What am I missing?

0

There are 0 best solutions below