K
K
KitCat122021-12-04 12:43:57
Python
KitCat12, 2021-12-04 12:43:57

Why is the wrong virtual environment activated?

I create a directory, navigate through it on the command line.
Next, I write the command:

virtualenv -p "C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe" "C:\Новая папка\test\venv"

A virtual environment appears in the folder I need. From the same folder, I activate it using the command venv\Scripts\activate. In the console, the path appears before the (venv). Everything seems to be fine, but when I write pip freeze, I get the output of libraries that are installed in a completely different version of Python, and which are not in the venv\Lib\site-packages. When I try to install the library, it tells me that it is already installed, but again it is not in the virtual environment. How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OmegaTortik, 2021-12-04
@KitCat12

There may be a problem in the space "New folder"
If not, then transfer the library from that version of Python to the virtual environment
And also try to go to file -> Settings -> project: 'Project name' -> Python intrepetator -> there will be an intrepetator choice and will be plus sign for adding libraries (if it's PyCharm)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question