V
V
Vanya Petilo2021-12-10 02:53:38
Python
Vanya Petilo, 2021-12-10 02:53:38

Why do imports work in one project and not in another?

As short and to the point as possible.
Two projects are arranged as similar as possible - each of them has its own runtime environment.
I install dependencies as expected: & pip install ./requirements.txt
To which in response I get many lines stating that everything is already installed.
But all the same - the left project is not launched. The error is visible in the console - does not find the flask module.
At the same time, the right project is successfully launched and everything is OK. Has anyone encountered a similar problem?61b296db39799940116787.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vindicar, 2021-12-10
@mr_garther

maybe because Windows finds pip3 in PATH and uses it?
Try to specify a direct path to pip3 in a specific venv.

J
JiMoon, 2021-12-10
@Jimoon

I have a guess:
1. you have different directories (try to write pip install in each directory
2. in projects different versions of python (for example, in the first project 2.9 some, and in the second super version 3.9)
UPD: I carefully examined screenshot, you have different directories, and in the rolefr-accounts directory, the flask module is most likely not loaded. write everywhere & pip3 install ./requirements.txt(or & pip3 install flask, this is for python 3.x). it is natural that the requirements.tx file be in your directories, if you specifically load it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question