Installation problem-cannot import pymc

Hi all, i installed pymc with conda create -c conda-forge -n pymc_env “pymc>=5” (window11), while i got the following error “UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xba in position 2367: illegal multibyte sequence” when i import pymc.
Anyone knows how to fix this? Thanks a lot.

Traceback (most recent call last):

Cell In[1], line 1
import pymc as pm

File ~\anaconda3\envs\pymc_env\Lib\site-packages\pymc_init_.py:49
from pymc import _version, gp, ode, sampling

File ~\anaconda3\envs\pymc_env\Lib\site-packages\pymc\gp_init_.py:15
from pymc.gp import cov, mean, util

File ~\anaconda3\envs\pymc_env\Lib\site-packages\pymc\gp\cov.py:51
from pymc.pytensorf import constant_fold

File ~\anaconda3\envs\pymc_env\Lib\site-packages\pymc\pytensorf.py:66
from pymc.util import makeiter

File ~\anaconda3\envs\pymc_env\Lib\site-packages\pymc\util.py:20
import arviz

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz_init_.py:33
from .data import *

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\data_init_.py:2
from .base import CoordSpec, DimSpec, dict_to_dataset, numpy_to_data_array

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\data\base.py:20
from … import version, utils

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\utils.py:667
class HtmlTemplate:

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\utils.py:692 in HtmlTemplate
_, css_style = _load_static_files() # pylint: disable=protected-access

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\utils.py:662 in _load_static_files
return [

File ~\anaconda3\envs\pymc_env\Lib\site-packages\arviz\utils.py:663 in
importlib.resources.files(“arviz”).joinpath(fname).read_text() for fname in STATIC_FILES

File ~\anaconda3\envs\pymc_env\Lib\pathlib.py:1059 in read_text
return f.read()

Seems like an arviz error. Perhaps best to open an issue on their GitHub repo

thanks

Sounds like this issue: UnicodeDecodeError when i import arivz · Issue #2274 · arviz-devs/arviz · GitHub

As suggested, reinstalled the pymc with the arviz 0.15.1, i got another error “ImportError: DLL load failed while importing _imaging:”
Traceback (most recent call last):

Cell In[1], line 1
import pymc as pm

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\pymc_init_.py:49
from pymc import _version, gp, ode, sampling

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\pymc\gp_init_.py:15
from pymc.gp import cov, mean, util

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\pymc\gp\cov.py:51
from pymc.pytensorf import constant_fold

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\pymc\pytensorf.py:66
from pymc.util import makeiter

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\pymc\util.py:20
import arviz

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\arviz_init_.py:8
from matplotlib.colors import LinearSegmentedColormap

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\matplotlib_init_.py:161
from . import _api, _version, cbook, _docstring, rcsetup

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\matplotlib\rcsetup.py:27
from matplotlib.colors import Colormap, is_color_like

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\matplotlib\colors.py:52
from PIL import Image

File ~\anaconda3\envs\pymc_env_2312\Lib\site-packages\PIL\Image.py:103
from . import _imaging as core

solved by changing the version of Pillow

1 Like