差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン | 最新のリビジョン両方とも次のリビジョン | ||
python:venv [2020/04/06 08:33] – [Linux] ともやん | python:venv [2023/02/10 12:38] – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | < | ||
- | #result pre { | ||
- | height: 200px; | ||
- | overflow: scroll; | ||
- | overflow-x: hidden; | ||
- | } | ||
- | </ | ||
- | </ | ||
====== Python venv 仮想環境 ====== | ====== Python venv 仮想環境 ====== | ||
行 94: | 行 85: | ||
</ | </ | ||
+ | ===== トラブルシューティング ===== | ||
+ | |||
+ | ==== 仮想環境で ModuleNotFoundError: | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | (pyJupyterLab) $ pip freeze | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Traceback (most recent call last): | ||
+ | File "/ | ||
+ | from pip._internal.cli.main import main | ||
+ | ModuleNotFoundError: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Python 3.10.6 で作った仮想環境だが、現在の Python バージョンは 3.11.1 である😢\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | (pyJupyterLab) $ cat pyvenv.cfg | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | home = /usr/bin | ||
+ | include-system-site-packages = false | ||
+ | version = 3.10.6 | ||
+ | </ | ||
+ | <WRAP color_command>< | ||
+ | (pyJupyterLab) $ python -V | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Python 3.11.1 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | これで一先ず動作するが、何か影響が出る可能性もあるかも...😅\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | (pyJupyterLab) $ cd lib | ||
+ | (pyJupyterLab) $ ln -s python3.10/ python3.11 | ||
+ | (pyJupyterLab) $ ll | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | 合計 4 | ||
+ | drwxr-xr-x 1 tomoyan tomoyan 26 5月 21 2022 python3.10 | ||
+ | lrwxrwxrwx 1 tomoyan tomoyan 11 2月 10 12:28 python3.11 -> python3.10/ | ||
+ | drwxr-xr-x 1 tomoyan tomoyan 26 7月 6 2021 python3.9 | ||
+ | </ | ||
+ | <WRAP color_command>< | ||
+ | (pyJupyterLab) $ pip freeze | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | aiohttp==3.8.1 | ||
+ | aiosignal==1.2.0 | ||
+ | anyio==3.6.1 | ||
+ | ... | ||
+ | </ | ||
+ | </ | ||