My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Getting Started with Python : Environment Setup

Getting Started with Python : Environment Setup

Ruth Ikegah's photo
Ruth Ikegah
·Jun 6, 2020·

2 min read

Think about the importance of setting up your workspace, a new house or room to fit your taste, same applies to working with any programming language. You need to set up the development environment which allows you to execute the code you write. So this article is going to cover how to configure your development environment to suit Python. Now let’s go.

  • The first step is installing the Python software on your local machine based on your operating system, hardware architecture and version on: python.org/downloads . Be sure to download the version suiting the job to be done. When installing the Python software remember to click on Add Python to Path checkbox. Look at a pictorial view:

install-wizard1.png

Just in case you have python installed on your system and you don’t know if you added it to path. Go to Control Panel –> System Properties –> Environment Variables and select the PATH variable, then edit it by pasting the Python path which will look like this: C:\Users\Name\AppData\Local\Programs\Python38. Ensure you add the Python Scripts path to paths too. If you are wondering what Add to Path does, it helps you access Python and run scripts in whatever location you are on your system.

  • If you installed Python from the source - python.org, you should already have pip. Pip is a standard package management system used to install and manage software packages written in Python. You can check the version of pip you have with this command: pip --v

    If pip is not installed: For windows: you can install from get-pip.py or type the command: python get-pip.py

For other operating systems, you can check here .

  • Lastly, installing a virtual environment. It allows you to create an environment with the python version you are using for the project allowing you install project specific packages. It also helps for better collaboration by code management and easy sharing of code. For every project you will need a virtual environment. To do this via the command line, you type the command:

pip install virtualenv

And woo-hah ! You are all set.