简体   繁体   中英

How to hide venv in PyCharm Project View

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

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 de select 'Show Excluded Files' from the drop down menu.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM