Point different .idea folder in PyCharm
How to ignore the existing .idea folder and use own .idea folder for the PyCharm project
When working in a group project suppose you have a folder that is getting synced to OneDrive or other media.
If the people in your group working on PyCharm to write python code, PyCharm will create .idea
folder to store different settings like interpreter path, etc. So suppose your friend changes the interpreter path for her folder and that data gets synced to Onedrive, you will face an issue next time you run the PyCharm, you will need to configure your interpreter again. Now if you change it, your friends will face the same issue. In this article, I will show how to use your own configuration .idea
folder so that you only modify the code and all the PyCharm business is kept in your local machine.
Suppose you have a folder named folder_1
that is getting synced via OneDrive. Now you choose any folder you like where you want to store your .idea
in the local machine. For this article, I will name this folder as folder_2
you can name it as project_1_idea
or whatever you want.
--folder_1
|_ .idea
|_ main.py
|_ some_more_files_or_folder
Now create an empty project inside that folder_2
and set whatever interpreter you want to use.
Now after creating the project go to the setting.
Under project, structure press the cross sign to remove any folder from the root
Once it is removed you can see add content root
Click it and add the root directory of the project.
Now click apply and okay. Now you can see the project folder inside the current project. It will ignore the existing .idea
file from the parent directory. Delete the main.py
that got created automatically if you want.
Now if you open the folder_2
you will see only .idea
folder. Next time when you want to edit the project make sure to open the PyCharm project in folder_2
not folder_1
⚠.
With this, all your code changes will be saved to the original directory but all PyCharm related stuff will be inside the folder_2
.