python:pip

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:pip [2024/03/16 12:05] – [pip オプション一覧] ともやんpython:pip [2024/03/28 01:58] (現在) – [仮想環境の pip を最新版に更新する場合] ともやん
行 500: 行 500:
 以下は 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 -*-
行 654: 行 653:
         _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 -*-
行 675: 行 674:
 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>
  
行 823: 行 824:
  
 === ディストリビューションの 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
行 847: 行 858:
 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
行 887: 行 910:
       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
 ---------- -------- --------- ----- ---------- -------- --------- -----
行 906: 行 936:
 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 pipinstead of running pip directly. +To avoid this problem you can invoke Python with &apos;-m pip&apos; instead of running pip directly. 
-pip 21.1.1 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7+pip 24.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.(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>&amp;&amp;</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>&amp;&amp;</b></font> <font color="#26A269">python</font> <font color="#A347BA">-m</font> pip <font color="#A347BA">-V</font> <font color="#12488B"><b>&amp;&amp;</b></font> <font color="#26A269">echo</font> <font color="#A2734C">&apos;---- ✂  ----&apos;</font> <font color="#12488B"><b>&amp;&amp;</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>
  
  • python/pip.1710558306.txt.gz
  • 最終更新: 2024/03/16 12:05
  • by ともやん