43

I am using PyCharm 3.4.1 on Ubuntu 14.04. For new project it suggests ~/PyCharmProjects for storing project folders. Is it possible to change the location and name of this proposed folder?

(I couldn't find any reference to changing it in the interface, on the JetBrains site, or in the settings files. Either it isn't possible or (I hope) I missed something.)

Note, it is not a duplicate of Can I change the location/name of PyCharmProjects? - I am aware that it is possible to change proposed path for every created project - but I want defaults that I like.

3
  • 1
    I've been poking around the config files, and I can't find anything that looks promising for this. What a shame :| May 7, 2015 at 3:26
  • 1
    possible duplicate of Can I change the location/name of PyCharmProjects?
    – durron597
    Sep 12, 2015 at 20:11
  • @durron597 Linked question is about changing location of specific existing project. This is, as mentioned in the title, about default location of projects. Oct 24, 2021 at 18:58

10 Answers 10

25

I know this is an old question, but is is certainly possible as of now

Settings | Appearance & Behaviour | System Settings | Default directory

See JetBrains support page

screenshot

1
  • Restart of PyCharm is necessary for this setting to take effect (confirmed on v2020.3.5/Win)
    – rwired
    Jun 29, 2022 at 15:24
16

In fact, this is possible. In the IDE settings folder (https://www.jetbrains.com/help/pycharm/project-and-ide-settings.html), under config/options/recentProjectDirectories.xml, you can add an option lastProjectLocation. It wil honor this setting when creating new projects. My recentProjectDirectories.xml looks like this:

<application>
  <component name="RecentDirectoryProjectsManager">
    <option name="lastProjectLocation" value="$USER_HOME$/my_projects" />
  </component>
</application>

In fact, for most options that you want to customize, you could do a diff of the config/options folder before and after you make the change: this way you can find out a lot about how PyCharm (or any IntelliJ tool) configures its editor.

2
  • 2
    The above works. Just as a precaution, though, make sure PyCharm is not running when the above change is made, otherwise the changes may get overwritten when PyCharm is closed.
    – oczkoisse
    Dec 22, 2018 at 2:38
  • 6
    The option is now available in settings > Appearance & Behaviour > system settings > default directory for newer versions of Jetbrains IDEs. After this , every new project that you create will have the default directory path prepended to it. May 31, 2020 at 6:06
10

I haven't found an explicit option for doing this in PyCharm, but the following steps have worked as an alternative:

  • Move your PycharmProjects folder to the desired location.
  • When you create a new project, press the "..." button to the right of the path (This is on the pop up window that asks for location and interpreter).
  • Navigate to the new location of PycharmProjects and select that directory.
  • Add the name of the new project to the directory location (ie. /home/alex/Documents/PycharmProjects/new_project_name)

Now, whenever you create a new project, the location will default to the last chosen path.

This wouldn't be a good solution for someone who is creating projects in many different directories, rather than just PycharmProjects. All my projects are within PycharmProjects and this works just fine.

1
  • 1
    Bravo... My own planned method would work just fine with that you provided here! Jun 2, 2017 at 23:35
5

PyCharm (since at least version 2017) remembers the parent directory of the last place where you created a project. So create a junk project in the directory that you want to be your default projects directory, then close that project, and delete it from disk. The next time you create a project, pycharm will automatically put you in that directory.

3

It's not a provided option. See this old thread (2003) on devnet.jetbrains.com where this is being discussed.

Subsequent requests to specify a default directory for projects has gone unanswered:

0
3

Just an update to @Psionman's answer. At least in the professional version (2019.3.5), t appears to have shifted just a bit. The field is now available at

File | Settings | Appearance & Behavior | System Settings > Project Opening > Default Directory

3

The latest version 2021.3 has the following option:

File | Settings | Appearance & Behavior | System Settings > Project (Dialogue) > Default project directory

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Dec 9, 2021 at 21:10
1

Just like virtualenvwrapper, PyCharm apparently obeys $PROJECT_HOME

export PROJECT_HOME=$HOME/Devel
pycharm

or

PROJECT_HOME=$HOME/Devel pycharm
1
  • sorry to be a novice on this one... This item seems to be pretty handy. However, I'm novice enough not to be confident as to where I would put the text that you are suggesting. So... if I wanted to force the default directory to be ~/Dropbox/L-PROGRAMMING/Python ... (1) what actual config file do I edit (you don't mention its name) ... (2) what string would do it for me? *** Note, I'm on MacOS... to make it more annoying... :) Jun 2, 2017 at 23:24
1

I would have to agree, because I could not find an option in the program. However, based on the answers, found a folder labeled (in my case) \Users\.PyCharmCE2018.1\config\options

In this folder there are XMLs, one named option with a tag "file.chooser.recent.files". I worked with this, which I found to work for me.

0

Maybe this also serves:

File -> Settings -> Project (name) -> Project Structure -> Add Content Root

Add folders and then create files and/or navigate between them easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.