Change the default location of Pycharm Project

前端 未结 8 546
庸人自扰
庸人自扰 2020-12-25 11:18

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 n

相关标签:
8条回答
  • 2020-12-25 11:29

    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.

    0 讨论(0)
  • 2020-12-25 11:31

    Just like virtualenvwrapper, PyCharm apparently obeys $PROJECT_HOME

    export PROJECT_HOME=$HOME/Devel
    pycharm
    

    or

    PROJECT_HOME=$HOME/Devel pycharm
    
    0 讨论(0)
  • 2020-12-25 11:34

    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

    0 讨论(0)
  • 2020-12-25 11:38

    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.

    0 讨论(0)
  • 2020-12-25 11:38

    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

    0 讨论(0)
  • 2020-12-25 11:39

    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.

    0 讨论(0)
提交回复
热议问题