How to Set Environment Variables in PyCharm - 3 Different Ways!

Published: 19 May 2019
on channel: Jarad Python
30,343
166

In this video, I'll show you how to set PyCharm environment variables three different ways.

The first way of setting PyCharm environment variables is to use the virtual environment. With this approach, you have to edit activate.bat and deactivate.bat. This is my preferred method because it allows you to use the PyCharm terminal for all your Django work instead of running Play or Debug in PyCharm.

The second way of setting environment variables in PyCharm is to use a plugin. A plugin called EnvFile lets you define your environment variables inside it. You name this file "environment.env" (but you could name it anything as long as it ends with a .env extension). You then reference this file in your project configuration.

The third method is to simply use the project configuration's environment variables within PyCharm. This approach still forces you to Run or Run Debug within PyCharm. You won't be able to use the terminal using this method.

Which method do you prefer? Leave your comment below!

Helpful links
https://stackoverflow.com/questions/4...


Watch video How to Set Environment Variables in PyCharm - 3 Different Ways! online, duration hours minute second in high quality that is uploaded to the channel Jarad Python 19 May 2019. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 30,343 times and liked it 166 visitors.