webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

メルカリのAPIのようなwrapper「mercari」のインストール

カテゴリ: Python【初歩から現場実務的なもの】

メルカリのAPIのようなwrapper「mercari」のインストールについて解説しています。

「mercari(https://github.com/marvinody/mercari/)」は、メルカリのシンプルなAPI wrapperです。

■Python

今回のPythonのバージョンは、「3.9.13」を使用しています。(Windows10)(pythonランチャーでの確認)

■mercariをインストールする

mercariをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install mercari

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.9.13にインストールを行うために、バージョンの切り替えを行います。

py -3.9 -m pip install mercari

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable

Collecting mercari

Downloading mercari-1.0.2.tar.gz (5.0 kB)

Preparing metadata (setup.py) ... done

Collecting asn1==2.4.1

Downloading asn1-2.4.1-py2.py3-none-any.whl (9.4 kB)

Collecting autopep8==1.5.7

Downloading autopep8-1.5.7-py2.py3-none-any.whl (45 kB)

---------------------------------------- 45.0/45.0 KB 740.6 kB/s eta 0:00:00

Collecting certifi==2021.5.30

Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)

Collecting cffi==1.14.6

Downloading cffi-1.14.6-cp39-cp39-win_amd64.whl (180 kB)

---------------------------------------- 180.3/180.3 KB 1.4 MB/s eta 0:00:00

Collecting charset-normalizer==2.0.6

Downloading charset_normalizer-2.0.6-py3-none-any.whl (37 kB)

Collecting cryptography==35.0.0

Downloading cryptography-35.0.0-cp36-abi3-win_amd64.whl (2.1 MB)

---------------------------------------- 2.1/2.1 MB 1.9 MB/s eta 0:00:00

Collecting enum-compat==0.0.3

Downloading enum_compat-0.0.3-py3-none-any.whl (1.3 kB)

Collecting idna==3.2

Using cached idna-3.2-py3-none-any.whl (59 kB)

Collecting pycodestyle==2.7.0

Downloading pycodestyle-2.7.0-py2.py3-none-any.whl (41 kB)

---------------------------------------- 41.7/41.7 KB 2.1 MB/s eta 0:00:00

Collecting pycparser==2.20

Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)

Collecting requests==2.26.0

Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)

Collecting toml==0.10.2

Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)

Collecting urllib3==1.26.7

Using cached urllib3-1.26.7-py2.py3-none-any.whl (138 kB)

Using legacy 'setup.py install' for mercari, since package 'wheel' is not installed.

Installing collected packages: enum-compat, certifi, urllib3, toml, pycparser, pycodestyle, idna, charset-normalizer, asn1, requests, cffi, autopep8, cryptography, mercari

WARNING: The script pycodestyle.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

WARNING: The script normalizer.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

WARNING: The script autopep8.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Running setup.py install for mercari ... done

Successfully installed asn1-2.4.1 autopep8-1.5.7 certifi-2021.5.30 cffi-1.14.6 charset-normalizer-2.0.6 cryptography-35.0.0 enum-compat-0.0.3 idna-3.2 mercari-1.0.2 pycodestyle-2.7.0 pycparser-2.20 requests-2.26.0 toml-0.10.2 urllib3-1.26.7

WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.

You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、mercariが正常にインストールされたことになります。

なお、今回はmercariのバージョン1.0.2をインストールしました。