Python Package Installation for Windows (2024)

Try a faster way of installing Python packages for Windows. Build your own Python environment with the packages you need. Get started for free on the ActiveState Platform.

The Pip Package Manager is the de facto standard for managing Python distributions, and is recommended for installing Python packages for Windows.Pip is installed automatically with Python 2 (>=2.7.9) and Python 3 (>=3.4) installations. The pip command has options for installing, upgrading and deleting packages, and can be run from the Windows command line. By default, pip installs packages located in the Python Package Index (PyPI), but can also install from other indexes. For more information on how to use pip, see the Pip Package Installation instructions below.

Wheels and Windows

Python packages installed with pip on Windows are typically bundled into ‘wheels’ prior to installation. A wheel is a zip-style archive that contains all the files necessary for a typical package installation. Wheels have a .whl extension, and provide a simpler installation than ‘non-wheel’ packages.

Depending on the operating system that a package was built for and built on, the resulting wheel may not include file requirements for Windows. Appveyor offers a hosted continuous integration service that developers can use to package Python code for Windows deployments. Wheels built with Appveyor incorporate Windows support by default, and are usually recognizable by their name, e.g. packagename-2.8-cp37-cp37m-win_amd64.whl.

Installation Requirements

Before packages can be installed, ensure that your existing Python installation meets the requirements. Requirements will differ depending on whether you installed Python into a virtual environment using venv or virtualenv:

  • Venv automatically installs pip into Python 3.4+ virtual environments
  • Virtualenv automatically installs pip and wheel into Python 2.7+ and Python 3.3+ virtual environments

Note: If you’re using some form of enhanced shell such as IPython, then prefix the command with the ! character, e.g. !pip install <packagename>

  1. Verify that Python is installed:

Open a Windows command window and run the following command to check that a suitable Python version is installed:

python --version

Output should be similar to:

Python 3.6.6.

If Python is not installed, you can download a copy of ActiveState’s Python, ActivePython, for free.

  1. Verify that Pip is installed:
pip --version

Output should be similar to pip 19.3.1 from c:\python36\lib\site-packages\pip (python 3.6)

  1. Update Pip and Wheel to ensure you have the latest version installed:
pip install --upgrade pip wheel

Pip Package Installation

To install a package:

pip install <packagename>

To install a package from a repository other than PyPI, for instance, Github:

pip install -e git+<https://github.com/myrepo.git#egg=packagename>

To upgrade a package that is already installed:

pip install --upgrade <packagename>

To uninstall a package:

pip uninstall <packagename>

To show help for pip, including complete command usage and options:

pip -hpip --help

Pipenv

Pipenv is a new tool for managing dependencies. It uses pip and virtualenv under the hood, and simplifies their usage with a single command line syntax. Like venv, pipenv automatically creates a separate virtual environment for each project.

To install, upgrade or uninstall packages within pipenv, just replace the pip command with pipenv. For example, the following command installs a named package from PyPI:

pipenv install <packagename>

You can also install packages from locations other than PyPI. For example, the following command installs the requests package from a Github repository:

pipenv install -e git+https://github.com/requests/requests.git#egg=requests

Manual Package Installation

Most Python packages are now designed to be compatible with pip. If you have a package that’s not compatible, then you’ll need to do a manual installation.

How to manually install a Python package:

  1. Download the package and extract it into a local directory.

2a. If the package came with its own set of installation instructions, they should be followed.

2b. If not, then open a command window and cd into the directory, and enter:

python setup.py install

How ActiveState Can Help

ActiveState provides a unified cross-platform toolchain for modern Python package management. It can replace the complex and hard-to-maintain in-house solutions built from multiple package managers, environment management tools and other solutions.

By adopting the ActiveState Platform, developers can:

  • Automated building of packages from source, including link C libraries without the need for a local build environment.
  • Automated resolution of dependencies (or suggestions on how to manually resolve conflicts), ensuring that your environment always contains a set of known good dependencies that work together.
  • Central management of a single source of truth for your environment that can be deployed with a single command to all development and CI/CD environments, ensuring consistent reproducibility.
  • Automated installation of virtual Python environments on Windows or Linux without requiring prior setup.
  • The ability to find, fix and automatically rebuild vulnerable environments, thereby enhancing security and dramatically reducing time and effort involved in resolving CVEs.
  • Visually seeing which versions of which packages are approved for use, thereby taking the guesswork out of development.

Those that prefer to work from the command line can leverage the ActiveState Platform’s CLI, the State Tool, which acts as a universal package manager for Python, and provides access to most of the features offered by the Platform.

Python Package Installation for Windows (1)

Modern Python Package Management

ActiveState provides a unified cross-platform toolchain for modern Python package management. It can replace the complex and hard-to-maintain in-house solutions built from multiple package managers, environment management tools and other solutions.

By adopting the ActiveState Platform, developers can:

  • Increase the security of Python environments
  • Improve the transparency of your open source supply chain
  • Dramatically reduce package and environment management overhead
  • Eliminate dependency hell
  • Reduce “works on my machine” issues

Ultimately, developers that are willing to adopt the ActiveState Platform will spend less time wrestling with tooling and more time focused on doing what they do best: coding.

To try the ActiveState Platform for yourself, sign-up for a free account.

Related Links

Python Package Installation for Windows (2024)

FAQs

How do I add a Python package to Windows? ›

Method 3 : Using Command Prompt/Terminal
  1. Type "Command Prompt" in the search bar on Windows OS. ...
  2. Search for folder named Scripts where pip applications are stored.
  3. In command prompt, type cd <file location of Scripts folder> cd refers to change directory. ...
  4. Type pip install package-name.

How to manually install a Python package? ›

Which can be helpful in case the package to be installed is not supported by pip or any other reason.
  1. Step 1: Install Python. ...
  2. Step 2: Download Python Package From Any Repository. ...
  3. Step 3: Extract The Python Package. ...
  4. Step 4: Copy The Package In The Site Package Folder. ...
  5. Step 5: Install The Package.
Sep 23, 2022

How to pip install on Windows? ›

Method 1: Install PIP on Windows Using get-pip.py
  1. Step 1: Download PIP get-pip.py. Before installing PIP, download the get-pip.py file. ...
  2. Step 2: Installing PIP on Windows. To install PIP, run the following Python command: python get-pip.py. ...
  3. Step 3: Verify Installation. ...
  4. Step 4: Add Pip to Path. ...
  5. Step 5: Configuration.
Nov 30, 2023

How to install Python modules in cmd? ›

On Windows, to install a module named module_name open a Command Prompt window and run:
  1. pip install --user module_name. ...
  2. pip3 install --user module_name. ...
  3. python -m pip install --user module_name. ...
  4. python3 -m pip install --user module_name. ...
  5. import sys, os; os.system(sys.executable + ' -m pip install --user module_name')
Jan 11, 2021

Where is Python packages in Windows? ›

In conclusion, Python packages are installed in the Python Scripts folder located in the C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python37 folder in Windows 10.

How do I install and load a Python package? ›

Installing Python Packages with Setup.py

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

How to install Python on Windows? ›

To install Python using the Microsoft Store: Go to your Start menu (lower left Windows icon), type "Microsoft Store", select the link to open the store. Once the store is open, select Search from the upper-right menu and enter "Python". Select which version of Python you would like to use from the results under Apps.

Why does pip install not work on Windows? ›

First, make sure pip is installed on your system, as this may be the reason it is unable to be found. If you've just installed Python, you may want to rerun your Python installer and make sure you check the box “Add Python to PATH.” Next, click “Customize installation” and check the “pip” box under Optional Features.

Which Python package to install? ›

Top 10 Python packages you need to master to maximize your coding productivity
  • 10 Python packages for data science and machine learning. ...
  • NumPy. ...
  • Pandas. ...
  • Matplotlib. ...
  • Seaborn. ...
  • Scikit-learn. ...
  • TensorFlow. ...
  • SQLAlchemy.
Mar 27, 2023

How to install Python packages using pip? ›

A: To install a package using PIP, you can use the following command: pip install package_name. Replace package_name with the name of the package you want to install. PIP will automatically download and install the latest version of the package from PyPI.

How to import a package in Python? ›

Import a Python package

getcwd() . We import third-party Python packages into Python files in the same way as we import modules from the Python Standard Library into Python files. For example, we could make use of the numpy package to round numbers up and down.

How do I install a Python module? ›

How to install a module in python
  1. Use the Packager tab: Search for the module you need and install it from there.
  2. Use pip : In the Shell tab, run pip install module-name-here.
  3. Use poetry : In the Shell tab, run poetry add module-name-here.
May 13, 2023

How do I import a Python module into Windows? ›

Below are some of the steps by which we can follow to install a Python module with pip in Windows:
  1. Step 1: Open the Command Prompt.
  2. Step 2: Installing Python Modules with Pip.
  3. Step 3: Verifying Module Installation.
  4. Upgrade Python Modules.
  5. Uninstall Python Modules.
  6. Install Python Modules from Other resource.
May 28, 2024

How do I add a Python package to a path in Windows? ›

Add Python to Windows Path
  1. Step 1: Locate Python Installation. ...
  2. Step 2: Verify Python Installation. ...
  3. Step 3: Add Python to Path as an Environmental Variable. ...
  4. Step 4: Add Python Path to User Environmental Variables. ...
  5. Step 5: Check if the Environment variable is set or not.
Dec 7, 2023

How do you import a Python package? ›

In Python, we can import modules from packages using the dot (.) operator. Now, if this module contains a function named select_difficulty() , we must use the full name to reference it.

How to install requests package in Python in Windows? ›

  1. To install the Requests module in Python, open your command prompt or terminal and run the command pip install requests.
  2. To install Requests in Python VSCode, you can open the integrated terminal in VSCode and run the command pip install requests.
  3. No, Requests is not a built-in Python library.
May 9, 2024

Top Articles
Top 17 Cryptos With the Most Potential in 2023
What is the Point of a Metal Credit Card?
Funny Roblox Id Codes 2023
Restaurer Triple Vitrage
Combat level
Lamb Funeral Home Obituaries Columbus Ga
The Potter Enterprise from Coudersport, Pennsylvania
Kristine Leahy Spouse
Tx Rrc Drilling Permit Query
Apnetv.con
Ogeechee Tech Blackboard
Edgar And Herschel Trivia Questions
Craigslist Greenville Craigslist
Syracuse Jr High Home Page
Best Nail Salon Rome Ga
Copart Atlanta South Ga
Craigslist Sparta Nj
Craigslist Pinellas County Rentals
Danforth's Port Jefferson
Forest Biome
Masterkyngmash
67-72 Chevy Truck Parts Craigslist
Soulstone Survivors Igg
Www.dunkinbaskinrunsonyou.con
Drug Test 35765N
About My Father Showtimes Near Copper Creek 9
Jobs Hiring Near Me Part Time For 15 Year Olds
Tokyo Spa Memphis Reviews
14 Top-Rated Attractions & Things to Do in Medford, OR
Table To Formula Calculator
Ordensfrau: Der Tod ist die Geburt in ein Leben bei Gott
Franklin Villafuerte Osorio
Dtlr On 87Th Cottage Grove
Mrstryst
Workday Latech Edu
SF bay area cars & trucks "chevrolet 50" - craigslist
20 Best Things to Do in Thousand Oaks, CA - Travel Lens
Winco Money Order Hours
Has any non-Muslim here who read the Quran and unironically ENJOYED it?
Registrar Lls
Clima De 10 Días Para 60120
Sofia Franklyn Leaks
Ghareeb Nawaz Texas Menu
Deezy Jamaican Food
Willkommen an der Uni Würzburg | WueStart
Runelite Ground Markers
Strange World Showtimes Near Century Federal Way
Subdomain Finer
Convert Celsius to Kelvin
Bomgas Cams
Law Students
Vt Craiglist
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5816

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.