Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4538324
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:47:47+00:00 2026-05-21T14:47:47+00:00

I have a PyCharm 1.2.1 on Windows. I have to edit different branches of

  • 0

I have a PyCharm 1.2.1 on Windows. I have to edit different branches of the same project – somewhat heavy branches, because they live in different folders on disk – say it to be c:\apps\alpha and c:\apps\beta. For each such folder PYTHONPATH variable should be adjusted to point to appropriate vendor libraries which live somewhere inside project root folder (c:\alpha\vendor,…). I managed to work around this issue by starting PyCharm from cmd batch file which sets necessary PYTHONPATH variable value before starting PyCharm (so I have PyCharm.cmd inside alpha and PyCharm.cmd inside beta directories).

Problem: when I open PyCharm for editing beta folder, import statement imports modules from alpha folder! When I start python.exe interpreter from command line everything works as expected – the problem seems to be only with PyCharm.

Second strange investigation: executing print sys.path code from PyCharm and from external python.exe interpreter give different results – from PyCharm it do not show my PYTHONPATH modules. I’m a newcomer in Python and PyCharm, but this behavior looks very strange and inconsistent.

Finally I’ve found some settings in PyCharm IDE that looks like should allow me to resolve this issue – File -> Settings -> Python Interpreter. There I’ve found all paths for both alpha and beta folders. There is no way to clear this paths list, only to disable some elements. But even disabling works somewhat stupidly – I should disable/re-enable them separately for each time I edit alpha or beta “solution folders”.

So final question: how one can with PyCharm edit separate projects (folders) and force PyCharm not to import modules from wrong locations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:47:47+00:00Added an answer on May 21, 2026 at 2:47 pm

    The correct solution is not to try to work around PyCharm’s logic, but rather to use the IDE features as they’re designed. That means:

    • Not use any .cmd scripts for starting up PyCharm
    • Remove all the paths specific to “alpha” and “beta” from the list of paths in Settings | Python Interpreters if any are listed there
    • Mark the “alpha/vendor” and “beta/vendor” directories as source roots in the alpha and beta projects respectively.

    Then PyCharm will resolve imports correctly and generate the correct PYTHONPATH automatically when running the application from it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pycharm project and, presumably, a Django project. Perhaps they are one
I've just installed PyCharm, and have opened an existing project with multiple apps. When
Have deployed numerous report parts which reference the same view however one of them
I'm using PyCharm on a Windows machine, and I'm running the tutorial found here
It seems like Pycharm 1.5.3 makes some magic, or I missed something. I have
I am using the Python IDE PyCharm and something that is have by default
I am using pycharm, and, sometimes, the editor thinks i have a mistake in
Is there a way to have PyCharm to auto-completion when specifying imports of packages
I have just checked JetBrains products page and noticed they have a new product
I try to install Pycharm on Ubuntu 12.04 and I have this information: user@user:~/Pobrane/pycharm-2.5.2/bin$

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.