PyCharm is storing system-specific settings in project-file.
Hello
I'm using PyCharm Community 2017.1. I store all my projects at git, to share them with all my computers (Desktop, Notebook).
Unfortunately PyCharm stores system-specific settings in the project-files. Which make it hard to use the same project on another system, since I always have to reset those settings again and again and again.
For example the python interpreter. This is stored in "<Project-Dir>/.ida/<Project-Name>.iml"
Of course the python binary directory is not the same on all systems, thus after pulling my changes from git, I always have to reset the python interpreter.
Furthermore, after working with the project, I always have to commit also changes to this *.iml file to git, even if I know that those changes in this file will cause issues on my other computer.
Is there any chance to store system-specific settings like the python interpreter at the system (PyCharm installation) only and not distributing it with the project-files to the repository?
Please sign in to leave a comment.
Many people will use Python virtual environments during their development cycle, in order to isolate their project dependencies from their working system. In these cases the python interpreter is a project specific setting - not system wide.
If you always use the same interpreter, can you not save the system interpreter setting as a default setting ?
Hi Anthony
Thanks for the answer. I tried your suggestion, using virtual environments.
However this does not solve the issue:
The virtual environment is simply a link to a local python version and also the path of the virtual environment is completely local on every system. Thus storing the path to the virtual environment for system A will lead to break the execution on system B, since the virtual environment is here available under a different path.
So again, why should it make sense to store system depended settings in a project-file which is shared between different systems?
I also tried to use the default settings for the python interpreter. But it did not work either.
1.) I pull my changes from System B to System A.
2.) I start PyCharm and it is complaining, since the python interpreter is not available (the interpreter from System B)
3.) I goto "File/Default Settings.../Project Interpreter" and here my local virtual environment is set.
4.) I goto "File/Settings.../Project: python/Project Interpreter" and here no interpreter is set (thus I would expect, it takes the default one)
5.) But PyCharm is still complaining about the fact no interpreter is defined for this project.
6.) If I look at the run configuration of my project in the field "Python interpreter" I can only read "Project Default (none)". Here I can now set my local virtual environment to get everything running, but then I will have the same issue later on System B.
Furthermore, even if I have not changed anything in the settings of the project, git shows me that "<project-dir>\.idea\workspace.xml" have been changed. This is also something, I don't understand. Why does PyCharm change anything in the Project-Files just, because I start the IDE and close it again. This leads to completely meaningless commits to git and even worse: It will lead to merge conflicts, if many people are working together on the same project.
Hi Andre! Please take a look at this commend by Andrey Vlasovskikh: https://youtrack.jetbrains.com/issue/PY-24060#comment=27-2157888 I believe it should help you at least with Project Interpreter. There's also a similar ticket in PyCharm tracker: PY-24315.
Hi
Thanks for the links. I read both links and it seems, that "misc.xml", "tasks.xml" and "workspace.xml" must be on the Git ignore-list.
I wonder, why this is never explained by the IDE. For example, the IDE detects by itself, that the project is on a version control system. Why does it not raise a warning like "Hey you have to put those project files to the ignore list. Click here to do it."?
Furthermore, after I put those files on the ignore list, it seems, that some project related settings are not shared any more. For example the start configurations. Now I have to maintain the start configurations for every computer manually. Which is ok, for two computers...
But if I would use it in a company with 50 developers on a single project, and they have to do it all manually, it would be an issue.
So even, PyCharm is really a cool IDE, it seems to have issues with mixing up system and project dependent settings on the ".idea" files. Please have a look at Eclipse for example and you will see, that those issues are not exist there. In Eclipse system dependent settings and project dependent settings are very well separated.
It is the same with the answer from "https://youtrack.jetbrains.com/issue/PY-24060#comment=27-2157888". Here your colleague asks the customer to take care about having the same name for all python interpreters on all computers where the project is shared. Not PyCharm is taking care about this, but the customer must do. This is something I really don't understand. This can be a big issue for big teams.
Best regards,
André