My home dir ran out of space and I wanted to move the PyCharm project to another directory. I ended up copying it because refactoring didn't work. I deleted the pycache and the zip exception, that had appeared was gone and now everything works as expected. I still use the venv location of my initial project location though, from what I can see in settings/python-interpreter.
Is there anything wrong with this procedure, anything I'm not aware of? Should I edit some of the files in the .idea folder?
The $PROJECT_DIR$
variable caught my attention, but I couldn't find where this variable is actually set.
A clean way to move your project is right-clicking on your project folder in "Project view" (Alt +1 ) , choosing Refactor
and then Move Directory
.
The $PROJECT_DIR$
variable is dynamic and taken from the directory your project is in, so that isn't a problem
Your .idea
folder should be recreated by PyCharm even if you completely delete it. However I wouldn't advise deleting your folder mainly because you will loose your project-level dictionary (wordlist).
Invalidating caches has a wider impact because it will clear IDE wide settings not just project specific settings. (It's mostly useful if your cache becomes outdated, which tends to manifest itself by inexplicable errors.)
If something goes wrong just open the moved directory as a new project going to File
>
Open
. For a simple project there are 2 main settings that you should check and may have to adjust:
In settings "Settings" (Ctrl + Alt + S) go to Project: your_project_name
and there check that Project Structure
makes sense and retains your configurations.
In Run
>
Edit Configurations
make sure that Script path
and Working directory
are set to the locations you want.
Is there anything wrong with this procedure, anything I'm not aware of?
From your description you took the right steps since refactor didn't work, just ensure the above configurations are met and if the IDE doesn't issue any errors you should be good.
Should I edit some of the files in the .idea folder?
This would rarely be necessary and is generally discouraged. The files in the .idea
are IDE generated and should not be touched. Any necessary changes should be made using the IDE graphical interface to set configurations (which means you don't have to worry about the contents of .idea
).