In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install python requests library offline. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
1. Download the installation package 1.1 Check the dependency packages required by the requests module
Check what dependencies the requests module requires on a machine that has Internet access and Python installed. If these dependencies are not installed, you cannot use them by installing requests directly.
Use the command:
pip show requests
Found need chardet, idna, urllib3, certifi
Check if these packages are installed, and if not, install them manually.
1.2 Download required dependencies for requests
Find the appropriate program on https://www.lfd.uci.edu/~gohlke/pythonlibs, download and transfer to the target machine.
1.3 Download the requests package
Download the requests source package from github and transfer it to the target machine.
https://github.com/kennethreitz/requests
Unzip requests-master.zip into the python installation directory
2. Install 2.1 Dependent packages required to install requests
Install command for
pip install xx.whl
The last one in the figure below is a normal installation success, and the first three have error messages, which are temporarily ignored because they have not affected the installation of requests after verification.
D:\python-lib>pip install urllib3-1.26.8-py2.py3-none-any.whlProcessing d:\python-lib\urllib3-1.26.8-py2.py3-none-any.whlInstalling collected packages: urllib3ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts. We recommend you use --use-feature=2020-resolver to test your packages with thenew resolver before it becomes the default. requests 2.25.1 requires certifi>=2017.4.17, which is not installed.requests 2.25.1 requires chardet=3.0.2, which is not installed.requests 2.25.1 requires idna=2.5, which is not installed.Successfully installed urllib3-1.26.8 D:\python-lib>pip install chardet-4.0.0-py3-none-any.whlProcessing d:\python-lib\chardet-4.0.0-py3-none-any.whlInstalling collected packages: chardetERROR: After October 2020 you may experience errors when installing or updatingpackages. This is because pip will change the way that it resolves dependency conflicts. We recommend you use --use-feature=2020-resolver to test your packages with thenew resolver before it becomes the default. requests 2.25.1 requires certifi>=2017.4.17, which is not installed.requests 2.25.1 requires idna=2.5, which is not installed.Successfully installed chardet-4.0.0 D:\python-lib>pip install certifi-2019.11.28-py2.py3-none-any.whlProcessing d:\python-lib\certifi-2019.11.28-py2.py3-none-any.whlInstalling collected packages: certifiERROR: After October 2020 you may experience errors when installing or updatingpackages. This is because pip will change the way that it resolves dependency conflicts. We recommend you use --use-feature=2020-resolver to test your packages with thenew resolver before it becomes the default. requests 2.25.1 requests idna=2.5, which is not installed.Successfully installed certifi-2019.11.28 D:\python-lib>pip install idna-2.8-py2.py3-none-any.whlProcessing d:\python-lib\idna-2.8-py2.py3-none-any.whlInstalling collected packages: idnaSuccessfully installed idna-2.8 D:\python-lib>2.2 install requests
Open cmd in the extracted equests-master directory (or switch directories to this path in cmd)
Enter command to start installation
python setup.py install3, Check whether the installation is successful
Use import requests in python to view
Thank you for reading! About "how to install python requests library offline" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.