M
M
maksam072021-12-06 10:56:44
Django
maksam07, 2021-12-06 10:56:44

How to automatically work in PyCharm in each project with the versions of the libraries that are specified in requirements.txt?

Good afternoon. I write various projects in django, I run everything through docker. Very briefly:
There is the last created project that I write on the latest alpha version of django - 4. *
But there are also other projects that are mainly on version 3.2. *
There are enough differences between versions, paycharm often swears that some then functions/methods, etc. not in one project that is in another (with a different version of django) I

install all the libraries in this way:
In the terminal I enter: pip install -r путь_к_проекту/requirements.txt -U
I understand that this is a hemorrhoid, I would like to fix it so that for each project it would not be necessary to be so sophisticated and download the necessary versions of the libraries

I thought about the option with venv, but I'm still interested in options if there is something suitable.
Also, different versions of Python can be used in different projects.

Answer the question

In order to leave comments, you need to log in

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

In general, PyCharm seems to be able to create virtual environments (read - local copies of python) for their projects? Then just create your own venv in each project, install the necessary packages locally into it and work like this.
But I’m at a loss to say more precisely, I didn’t work with PyCharm myself.

A
Antonio Solo, 2021-12-06
@solotony

configure your own python (your venv) for each project. you can create them both in pycharm and from the console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question