I tried opening any .py file, checking Package requirements file field (Settings – Tools – Python Integrated Tools). Nothing triggered my PyCharm on Windows to detect a new dependency added to requirements.txt. Since the virtual environment was created with PyCharm’s Add Local, trying to get pip to work for the virtual environment with a Windows command line also seemed quite a bit of work.
Finally, the easiest solution that worked for me was as follows.
-
Click on the icon in the lower left corner. It brings up menus to
Project,Python Console,Structure,TODO, etc. FindTerminalin it.
-
Click on
Terminal. It seems to be automatically virtual environment aware. - Run
pip install -r requirements.txt