Reputation: 127
How do I remove all traces of legacy projects from PyCharm?
Background: I upgraded from PyCharm Community Edition to PyCharm Pro Edition today. Reason was so I could work on Django projects, and in particular, a fledgling legacy project called 'deals'.
I deleted the legacy project folders.
I then opened the Pro Edition and went through the steps of creating a Django project called 'deals' with a python3.4 interpreter in a virtualenv.
It didn't work, I got an error message saying something about a missing file, and in the PyCharm project explorer, all I could see was
deals
.ideas
So I deleted it (ie. deleted the folders in both ~/.virtualenvs/deals and ~/Projects/deals).
I tried again, although this time I got an interpreter with a number suffix, ie. python3.4 (1). I continued, and got the same empty file structure.
I deleted both folders again, went and cleaned out the intepreters in Settings > Project Interpreters .
I then tried again, getting 'new' interpreters,until I finally had python3.4 (5) Plus, along the way I also invalidated the caches and restarted. (ie. File > Invalidate Caches/Restart)
Then to prove if it works at all, I tried a brand new name 'junk'. This time it worked fine, and I could see the Django folders in the PyCharm explorer. Great.
But I really want to work on a project called 'deals'. So I deleted all the 'deal's folders again, and tried to create a deals Django project again. Same result.
After googling, I went to the Settings > Project Structure > + Content Root, and pointed it to the folder at ~/.virtual/deals.
Ok, so now I could see the files in the virtual env, but there's no Django files, and plus, the project folder was separate to the virtualenv folder, eg
deals
deals (~/.virtualenvs/deals) <- separate
deals
init.py settings.py urls.py wsgi.py
manage.py
Really stuck now.
Any advice on how to get this working please? Eg. how do I
(i) get it back to 'cleanskin' so that I can start up a Django project and get the proper folders in the project space.
(ii) get it working with virtualenv, and ensure that the interpreter doesn't have a number suffix, such as python3.4(6)
Many thanks in advance,
Chris
Upvotes: 5
Views: 26926
Reputation: 1
When virtual env is enabled, there will be a 'V' symbol active in the bottom part of pycharm in the same line with terminal and TODO. When you click on the 'V' , the first one will be enabled with a tick mark. Just click on it again. Then it will get disabled. As simple as that.
Upvotes: 0
Reputation: 11
In addition to the answer above, which removed the Venv from the Pycharm list, I also had to go into my ~/venvs directory and delete the associated directory folder in there.
That did the trick.
Upvotes: 1
Reputation: 661
You can clean out old PyCharm interpreters that are no longer associated with a project via Settings -> Project Interpreter, click on the gear in the top right, then click "More". This gives you a listing where you can get rid of old virtualenvs that PyCharm thinks are still around. This will prevent the "(1)", "(2)" part.
You don't want to make the virtualenv into the content root. Your project's code is the content root.
As a suggestion:
Clear out all the registered virtual envs
Make a virtualenv, outside of PyCharm
Create a new project using PyCharm's Django template
You should then have a working example.
Upvotes: 11