Change the default location of Pycharm Project

跟風遠走 提交于 2019-11-30 06:20:49

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.

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.

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:

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.

Kurdy

Just like virtualenvwrapper, PyCharm apparently obeys $PROJECT_HOME

export PROJECT_HOME=$HOME/Devel
pycharm

or

PROJECT_HOME=$HOME/Devel pycharm

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!