You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project that uses pyam and IamDataFrame and I'm having trouble getting a reliable install with conda.
The demo below shows the .yml file used to make a simple environment with only pyam included and the 1-liner import fails with the shown error trace. I'm running on MacOS.
Am I missing something or ? I'm not a regular conda user, but this project requires it.
import pyam
print('hello')
t = pyam.IamDataFrame('test')
Error trace:
Traceback (most recent call last):
File "/Users/jeff/PycharmProjects/pyam_test/main.py", line 5, in <module>
import pyam
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/pyam/__init__.py", line 3, in <module>
from pyam.core import (
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/pyam/core.py", line 9, in <module>
import ixmp4
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/__init__.py", line 4, in <module>
from ixmp4.core import Model as Model
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/core/__init__.py", line 2, in <module>
from .iamc.variable import Variable as Variable
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/core/iamc/__init__.py", line 3, in <module>
from .data import RunIamcData, PlatformIamcData
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/core/iamc/data.py", line 9, in <module>
from ixmp4.data.backend import Backend
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/data/backend/__init__.py", line 3, in <module>
from .api import RestBackend, RestTestBackend
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/data/backend/api.py", line 26, in <module>
from ixmp4.server import app, v1
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/server/__init__.py", line 16, in <module>
from .rest import v1
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/server/rest/__init__.py", line 11, in <module>
from . import deps, docs, meta, model, region, run, scenario, unit
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/server/rest/deps.py", line 15, in <module>
manager = ManagerConfig(
^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/ixmp4/conf/manager.py", line 54, in __init__
self.client = httpx.Client(
^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pyam_test/lib/python3.12/site-packages/httpx/_client.py", line 669, in __init__
raise ImportError(
ImportError: Using http2=True, but the 'h2' package is not installed. Make sure to install httpx using `pip install httpx[http2]`.
Hi @jeff-ws, sorry for the late reply! Do you still face this issue or have you found a workaround?
If I understand this issue correctly, this is caused by pyam relying on ixmp4, which needs httpx, but with the http2 extra. Unfortunately, we use a pyproject.toml file to manage ixmp4, where we can list extras like this, which pip and similar tools can easily understand, but conda can't. Incidentally, this is one of the reasons we try to avoid it and I would recommend you do the same if at all possible.
If you want to use conda regardless, I think your only option is to keep installing missing packages until things work. In your case, the last line of the error message states that the packages h2 is missing. So you could go to conda forge and search for it and find the command to install it: conda install conda-forge::h2, to be run on an anaconda command line with your conda environment active.
Afterwards, this issue should be gone, but new ones might come up due to conda's limitations.
Hello-
I'm working on a project that uses
pyam
andIamDataFrame
and I'm having trouble getting a reliable install withconda
.The demo below shows the
.yml
file used to make a simple environment with onlypyam
included and the 1-liner import fails with the shown error trace. I'm running on MacOS.Am I missing something or ? I'm not a regular
conda
user, but this project requires it.conda env file used to creat environment:
test file:
Error trace:
The environment list:
The text was updated successfully, but these errors were encountered: