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 目录标记为已排除
基础教程推荐
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
