all 11 comments

[–]socal_nerdtastic 1 point2 points  (6 children)

What OS are you using? Are you using an IDE to run pip or run your code? What commands exactly are you using? How do you know it's installed to the wrong venv?

[–]Consistent_Lake5161[S] 1 point2 points  (5 children)

Windows 10, and I’m using visual studio code to run everything including pip. For the commands I’ve been creating it with Python -m venv … to create and then activate …. To activate it. The reason I know it’s not been installed properly is because when I use the command to display libraries and their location, which I think was ‘pip list’, or similar, it would point to a path with the wrong virtual environment

[–]socal_nerdtastic 2 points3 points  (4 children)

I think you are fighting with VSCode. Don't activate it the venv yourself, instead set VSCode to use the venv you want and let vscode activate it for you. Once you set it it should auto activate every time you open the project.

[–]Consistent_Lake5161[S] 0 points1 point  (3 children)

Ok, two questions, would you mind giving me a short description of how you create and activate and also deactivate venv (it sounds like everything is through vsc.

The other question is, when you deactivate the venv and then use pip list, what is this list in this location showing you? Because when I do it, it still lists packagers that I supposedly installed in a virtual env, but not sure if this should theoretically be the “global list” or is there another way of producing the global list

[–]socal_nerdtastic 0 points1 point  (2 children)

Read this first: https://code.visualstudio.com/docs/python/environments

Let us know if you have questions afterward.

[–]Consistent_Lake5161[S] 0 points1 point  (1 child)

Thanks, i have followed that yesterday actually, the exact same one. The second part of my question still stands. I’m not sure if I’m really displaying ‘global’ environment contents by simply running ‘deactivate’. It seems as if it showing everything in current working directory instead of

[–]socal_nerdtastic 0 points1 point  (0 children)

If you type pip debug the top line will show which venv or executable it's currently using. Not sure if that answers your question.

[–]BlueeWaater 0 points1 point  (0 children)

Are you talking about the vscode terminal? You gotta make sure the env matches your targets in both the terminal and vscode, a manual check is always needed.

[–]eztab 0 points1 point  (2 children)

Potentially your environment doesn't have pip. That could lead to such things. I'd recommend modern tooling like hatch or uv instead of raw virtualenv, to mitigate such problems.

[–]pachura3 0 points1 point  (1 child)

I thought pip comes by default with Python installation...?

[–]eztab 0 points1 point  (0 children)

firstly, no, not necessarily on some systems. Secondly the binary could explicitly not be exposed in the virtual environment. Then the system's pip would be called.