Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop pycharm from searching inside virtual environment folder?

Tags:

pycharm

I have a .venv folder inside the project root, which has a python virtual environment. When I use the search feature of Pycharm, it also shows the result from this .venv folder. How can I ignore the virtual environment folder from search results?

I tried marking the directory as Excluded, but that didn't help.

like image 564
Asnim P Ansari Avatar asked Sep 04 '19 19:09

Asnim P Ansari


2 Answers

Did you exclude the venv folder? Right-click on the .venv in the project tree -> Mark directory as -> Excluded.

like image 136
Pavel Karateev Avatar answered Oct 19 '22 22:10

Pavel Karateev


I'm experiencing the same issue: Even though I've marked the .venv directory as excluded, its contents still show up in the "Find in Files" search results.

I've found a workaround for this, though. In my "Project Settings" I define an "Exclude files" pattern like so:

  1. Open the "Settings" window from the "File" menu.
  2. Find and expand the "Project: <your project name>" section on the left.
  3. Under that section click the "Project Structure" sub-section.
  4. At the bottom of the form on the right, enter **.venv** as the value for "Exclude files:".
  5. Click "OK" to confirm and close.

enter image description here

like image 2
urig Avatar answered Oct 19 '22 23:10

urig