|  両方とも前のリビジョン 前のリビジョン 次のリビジョン |  前のリビジョン | 
| python:pip [2023/05/18 09:36]  – [pip オプション一覧]  ともやん | python:pip [2024/03/28 01:58] (現在)  – [仮想環境の pip を最新版に更新する場合]  ともやん | 
|---|
|   <style> |   <style> | 
|     div.pip_option_list .col0 { |     div.pip_option_list .col0 { | 
|       width: 30%; |       width: 50%;  | 
|   |     }  | 
|   |     div.pip_option_list pre {  | 
|   |       min-width: unset; | 
|     } |     } | 
|   </style> |   </style> | 
| |<WRAP color_term> | |<WRAP color_term> | 
| <WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pip</b> freeze > requirements.txt | <WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pip</b> freeze > requirements.txt | 
|   | <b class=GRN>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip install <b class=HIK>-U</b> pip | 
| <b class=GRN>$</b> <b class=HIY>pip</b> install <b class=HIK>-r</b> requirements.txt</pre></html></WRAP> | <b class=GRN>$</b> <b class=HIY>pip</b> install <b class=HIK>-r</b> requirements.txt</pre></html></WRAP> | 
| </WRAP> |venv などの環境を複製する。  | | </WRAP> |venv などの環境を複製する。  | | 
| |<WRAP color_term> | |<WRAP color_term> | 
| <WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pip</b> freeze > requirements.txt  | <WRAP color_command><html><pre>  | 
| <b class=GRN>$</b> <b class=HIY>pip</b> uninstall <b class=HIK>-r</b> requirements.txt <b class=HIK>-y</b></pre></html></WRAP><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pip</b> freeze | <b class=HIY>xargs</b> pip uninstall <b class=HIK>-y</b></pre></html></WRAP><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pip</b> freeze | <b class=HIY>grep</b> <b class=HIK>-v</b> "^-e" | <b class=HIY>xargs</b> pip uninstall <b class=HIK>-y</b></pre></html></WRAP> | <b class=GRN>$</b> <b class=HIY>pip</b> freeze > requirements.txt  | 
|   | <b class=GRN>$</b> <b class=HIY>pip</b> uninstall <b class=HIK>-r</b> requirements.txt <b class=HIK>-y</b>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <b class=GRN>$</b> <b class=HIY>pip</b> freeze | <b class=HIY>xargs</b> pip uninstall <b class=HIK>-y</b>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <b class=GRN>$</b> <b class=HIY>pip</b> freeze | <b class=HIY>grep</b> <b class=HIK>-v</b> "^-e" | <b class=HIY>xargs</b> pip uninstall <b class=HIK>-y</b>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">pip</font> freeze <font color="#A347BA">--user</font> <font color="#12488B"><b>|</b></font> <font color="#26A269">grep</font> <font color="#A347BA">-v</font> <font color="#A2734C">"^-e"</font> <font color="#12488B"><b>|</b></font> <font color="#26A269">cut</font> <font color="#A347BA">-f</font> 1 <font color="#A347BA">-d</font> <font color="#A2734C">'='</font> <font color="#12488B"><b>|</b></font> <font color="#26A269">xargs</font> pip uninstall <font color="#A347BA">-y</font>  | 
|   | </pre></html></WRAP> | 
| </WRAP> |全パッケージを確認なしでアンインストールする。  | | </WRAP> |全パッケージを確認なしでアンインストールする。  | | 
| |<WRAP color_term> | |<WRAP color_term> | 
| <WRAP color_term> | <WRAP color_term> | 
| <WRAP color_command><html><pre> | <WRAP color_command><html><pre> | 
| <b class=GRM>$</b> <b class=HIY>pip</b> <b class=DiYE>-> Tab キーを押す</b> | <b class=GRN>$</b> <b class=HIY>pip</b> <b class=DiYE>-> Tab キーを押す</b> | 
| </pre></html></WRAP> | </pre></html></WRAP> | 
| <WRAP color_result><html><pre> | <WRAP color_result><html><pre> | 
| pip             pip-3.11        pip3.11         pipewire        pipewire-avb     | pip             pip-3.11        pip3.11         pipewire        pipewire-avb     | 
| pip-3           pip3            pipetty         pipewire-aes67  pipewire-pulse | pip-3           pip3            pipetty         pipewire-aes67  pipewire-pulse | 
|   | </pre></html></WRAP> | 
|   | </WRAP> | 
|   |  | 
|   | pip のコマンド補完を zsh に設定する🤔\\ | 
|   | <WRAP color_term> | 
|   | <WRAP color_command><html><pre> | 
|   | <b class=GRN>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip completion <b class=HIK>--zsh</b> | 
|   | </pre></html></WRAP> | 
|   | <WRAP color_mincode><code bash> | 
|   |  | 
|   | # pip zsh completion start | 
|   | function _pip_completion { | 
|   |   local words cword | 
|   |   read -Ac words | 
|   |   read -cn cword | 
|   |   reply=( $( COMP_WORDS="$words[*]" \ | 
|   |              COMP_CWORD=$(( cword-1 )) \ | 
|   |              PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )) | 
|   | } | 
|   | compctl -K _pip_completion /usr/bin/python -m pip | 
|   | # pip zsh completion end | 
|   |  | 
|   | </code></WRAP> | 
|   | <WRAP color_command><html><pre> | 
|   | <b class=GRN>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip completion <b class=HIK>--zsh</b> >> ~/.zprofile | 
|   | <b class=GRN>$</b> <b class=HIY>.</b> ~/.zprofile  | 
| </pre></html></WRAP> | </pre></html></WRAP> | 
| </WRAP> | </WRAP> | 
| <WRAP color_term> | <WRAP color_term> | 
| <WRAP color_command><html><pre> | <WRAP color_command><html><pre> | 
| <b class=GRM>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip completion <b class=HIK>--bash</b> >> ~/.profile  | <b class=GRN>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip completion <b class=HIK>--bash</b>  | 
| <b class=GRM>$</b> <b class=HIY>.</b> ~/.profile  | </pre></html></WRAP>  | 
|   | <WRAP color_mincode><code bash>  | 
|   |   | 
|   | # pip bash completion start  | 
|   | _pip_completion()  | 
|   | {  | 
|   |     COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \  | 
|   |                    COMP_CWORD=$COMP_CWORD \  | 
|   |                    PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) )  | 
|   | }  | 
|   | complete -o default -F _pip_completion /usr/bin/python -m pip  | 
|   | # pip bash completion end  | 
|   |   | 
|   | </code></WRAP>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <b class=GRN>$</b> <b class=HIY>python</b> <b class=HIK>-m</b> pip completion <b class=HIK>--bash</b> >> ~/.profile  | 
|   | <b class=GRN>$</b> <b class=HIY>.</b> ~/.profile  | 
| </pre></html></WRAP> | </pre></html></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
| pip のコマンド補完が効くようになる😍\\ | <html><code>"pip "</code></html>(pip のあとにスペースを1つ TAB キーを入力) pip のコマンド補完が効くようになる😍\\  | 
|   | zsh の場合\\ | 
| <WRAP color_term> | <WRAP color_term> | 
| <WRAP color_command><html><pre> | <WRAP color_command><html><pre> | 
| <b class=GRM>$</b> <b class=HIY>pip</b> <b class=DiYE>-> Tab キーを押す</b> | <div class=BSc><b class=DKO>┌──(<b class="BOLD ORR">tomoyan  WICKED-BEAT</b>)-[</b>~<b style="color: darkorange">]</b>  | 
|   | <b class=DKO>└─</b><b class=ORR>$</b> <b class=HIY>pip</b> <b class=DiYE>-> Tab キーを押す</b>  | 
|   | </div>check      -- verify installed packages have compatible dependencies  | 
|   | download   -- download packages  | 
|   | freeze     -- output installed packages in requirements format  | 
|   | hash       -- compute hashes of package archives  | 
|   | help       -- show available commands  | 
|   | install    -- install packages  | 
|   | list       -- list installed packages  | 
|   | search     -- search PyPI for packages  | 
|   | show       -- show information about installed packages  | 
|   | uninstall  -- uninstall packages  | 
|   | wheel      -- build wheels from your requirements | 
| </pre></html></WRAP> | </pre></html></WRAP> | 
| <WRAP color_result><html><pre> | </WRAP>  | 
|   |   | 
|   | bash の場合\\  | 
|   | <WRAP color_term>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <b class=GRN>$</b> <b class=HIY>pip</b> <b class=DiYE>-> Tab キーを押す</b> | 
| cache       completion  debug       freeze      help        inspect     list        show        wheel | cache       completion  debug       freeze      help        inspect     list        show        wheel | 
| check       config      download    hash        index       install     search      uninstall    | check       config      download    hash        index       install     search      uninstall    | 
| ~/.cache/pip | ~/.cache/pip | 
| </code> | </code> | 
|   |  | 
|   | <WRAP color_term> | 
|   | <WRAP color_command><html><pre> | 
|   | <span style="color:#FF8700"><b>$</b></span> <span style="color:#26A269">pip3</span> cache info | 
|   | </pre></html></WRAP> | 
|   | <WRAP color_result><html><pre> | 
|   | Package index page cache location: /home/tomoyan/.cache/pip/http | 
|   | Package index page cache size: 905.6 MB | 
|   | Number of HTTP files: 976 | 
|   | Locally built wheels location: /home/tomoyan/.cache/pip/wheels | 
|   | Locally built wheels size: 482 kB | 
|   | Number of locally built wheels: 4 | 
|   | </pre></html></WRAP> | 
|   | </WRAP> | 
 |  | 
| ==== Mac ==== | ==== Mac ==== | 
| 以下は pip パッケージを利用した HTTP URL のダウンローダーのコードである。\\ | 以下は pip パッケージを利用した HTTP URL のダウンローダーのコードである。\\ | 
| この **download_http_url()** 関数を利用すれば、パッケージではない様々なファイルを pip と同様に進行状況を表示しながらダウンロードする事ができる。\\ | この **download_http_url()** 関数を利用すれば、パッケージではない様々なファイルを pip と同様に進行状況を表示しながらダウンロードする事ができる。\\ | 
| \\   | <WRAP color_term>  | 
| <WRAP prewrap 100% #mincode_long>  | <WRAP color_mincode_long><code python pip_downloader.py> | 
| <code python pip_downloader.py> |  | 
| #!/usr/bin/env python3 | #!/usr/bin/env python3 | 
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | 
|         _download_url(resp, link, content_file, hashes, progress_bar) |         _download_url(resp, link, content_file, hashes, progress_bar) | 
|     return file_path, content_type |     return file_path, content_type | 
| </code> | </code></WRAP> | 
| </WRAP> | </WRAP> | 
| pip_downloader.py の使い方。\\ | pip_downloader.py の使い方。\\ | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <file python main.py> | <WRAP color_mincode><file python main.py> | 
| #!/usr/bin/env python3 | #!/usr/bin/env python3 | 
| ## -*- coding: utf-8 -*- | ## -*- coding: utf-8 -*- | 
| if __name__ == "__main__": | if __name__ == "__main__": | 
|     main() |     main() | 
| </file> | </file></WRAP> | 
| </WRAP> | </WRAP> | 
| main.py 実行する。\\ | main.py 実行する。\\ | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <code> | <WRAP color_command><code> | 
| > python main.py | > python main.py | 
|   | </code></WRAP> | 
|   | <WRAP color_result><code> | 
| Downloading https://download.visualstudio.microsoft.com/download/pr/7b196ac4-65a9-4fde-b720-09b5339dbaba/78df39539625fa4e6c781c6a2aca7b4f/vs_community.exe (1.3MB) | Downloading https://download.visualstudio.microsoft.com/download/pr/7b196ac4-65a9-4fde-b720-09b5339dbaba/78df39539625fa4e6c781c6a2aca7b4f/vs_community.exe (1.3MB) | 
| Downloading from URL https://download.visualstudio.microsoft.com/download/pr/7b196ac4-65a9-4fde-b720-09b5339dbaba/78df39539625fa4e6c781c6a2aca7b4f/vs_community.exe | Downloading from URL https://download.visualstudio.microsoft.com/download/pr/7b196ac4-65a9-4fde-b720-09b5339dbaba/78df39539625fa4e6c781c6a2aca7b4f/vs_community.exe | 
|    |████████████████████████████████| 1.4MB 3.3MB/s |    |████████████████████████████████| 1.4MB 3.3MB/s | 
| </code> | </code></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
 |  | 
| === ディストリビューションの pip を最新版に更新する場合 === | === ディストリビューションの pip を最新版に更新する場合 === | 
| <code>  | <WRAP color_term>  | 
| $ python3 -m pip -V | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python3</font> <font color="#A347BA">-m</font> pip <font color="#A347BA">-V</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><code> | 
| pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7) | pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7) | 
| </code> | </code></WRAP>  | 
|   | </WRAP> | 
 |  | 
| ディストリビューションの古い **python3-pip** パッケージだと不具合がある。\\ | ディストリビューションの古い **python3-pip** パッケージだと不具合がある。\\ | 
| <code>  | <WRAP color_term>  | 
| $ python3 -m pip list -v | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python3</font> <font color="#A347BA">-m</font> pip list <font color="#A347BA">-v</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><code> | 
| Package    Version Location                       Installer | Package    Version Location                       Installer | 
| ---------- ------- ------------------------------ --------- | ---------- ------- ------------------------------ --------- | 
| pip        18.1    /usr/lib/python3/dist-packages | pip        18.1    /usr/lib/python3/dist-packages | 
| setuptools 40.8.0  /usr/lib/python3/dist-packages | setuptools 40.8.0  /usr/lib/python3/dist-packages | 
| </code> | </code></WRAP>  | 
|   | </WRAP> | 
 |  | 
| pip を最新版に更新する。\\ | pip を最新版に更新する。\\ | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <code>  | <WRAP color_command><html><pre>  | 
| $ python3 -m pip install -U pip | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python3</font> <font color="#A347BA">-m</font> pip install <font color="#A347BA">-U</font> pip  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><code> | 
| Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple | Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple | 
| Collecting pip | Collecting pip | 
| Installing collected packages: pip | Installing collected packages: pip | 
| Successfully installed pip-21.1.1 | Successfully installed pip-21.1.1 | 
| </code> | </code></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
| **pip list -o** が正常に利用できることを確認する。\\ | **pip list -o** が正常に利用できることを確認する。\\ | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <code>  | <WRAP color_command><html><pre>  | 
| $ python3 -m pip list -o | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python3</font> <font color="#A347BA">-m</font> pip install <font color="#A347BA">-U</font> pip  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><code> | 
| Package    Version Latest Type | Package    Version Latest Type | 
| ---------- ------- ------ ----- | ---------- ------- ------ ----- | 
| setuptools 40.8.0  56.2.0 wheel | setuptools 40.8.0  56.2.0 wheel | 
| </code> | </code></WRAP>  | 
|   | </WRAP> | 
 |  | 
| <code>  | <WRAP color_term>  | 
| $ python3 -m pip list -v | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python3</font> <font color="#A347BA">-m</font> pip list <font color="#A347BA">-v</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><code> | 
| Package    Version Location                                         Installer | Package    Version Location                                         Installer | 
| ---------- ------- ------------------------------------------------ --------- | ---------- ------- ------------------------------------------------ --------- | 
| pip        21.1.1  /home/tomoyan/.local/lib/python3.7/site-packages pip | pip        21.1.1  /home/tomoyan/.local/lib/python3.7/site-packages pip | 
| setuptools 40.8.0  /usr/lib/python3/dist-packages | setuptools 40.8.0  /usr/lib/python3/dist-packages | 
| </code> | </code></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
| === 仮想環境の pip を最新版に更新する場合 === | === 仮想環境の pip を最新版に更新する場合 === | 
| <code>  | <WRAP color_term>  | 
| (py3_venv) $ pip -V | <WRAP color_command><html><pre>  | 
|   | (py3_venv) <font color="#FF8700"><b>$</b></font> <font color="#26A269">pip</font> <font color="#A347BA">-V</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre> | 
| pip 18.1 from /home/tomoyan/py3_venv/lib/python3.7/site-packages/pip (python 3.7) | pip 18.1 from /home/tomoyan/py3_venv/lib/python3.7/site-packages/pip (python 3.7) | 
| </code> | </pre></html></WRAP>  | 
|   | </WRAP> | 
 |  | 
| pip を最新版に更新する。\\ | pip を最新版に更新する。\\ | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <code>  | <WRAP color_command><html><pre>  | 
| (py3_venv) $ python -m pip install -U pip | (py3_venv) <font color="#FF8700"><b>$</b></font> <font color="#26A269">python</font> <font color="#A347BA">-m</font> pip install <font color="#A347BA">-U</font> pip  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre> | 
| Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple | Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple | 
| Collecting pip | Collecting pip | 
|       Successfully uninstalled pip-18.1 |       Successfully uninstalled pip-18.1 | 
| Successfully installed pip-21.1.1 | Successfully installed pip-21.1.1 | 
| </code> | </pre></html></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
| 更新後のバージョン確認。\\ | 更新後のバージョン確認。\\ | 
| <code>  | <WRAP color_term>  | 
| (py3_venv) $ pip -V | <WRAP color_command><html><pre>  | 
|   | (py3_venv) <font color="#FF8700"><b>$</b></font> <font color="#26A269">pip</font> <font color="#A347BA">-V</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre> | 
| pip 21.1.1 from /home/tomoyan/py3_venv/lib/python3.7/site-packages/pip (python 3.7) | pip 21.1.1 from /home/tomoyan/py3_venv/lib/python3.7/site-packages/pip (python 3.7) | 
| </code> | </pre></html></WRAP>  | 
|   | </WRAP> | 
 |  | 
| **pip list -o** が正常に利用できることを確認する。\\ | **pip list -o** が正常に利用できることを確認する。\\ | 
| <code>  | <WRAP color_term>  | 
| (py3_venv) $ pip list -o | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">pip</font> list <font color="#A347BA">-o</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre> | 
| Package    Version  Latest    Type | Package    Version  Latest    Type | 
| ---------- -------- --------- ----- | ---------- -------- --------- ----- | 
| supervisor 4.2.1    4.2.2     wheel | supervisor 4.2.1    4.2.2     wheel | 
| youtube-dl 2021.1.8 2021.4.26 wheel | youtube-dl 2021.1.8 2021.4.26 wheel | 
| </code>  | </pre></html></WRAP> | 
|   |  | 
| === システムの古い pip ラッパー📯が新しい pip モジュールを実行してしまう場合 ===  |  | 
| <WRAP prewrap 100%>  |  | 
| <code>  |  | 
| $ pip3 -V  |  | 
| </code> |  | 
| </WRAP> | </WRAP> | 
| <WRAP prewrap 100% #result>  |   | 
| <code> | ==== システムの古い pip ラッパー📯が新しい pip モジュールを実行してしまう場合🤔 ====  | 
|   | <WRAP color_term>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">pip</font> <font color="#A347BA">-V</font>  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre> | 
| WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. | WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. | 
| Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. | Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. | 
| To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.  | To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.  | 
| pip 21.1.1 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7)  | pip 24.0 from /home/tomoyan/.local/lib/python3.12/site-packages/pip (python 3.12)  | 
| </code>  | </pre></html></WRAP>  | 
| <code>  | <WRAP color_result><html><pre>  | 
| 警告: pip は古いスクリプトラッパーによって呼び出されています。これは、pip の将来のバージョンでは失敗します。 | 警告: pip は古いスクリプト ラッパーによって呼び出されています。これは、pip の将来のバージョンでは失敗します。 | 
| 根本的な問題を修正するためのアドバイスについては、https://github.com/pypa/pip/issues/5599 を参照してください。 | 根本的な問題を修正するためのアドバイスについては、https://github.com/pypa/pip/issues/5599 を参照してください。 | 
| この問題を回避するには、pipを直接実行する代わりに、「-m pip」を使用して Python を呼び出すことができます。  | この問題を回避するには、pip を直接実行する代わりに、「-m pip」を使用して Python を呼び出すことができます。  | 
| /home/pi/.local/lib/python3.7/site-packages/pip からの pip21.1.1 (python 3.7)  | /home/tomoyan/.local/lib/python3.12/site-packages/pip からの pip 24.0 (Python 3.12)  | 
| </code> | </pre></html></WRAP> | 
| </WRAP> | </WRAP> | 
| [[git>pypa/pip/issues/5599|ImportError in system pip wrappers after an upgrade · Issue #5599 · pypa/pip · GitHub]]\\ | [[git>pypa/pip/issues/5599|ImportError in system pip wrappers after an upgrade · Issue #5599 · pypa/pip · GitHub]]\\ | 
 |  | 
| 回避方法は pip のモジュールを直接実行する。\\  | 回避方法その1: pip のモジュールを直接実行する。\\  | 
| <WRAP prewrap 100%>  | <WRAP color_term>  | 
| <code>  | <WRAP color_command><html><pre>  | 
| $ python3 -m pip -V  | <font color="#FF8700"><b>$</b></font> <font color="#26A269">python</font> <font color="#A347BA">-m</font> pip <font color="#A347BA">-V</font>  | 
| </code> | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre>  | 
|   | pip 24.0 from /home/tomoyan/.local/lib/python3.12/site-packages/pip (python 3.12)  | 
|   | </pre></html></WRAP>  | 
|   | </WRAP>  | 
|   |   | 
|   | 解決の糸口😅\\  | 
|   | <WRAP color_term>  | 
|   | <WRAP color_command><html><pre>  | 
|   | <font color="#FF8700"><b>$</b></font> <font color="#26A269">which</font> pip <font color="#12488B"><b>&&</b></font> <font color="#26A269">python</font> <font color="#A347BA">-s</font> <font color="#A347BA">-m</font> pip <font color="#A347BA">-V</font> <font color="#12488B"><b>&&</b></font> <font color="#26A269">python</font> <font color="#A347BA">-m</font> pip <font color="#A347BA">-V</font> <font color="#12488B"><b>&&</b></font> <font color="#26A269">echo</font> <font color="#A2734C">'---- ✂  ----'</font> <font color="#12488B"><b>&&</b></font> <font color="#26A269">echo</font> $PATH <font color="#12488B"><b>|</b></font> <font color="#26A269">grep</font> :  | 
|   | </pre></html></WRAP>  | 
|   | <WRAP color_result><html><pre>  | 
|   | /usr/local/bin/pip  | 
|   | pip 23.2.1 from /usr/lib/python3.12/site-packages/pip (python 3.12)  | 
|   | pip 24.0 from /home/tomoyan/.local/lib/python3.12/site-packages/pip (python 3.12)  | 
|   | ---- ✂  ----  | 
|   | /home/tomoyan/miniforge3/condabin<font color="#C01C28"><b>:</b></font>/home/tomoyan/micromamba/bin<font color="#C01C28"><b>:</b></font>/home/tomoyan/.cargo/bin<font color="#C01C28"><b>:</b></font>/home/tomoyan/.anyenv/envs/nodenv/shims<font color="#C01C28"><b>:</b></font>/home/tomoyan/.anyenv/envs/nodenv/bin<font color="#C01C28"><b>:</b></font>/home/tomoyan/.anyenv/bin<font color="#C01C28"><b>:</b></font>/usr/local/bin<font color="#C01C28"><b>:</b></font>/usr/bin<font color="#C01C28"><b>:</b></font>/usr/local/sbin<font color="#C01C28"><b>:</b></font>/usr/sbin<font color="#C01C28"><b>:</b></font>/home/tomoyan/.local/bin<font color="#C01C28"><b>:</b></font>/home/tomoyan/.local/bin  | 
|   | </pre></html></WRAP> | 
| </WRAP> | </WRAP> | 
 |  | 
| ===== 参考文献 ===== | ===== 参考文献 ===== | 
|   | [[https://roman.pt/posts/optimize-pip-install-with-wheels/|Optimize pip install with wheels - Roman Imankulov]] [[gtr>https://roman.pt/posts/optimize-pip-install-with-wheels/|翻訳]]\\ | 
| [[https://pip.pypa.io/en/stable/|Home - pip documentation v21.1.1]]\\ | [[https://pip.pypa.io/en/stable/|Home - pip documentation v21.1.1]]\\ | 
| [[http://d.hatena.ne.jp/rudi/20110107/1294409385|pipの使い方 - そこはかとなく書くよ。]]\\ | [[http://d.hatena.ne.jp/rudi/20110107/1294409385|pipの使い方 - そこはかとなく書くよ。]]\\ | 
| [[so>questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available|Python and pip, list all versions of a package that's available?]]\\ | [[so>questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available|Python and pip, list all versions of a package that's available?]]\\ | 
| [[rtd>kurozumi.github.io/pip/user_guide.html|ユーザーガイド — pip 9.1.0.dev0 ドキュメント]]\\ | [[rtd>kurozumi.github.io/pip/user_guide.html|ユーザーガイド — pip 9.1.0.dev0 ドキュメント]]\\ | 
|   | [[https://packaging.python.org/en/latest/tutorials/installing-packages/|Installing Packages — Python Packaging User Guide]] [[gtr>https://packaging.python.org/en/latest/tutorials/installing-packages/|翻訳]]\\ |