Introduction to Python & virtualenv: How They Work
Today at ARZ Host, we discuss how we Update Python in Virtualenv in Windows and Linux. We’ll look at how to update Python in the Windows system in this article. For protest purposes, we shall update Python from version 3.6.8 to version 3.9.6. Use the following command in the command prompt to see what version of Python is currently installed on your computer:
-V python
This will display the Python version you are currently using, as demonstrated below:
Using the installer’s executable:
To update your Python version, take the following actions:
Step by Step Guide of Update Python in virtualenv
Step 1: Visit the Python website.
Phase 2: Select the Downloads tab.
Step 3: Depending on your system requirements, download the version you need to update to (ie, 32-bit or 64-bit). Here, we will get the 3.9.6 installer for 64-bit systems.
Explore the Best Frameworks of Python Framework for Success in your Business and Work.
Step 4: Click the installer to start the installation process. Make certain to choose “Add Python 3.9 to PATH.” click “Install Now” after that.
The installation will begin as indicated below:
Following a successful installation, you will see the following message:
Now, if you open cmd and enter the following command:
-V python
You can see that Python has been updated to version 3.9.6 as indicated below:
Python Package Updates for Windows and Linux
On Linux or Windows, Pip can be used to upgrade all packages:
1: Create a requirements file (requirements.txt) and output a list of installed packages in it:
pip freeze > specifications.txt
2: In requirements.txt, change every '==' to a '>='.
Use the editor’s ‘Replace All’ command.
3: Upgrade all out-of-date software:
txt, pip install -r —upgrade
Related Article: Creating a Virtual Environment Python3 in our Windows and Linux system
All Packages in A Virtual Environment Are Update
Running the Update Python in Virtualenv script below, which uses pip, is the simplest way to update unpinned packages (i.e., packages that do not need a specific version) in a virtual environment:
import pkg_resources
from sub-process import call
for dist in pkg_resources. working set:
call ("python -m pip install --upgrade " + dist.<project name>, shell=True)
For more articles like this and more, Visit our Blog at ARZ Host.
Read More:
- Sending Email with a Dedicated Server: Step-by-Step Guide
- When Should I Invest in a Dedicated Server? 5 Signs Your Website Needs
- What is Memcached, and How Does It Boost Website Performance?
- How to Send Mass Emails on a Dedicated Server: A Complete Guide
- How can we use a Dedicated Server for Email Marketing?