PyCharm: always mark venv directory as excluded(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
venv
或 venv;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 目录标记为已排除


基础教程推荐
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 包装空间模型 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01