How to Install msrest in Python
AutoRest swagger generator Python client runtime.
pip install msrest
What is msrest?
AutoRest swagger generator Python client runtime.
- Declare correctly msrest as Python 3.6 and more only for clarity #251
- Add as installation requirement #247 - Replace and in with those in #247
- Typing annotation in LROPoller (thanks to akx) #242
Quick Start
Minimal example to get started with msrest:
import msrest
print(msrest.__version__)
Installation
pip (standard)
pip install msrest
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install msrest
pip3
pip3 install msrest
conda
conda install -c conda-forge msrest
Poetry
poetry add msrest
Dependencies
Installing msrest will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import msrest; print(msrest.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing msrest with pip.
ModuleNotFoundError: No module named 'msrest'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install msrest. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'msrest' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install msrest to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'msrest'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show msrest and upgrade with pip install --upgrade msrest.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install msrest. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user msrest
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org msrest
Recent Releases
| Version | Released |
|---|---|
0.7.1 latest |
2022-06-13 |
0.7.0 |
2022-06-07 |
0.6.21 |
2021-01-27 |
0.6.20 |
2021-01-26 |
0.6.19 |
2020-09-08 |
Manage msrest
Upgrade to latest version
pip install --upgrade msrest
Install a specific version
pip install msrest==0.7.1
Uninstall
pip uninstall msrest
Check what is installed
pip show msrest