PyCharm:始终将 venv 目录标记为已排除

PyCharm: always mark venv directory as excluded(PyCharm:始终将 venv 目录标记为已排除)

本文介绍了PyCharm:始终将 venv 目录标记为已排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Python 3 中,我不再在 ~/.virtualenvs 中创建虚拟环境,而是将它们保存在项目目录 ./venv

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

但是,现在每个 PyCharm 项目中的搜索结果都包括来自 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.

如何从 PyCharm 全局索引/搜索中省略名为 venv 的目录?

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

推荐答案

In File >设置 >项目:>项目结构在底部是排除文件:你可以放一些东西在那里像

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

venvvenv;coverage.xml(根据您的评论)

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

它似乎无法识别路径(例如 foo/venv),但这符合您的要求.

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

这篇关于PyCharm:始终将 venv 目录标记为已排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:PyCharm:始终将 venv 目录标记为已排除

基础教程推荐