PyCharm: always mark venv directory as excluded

2019-06-27 02:41发布

问题:

In Python 3, I've moved away from creating virtualenvs in ~/.virtualenvs and towards keeping them in the project directory ./venv

However now search results in every PyCharm project include results from venv subdirectories, until you manually right-click and exclude them from the project.

How to omit directories named venv from PyCharm indexing/searching, globally?

回答1:

In File > Settings > Project: > Project Structure at the bottom is Exclude files: You can put something in there like

venv or venv;coverage.xml (given your comment)

It doesn't seem to recognize paths (e.g. foo/venv), but this does what you requested.