How to hide venv in PyCharm Project View

Question:

I just updated to Python 3.7.2 in PyCharm 2018.3.2 and a new venv folder showed up in my project view. I’ve read several threads on stackoverflow but haven’t found a solution to remove the venv from Project View which is what I want.

I read it’s “best practices” to keep the venv with the project but currently I’d rather have it separated and removed from Project View.

Does anyone know how to do this?

EDIT: The problem was I had configured a venv in the PyCharm “Project Interpreter page”. If you want to keep everything minimal there’s no need for a venv or anaconda, although the PyCharm “Project Interpreter page” layout suggests so. https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

Asked By: bad_coder

||

Answers:

You can exclude and hide the ‘venv’ directory (along with other excluded directories) as follows:

  1. Mark it as excluded: right click on the ‘venv’ directory -> Mark Directory as -> Excluded.
  2. Hide excluded files: click on the tiny gear icon in the Project View panel and deselect ‘Show Excluded Files’ from the drop down menu.
Answered By: MEE

I often use a lot of methods. The general folder can be hidden, only the venv folder is not allowed, so I can only delete venv, re-configure venv, when re-configuration, do not put venv in the project file In the folder, put a new Venv folder for all applications.

E.g
--Diango
----Myproject
----venv
------Myprojectvenv
Answered By: Kevin

If you are using the ‘New UI’ then you can exclude the directory as follows:

  1. Right click on the directory and hover ‘Mark Directory As’ and then select ‘Excluded’. This should highlight the file orange to signify this.
  2. On the project view panel click on the 3 vertical dots in the top right, then select ‘Tree Appearance’ and deselect ‘Show Excluded Files’

This is a very similar answer to MEE’s, but for the new UI. I couldn’t comment as this was my first-time using stack overflow so I thought I’d post it as an answer instead.

Answered By: EggsLeggs