20

I want to set up PyCharm to work on a set of Python projects in a single window.

Lets say I have this projects structure.

~/src
├── py_project1
├── py_project2
├── py_project3
├── other_lang_proj1
└── other_lang_proj2

A system PYTHONPATH of /Library/Python/2.7/site-packages:/usr/local/lib/python2.7/site-packages:/opt/proprietary/packages

and some packages at

/opt/proprietary/packages
├── project1
├── project2
└── project3

How do I add the ~/src/py_project* projects to a single PyCharm window and have them see all of the packages in PYTHONPATH and /opt/proprietary/packages/project*?

Moving directories is not optional, and I don't want virtualenv. I want to configure PyCharm once for all of the open projects. For the record the PYTHONPATH works just fine for this setup everywhere but PyCharm.

2
  • "Moving directories is not optional," does that mean it's compulsory? Commented Dec 16, 2015 at 18:54
  • @pvg I have other tools set up as well and I don't feel I should have to reorganize my workstation to accommodate Pycharm. Some of the paths in /opt are required. Commented Dec 16, 2015 at 18:55

2 Answers 2

29

The accepted answer works and was probably the only way to achieve opening multiple projects when the answer was authored. However, adding a new content root simply adds the files in the underlying directory to the open project. Project settings such as the Python interpreter have to be shared between content root folders.

At the time of writing, PyCharm genuinely supports multiple projects in a single window. This allows different projects to be configured differently.

The official help document contains a step-by-step guide with screenshots on how to open multiple projects in a single PyCharm window.

Sign up to request clarification or add additional context in comments.

1 Comment

I don't see a way to create a new, separate project if one is already open. It seems the only way to start a brand new project is to disable the option to "Reopen projects on startup" so it will open the welcome window that has the "New Project" button.
14

You can add directories to one, for example. Let's say you have ~/src/py_project1 open as a project. go to settings -> project: -> project structure then +Add Content Root, and add the directories one at a time.

2 Comments

This seams to work well. I added the strategy of creating a pycharm folder that I open first to keep the project configs and now I can always open that project again instead of having to remember. I can back up the .idea folder for safe keeping and I don't have to add .idea to every .gitignore. It also stopped pestering me about managing my git repos, which I do by cli.
This way is old, as the user below mentioned, please use the new documentation :)

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.