'pycharm cannot find interpreter when cloning github of the same project between 2 computers

I coded on my labtop, push code to github. then clone it to my computer for the first time. ( environment are different of course)

I did all my work on my computer. come home. I deleted old project and clone it back to my labtop instead of doing "git stash" and "git pull" because when I use "git stash" and "git pull", a conflict in vcs.xml and workspace.xml within the .idea created by pycharm.

after that my pycharm on my labtop cannot recognize interpreter even tho the path that is shown in the interpreter is still the

I cannot find it on google because keyword to search are not obvious.



Solution 1:[1]

Note that a typical JetBrains.gitignore wouold ignore any workspace.xml file.
If vcs.xml dies include workstation-specific paths, you might want to ignore it too.

The idea is to re-import your cloned repository project in your IDE in your second environment.

Also with Git 2.6+, do use:

git config --global pull.rebase true
git config --global rebase.autoStash true

Then a simple git pull will:

  • stash automatically your work in progress
  • replay (rebase) your local commits on top of the updated remote tracking branch.

Solution 2:[2]

You can make the new project as the root directory by right-clicking on it and then paste the files there, it may help.

Solution 3:[3]

It happens when there's no .idea/<project_name>.iml file in your project root, usually because it was removed/renamed by the VCS. Please follow this workaround and consider adding this file to .gitignore

Simple Solution - Please delete the .idea folder if you already have this, and restart the pycharm editor. Then reopen the project again. The interpreter will be automatically set.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC
Solution 2 haroon khan
Solution 3 alexpdev