次の問題を解決できません: 私の研究では、Google Colabノートブックを使用してデータ分析を実行したいと考えています。この目的のために、condaを使用してのみインストールできるパッケージ ( cantera )が必要です。私はこれを行うことができますが、colab ノートブックを起動するたびに、すべてのパッケージを再インストールする必要があり、これには多くの時間がかかります。私はこれを避けたいので、このリンクで説明されている手順に従いました: https://dvij-kalaria.medium.com/how-to-make-load-save-a-conda-environment-in-google-colab-jupyter -322801aad486 .
目標は次のとおりです。
- 必要なすべてのパッケージを含む環境を一度に作成します。[create_environment.ipynb]
- これらのパッケージを .zip で Google ドライブにエクスポートします。
- パッケージを含む .zip ファイルを新しい colab ノートブックに抽出します。[メインファイル]
- 目的のパッケージでノートブックを実行します。
これらの手順に従うと、エラーが表示されます。
CanteraError Traceback (most recent call last)
<ipython-input-5-9ed24c0ae5c4> in <module>()
1 import cantera as ct
----> 2 gas = ct.Solution('gri30.cti')
3
4 # Set reactants state
5 gas.TPX = 298, 101325, 'CH4:1, O2:2'
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase.__cinit__()
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase._init_cti_xml()
CanteraError:
***********************************************************************
CanteraError thrown by call_ctml_writer:
Error converting input file "/usr/local/lib/python3.7/site-packages/cantera/data/gri30.cti" to CTML.
Python command was: '/usr/bin/python3'
The exit code was: 1
-------------- start of converter log --------------
sys.path: ['', '/env/python', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages']
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
ModuleNotFoundError: No module named 'cantera'
--------------- end of converter log ---------------
***********************************************************************
一方、次を含むコードセルを実行すると:
!pip show cantera
次の出力が得られます。
Version: 2.5.1
Summary: The Cantera Python Interface
Home-page: https://cantera.org
Author: Raymond Speth
Author-email: speth@mit.edu
License: UNKNOWN
Location: /usr/local/lib/python3.7/site-packages
Requires:
Required-by:
cantera パッケージが見つかったことを示します。
問題を再現するためのファイル (.ipynb) は、私の Github ページ: files.zipにあります。
誰かがこれについて私を助けてくれることを本当に願っています!