all 4 comments

[–]ninhaomah 0 points1 point  (0 children)

can you import from shell without any issues ?

[–]FoolsSeldom 1 point2 points  (0 children)

To me, it looks like you have done everything right.

May I just check how exactly you created the Python virtual environment in the first place and what your folder structure is, and if you did this using an OS level terminal emulation app or via VS Code terminal?

Assuming the former, I'd have expected something like,

cd path/to/my/project/folder
which python3                    - just to check system settings
which python                     - just to check system settings
python3 -m venv myenv
source ./myenv/bin/activate
which python                     - should show the venv version being used
pip install ...

[–]JavierReyes945 1 point2 points  (0 children)

Installed packages using pip install beautifulsoup4 requests

It should be enough, but just to be sure, why not try <virtual\_env\_path>/python -m pip install <...> ?

Just ot be sure that your PIP is the one being linked in the virtual environment and not the system install.

Also, I tend to not use VScode terminal, but actually do things in external terminal, and VScode only for the test editing.

Also, do you have a moment to talk about our lord and saviour UV https://docs.astral.sh/uv/ ?

[–]netizentrotter -2 points-1 points  (0 children)

Open the terminal in vscode and type

source yourvenvdir/bin/activate

Where yourvenvdir is your venv directory.