Study from the beginning of Python Hour8: Using packages

Study from the beginning of Python Hour8: Using packages

Learning materials

Past posts

environment

Purpose of using the package

Add an external package

Try installing the package

Install the requests package

C:\script>pip --version
pip 19.2.3 from c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)

C:\script>pip3 --version
pip 19.2.3 from c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)

C:\script>
C:\script>
C:\script>
C:\script>pip install requests #Only this command The following is a message((Although it is already installed)
Requirement already satisfied: requests in c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages (2.22.0)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages (from requests) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages (from requests) (2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages (from requests) (1.25.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\matsumo\appdata\local\programs\python\python38\lib\site-packages (from requests) (3.0.4)
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\script>

Try upgrading pip.

C:\script>python -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 3.3MB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2

C:\script>

Use the package

import requests

response = requests.get('http://www.nutanix.com/')
print (response.title)

Execution result. Get the page at www.nutanix.com

C:\Users\TatsuhiroMatsumoto\OneDrive - Nutanix\50_Training\@Python\script>test40_requests.py
<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <title>Nutanix Enterprise Cloud - Run Any Application at Any Scale</title>

Omitted below

How to find a library

This summary

For Quotations / Lightning Talk

Recommended Posts

Study from the beginning of Python Hour8: Using packages
Study from the beginning of Python Hour1: Hello World
Learning notes from the beginning of Python 1
Learning notes from the beginning of Python 2
Study from Python Hour4: Object-oriented ②
Study from Python Hour4: Object-oriented ①
Learn Nim with Python (from the beginning of the year).
First Python 3 ~ The beginning of repetition ~
Existence from the viewpoint of Python
Study from Python Hour2: Control statements
Study on Tokyo Rent Using Python (3-1 of 3)
Get the contents of git diff from python
Study from Python Hour7: How to use classes
Study from Python Reading and writing Hour9 files
Finding the beginning of Abenomics from NT magnification 2
Operate the schedule app using python from iphone
Try using the collections module (ChainMap) of python3
Find the geometric mean of n! Using Python
Finding the beginning of Abenomics from NT magnification 1
The beginning of cif2cell
the zen of Python
Using Python #external packages
The wall of changing the Django service from Python 2.7 to Python 3
Explanation of the concept of regression analysis using python Part 2
[Python] Get the text of the law from the e-GOV Law API
Cut a part of the string using a Python slice
Python --Explanation and usage summary of the top 24 packages
Mathematical understanding of principal component analysis from the beginning
Python points from the perspective of a C programmer
The pain of gRPC using Python. November 2019. (Personal memo)
DJango Note: From the beginning (using a generic view)
Explanation of the concept of regression analysis using Python Part 1
Explanation of the concept of regression analysis using Python Extra 1
A little bit from Python using the Jenkins API
Towards the retirement of Python2
About the ease of Python
python: Basics of using scikit-learn ①
About the features of Python
The Power of Pandas: Python
Control smart light "Yeelight" from Python without using the cloud
DJango Note: From the beginning (simplification and splitting of URLConf)
I tried using the Python library from Ruby with PyCall
Recursively copy files from the directory directly under the directory using Python
View using the python module of Nifty Cloud mobile backend
[Python] I tried collecting data using the API of wikipedia
What beginners learned from the basics of variables in python
How to know the number of GPUs from python ~ Notes on using multiprocessing with pytorch ~
The story of Python and the story of NaN
Image capture of firefox using python
[Python] The stumbling block of import
Using Rstan from Python with PypeR
Trial of voice recognition using Azure with Python (input from microphone)
[Python] Try to graph from the image of Ring Fit [OCR]
Removal of haze using Python detailEnhanceFilter
Proper use of Python visualization packages
DJango Memo: From the beginning (preparation)
[Python] LINE notification of the latest information using Twitter automatic search
pyenv-change the python version of virtualenv
I want to output the beginning of the next month with Python
Operate Maya from an external Python interpreter using the rpyc module
Change the Python version of Homebrew