2

Is it possible to launch a command line prompt from pycharm that has all the environment variables set already (IE PYTHONPATH) for my projects custom environment.

Bojan Jovanovic
  • 1,439
  • 2
  • 19
  • 26
  • This question looks like it might be helpful, if you're using VirtualEnv: http://stackoverflow.com/questions/22288569/how-do-i-activate-a-virtualenv-inside-pycharms-terminal – metsfan Apr 20 '14 at 23:04
  • This doesn't help launching from pycharm, but with a VirtualEnv set up I just created this batch file: `C: cd \path_to_project\ call c:\path_to_virtualenv_environment\scripts\activate.bat start C:\path_to_bash\sh.exe --login` I keep the batch file handy to launch. – metsfan Apr 21 '14 at 16:25
  • No we are on windows environment, and @metsfan s solution is looking quite good at the moment, will try it out in the morning at work – Bojan Jovanovic Apr 21 '14 at 22:33

1 Answers1

0

If you go to Run -> Edit Configurations in PyCharm, this will let you set CLI arguments, and there's also a couple of different PYTHONPATH-related fields (Add content roots to PYTHONPATH, Add source roots to PYTHONPATH). You can also right-click a folder under the Project menu and check Mark as Sources Root - which I believe adds this directory to the PYTHONPATH at PyCharm script run-time.

Also, like metsfansaid, you could create a batch file to populate your Windows PYTHONPATH environmental variables prior to running anything in the new environment. I believe PyCharm will inherit those.

alex
  • 6,818
  • 9
  • 52
  • 103