How to remove project in PyCharm?

PythonPycharm

Python Problem Overview


If I'm closing a project and then just delete the project folder, after PyCharm restarts an empty project folder is created again.

Python Solutions


Solution 1 - Python

Just follow these steps in order. They assume you currently have the project open in a PyCharm window:

  1. Close your project by clicking on File -> Close Project
  2. Locate your project in the PyCharm file directory
  3. Delete your project's directory

I agree that PyCharm's handling of what should be a very simple procedure is crappy. Maybe this will be improved in the future?

Solution 2 - Python

If you want to remove the project from the recent projects list, just highlight the project with your mouse and hit the del key.

Solution 3 - Python

This is for PyCharm 2019.1, but I can bet this will work in previous versions.

I am assuming you are in a Unix based operating system (macOs or any Linux distribution). I am also assuming you have currently opened the project you want to remove.

  1. Close the project by going to File → Close Project:

    enter image description here

     

  2. Remove the project from Pycharm's Welcome Window:

enter image description here

  1. Locate your project and delete it, you can use several alternatives, but I encourage you to use the following
$ rm -rf /path/to/your/project/directory

The previous command will work in macOS and Linux. In Windows, you can delete it manually by locating the projects directory using File Explorer.

That's it, the project has been completely deleted!

Solution 4 - Python

  1. click the project you want to remove.
  2. menu bar Edit-> Remove from Project View.

Solution 5 - Python

Version 2017.2.1

  1. Press Alt+1 to bring the project pane, and make sure you're in Project view (not Project Files view).
  2. Select the desired project, and choose "Delete from project view" from the context menu (right click). You can also use Delete key.

Solution 6 - Python

Works for Windows and MacOS.

  • File -- Open Recent -- Manage Projects enter image description here

  • Cliek X to delete from Recent Projects enter image description here

  • Delete local directory

According to https://www.youtube.com/watch?v=ksbmc0coO4k

Solution 7 - Python

In PyCharm 2018 I finally had to resort to deleting .idea folder and the project went away.

Solution 8 - Python

There is a difference between PyCharm projects and the list of recently opened projects (File → Open recent...):

  • The PyCharm project is simply an arbitrary folder1 with the appropriate .idea subfolder in it.

  • The list of recently opened projects is simply the list of paths to some of such folders.

PyCharm does not keep the list of all projects, so you may safely delete a project folder (or its .idea subfolder) from your file system.

But if you have a bad luck, the path to your project directory is already listed in the list of recently opened projects, and if you try opening it with File → Open recent..., then

  1. in older version of PyCharm, the deleted folder is re-created (as a new folder with only the .idea subfolder in it),

  2. in newer versions of PyCharm you get the prompt similar as

    > The path C:\Users\you\PycharmProjects\deleted_project does not exist.
    If it is on a removable or network drive, please make sure that the drive is connected.

    with buttons "OK" and "Remove From List", so you may simply remove the deleted folder from the list,

  3. in all version of PyCharm, if you deleted only the .idea subfolder, it is silently re-created (but all your project settings are lost, of course).

To prevent from the uncomfortable consequence of the 1st possibility of using the File → Open recent... to re-create already deleted project, follow e.g. the first two instructions in the Simin Jie's answer.


1 generally a subfolder of the PyCharmProjects folder in your user profile directory (e.g. if you created it with File → New Project... and accepted the offered default path).

Solution 9 - Python

Highlight the project with your mouse and hit the del key, which works for me.

Solution 10 - Python

In 2021 maybe another way to do it. My problem was in project with user directory (root was /Users) that contains too many not Python files, and it triggers some problems with Git and file index.

What I did:

  • show hidden files (Cmd + Shift + .),
  • find .idea directories,
  • delete all .idea directories.
  • open PyCharm and add project from correct directory.

That's it.

Solution 11 - Python

In version 2017.2.1

File → Close Project

You will be taken to the start-up window, where you can see the projects you've created on the left. You can then delete a project by clicking the cross sign ('x') following the project name.

Solution 12 - Python

I had the same issue. My solution was:

  1. Close project.
  2. Rename the folder you want to dissapear
  3. Open pycharm project. A dialog will be shown asking if you want Pycharm remove the folder. Answer: yes.

That is enough.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1685095View Question on Stackoverflow
Solution 1 - PythonTheCatPartyView Answer on Stackoverflow
Solution 2 - PythonwinbloodView Answer on Stackoverflow
Solution 3 - PythonlmiguelvargasfView Answer on Stackoverflow
Solution 4 - PythonZhangXuView Answer on Stackoverflow
Solution 5 - PythongamlielaView Answer on Stackoverflow
Solution 6 - PythonCloudView Answer on Stackoverflow
Solution 7 - PythonDavid DehghanView Answer on Stackoverflow
Solution 8 - PythonMarianDView Answer on Stackoverflow
Solution 9 - PythonYang WangView Answer on Stackoverflow
Solution 10 - PythonMikhail BarinovView Answer on Stackoverflow
Solution 11 - PythonNan ZhouView Answer on Stackoverflow
Solution 12 - PythonssotoView Answer on Stackoverflow