Pip Configuration on Windows
Overview
The pip user guide (https://pip.pypa.io/en/stable/user_guide/#config-file) states that the pip.ini configuration file is not supported on Windows. However, this guide provides instructions on how to create and activate a virtual environment using the standard library's venv module.
Importance of Virtual Environments
Virtual environments are isolated Python environments that allow you to manage different versions of Python packages for different projects without affecting the global Python environment.
Creating a Virtual Environment
To create a virtual environment on Windows, open a command prompt and run the following command:
python -m venv my_venv
Replace "my_venv" with the desired name of your virtual environment.
Activating a Virtual Environment
To activate a virtual environment, run the following command:
.\my_venv\Scripts\activate
Replace "my_venv" with the name of your virtual environment.
Additional Notes
On Unix and macOS, the configuration file is located at:
~/.config/pip/pip.conf
On Windows, the configuration file is located at:
%APPDATA%\pip\pip.ini
In older versions of pip, it was possible to install a package that did not satisfy the declared requirements. This is not recommended, and it is better to use the `--require-hashes` option to ensure that the installed package matches the requirements.
Comments