Python Environment Setup

1 0
Read Time:2 Minute, 18 Second

Environment Setup

Python is available on a wide variety of platforms including Linux and Mac OS X. Let’s understand how to set up our Python environment.

Local Environment

Open a terminal window and type “python” to find out if it is already installed and which version is installed.

Downloading Python

You can download Python from https://www.python.org/downloads/.

Installing Python

After download specified version and specified operating system python installer, install python.

Once you’ve successfully run the Python installer, you should see the following icons appear in your start menu, on your home screen:

image

Add the Python 3.10 Directory to your System Path Environment Variable

In order to make it so you can access Python via any command line prompt (and not just the Python-specific one), you’ll need to add the newly-installed Python 3.10 directory to your “Path” system environment variable. This makes it easier to access Python and run scripts in whatever shell you’re using to using (Command Prompt, PowerShell, and Git Bash.)

So, go to Control Panel –> System Properties –> Environment Variables and select the PATH variable from the list below:

image

Click Edit

image

With that in place, you can now start the Python interpreter on any command prompt by invoking the python command. Let’s get our package manager set up for Python.

Install pip to Manage Your Python Packages

Step-1 Download PIP get-pip.py

Before installing PIP, download the – get-pip.py file for 3.x and get-pip.py file for 2.7

  1. Launch a command prompt if it isn’t already open. To do so, open the Windows search bar, type cmd and click on the icon.
  2. Then, run the following command to download the get-pip.py file:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Step-2 Installing PIP on Windows

To install PIP type in the following:

python get-pip.py

Upgrading PIP for Python on Windows

To upgrade PIP on Windows, enter the following in the command prompt:

python -m pip install --upgrade pip

This command uninstalls the old version of PIP and then installs the most current version of PIP.

Downgrade PIP Version

Downgrading may be necessary if a new version of PIP starts performing undesirably. To downgrade PIP to a prior version, specifying the version you want.

To downgrade PIP, use the syntax:

python -m pip install pip==version_number

For example, to downgrade to version 18.1, you would run:

python -m pip install pip==18.1

You should now see the version of PIP that you specified.

Thanks for reading see you in next topic.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
100 %

Average Rating

5 Star
100%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “Python Environment Setup

  1. Beⅽause оf Beosin Тhe application haѕ ƅetter functionality.

    Client іs happy ѡith their work aand support fгom technical experts.
    Ƭhе team iss аble to manage tһe project effectively սsing Trello andd communicates wsll via
    Slack аs welpl ɑs Google Meet. Ⲟverall, customers can expect ɑ greɑt experience.

Leave a Comment