No module named Cloudpickle

379 views
Skip to first unread message

Chungmin Han

unread,
Aug 29, 2022, 2:20:47 PM8/29/22
to hddm-users
Hello! 
I'm trying to use HDDM on Windows, so I followed 

this conversation, and managed to install hddm. 

However, when I import hddm, 

Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hddm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/hddm/__init__.py", line 8, in <module>
    from . import likelihoods
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/hddm/likelihoods.py", line 6, in <module>
    from kabuki.utils import stochastic_from_dist
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/kabuki/__init__.py", line 1, in <module>
    from .hierarchical import *
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/kabuki/hierarchical.py", line 4, in <module>
    import cloudpickle
ModuleNotFoundError: No module named 'cloudpickle'
>>> exit()
(prt_hddm) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip install cloudpickle
Requirement already satisfied: cloudpickle in ./prt_hddm/lib/python3.8/site-packages/cloudpickle-2.1.0-py3.8.egg (2.1.0)
(prt_hddm) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hddm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/hddm/__init__.py", line 8, in <module>
    from . import likelihoods
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/hddm/likelihoods.py", line 6, in <module>
    from kabuki.utils import stochastic_from_dist
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/kabuki/__init__.py", line 1, in <module>
    from .hierarchical import *
  File "/mnt/c/Users/owner/Ubuntu_pg/prt_hddm/lib/python3.8/site-packages/kabuki/hierarchical.py", line 4, in <module>
    import cloudpickle
ModuleNotFoundError: No module named 'cloudpickle'

cloudpickle is installed, but seems it's not recognizing from hddm package,
Any advice on this error? Help is greatly appreciated. 
Thank you

Jamie

Chungmin Han

unread,
Aug 30, 2022, 11:40:47 AM8/30/22
to hddm-users
Per Krishn's suggestion, I installed Anaconda and was able to install hddm. 
Some of the messages appeared because I already had packages installed from the previous attempt. 

If not called with pip3, Anaconda installs hddm 0.6.0 that links with python 2.7 instead. 

(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip3 install pandas
Collecting pandas
  Downloading pandas-1.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
     |████████████████████████████████| 11.7 MB 2.7 MB/s
Collecting pytz>=2020.1
  Using cached pytz-2022.2.1-py2.py3-none-any.whl (500 kB)
Collecting python-dateutil>=2.8.1
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Requirement already satisfied: numpy>=1.18.5; platform_machine != "aarch64" and platform_machine != "arm64" and python_version < "3.10" in /home/cmhan616/.local/lib/python3.8/site-packages (from pandas) (1.23.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.1->pandas) (1.14.0)
Installing collected packages: pytz, python-dateutil, pandas
Successfully installed pandas-1.4.3 python-dateutil-2.8.2 pytz-2022.2.1
(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip3 install pymc==2.3.8
Processing /home/cmhan616/.cache/pip/wheels/b3/ce/42/184615e76f166b582e83b8f04ac92d1c0f30e26cdbfd76cba9/pymc-2.3.8-cp38-cp38-linux_x86_64.whl
Installing collected packages: pymc
Successfully installed pymc-2.3.8
(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip3 install kabuki
Collecting kabuki
  Downloading kabuki-0.6.3.tar.gz (44 kB)
     |████████████████████████████████| 44 kB 2.0 MB/s
Requirement already satisfied: NumPy>=1.6.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from kabuki) (1.23.2)
Collecting matplotlib>=1.0.0
  Using cached matplotlib-3.5.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
Requirement already satisfied: pandas>=0.12.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from kabuki) (1.4.3)
Requirement already satisfied: pymc>=2.3.6 in /home/cmhan616/.local/lib/python3.8/site-packages (from kabuki) (2.3.8)
Collecting pillow>=6.2.0
  Using cached Pillow-9.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting fonttools>=4.22.0
  Using cached fonttools-4.37.1-py3-none-any.whl (957 kB)
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting cycler>=0.10
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
  Using cached kiwisolver-1.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB)
Collecting packaging>=20.0
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Requirement already satisfied: python-dateutil>=2.7 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=1.0.0->kabuki) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /home/cmhan616/.local/lib/python3.8/site-packages (from pandas>=0.12.0->kabuki) (2022.2.1)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib>=1.0.0->kabuki) (1.14.0)
Building wheels for collected packages: kabuki
  Building wheel for kabuki (setup.py) ... done
  Created wheel for kabuki: filename=kabuki-0.6.3-py3-none-any.whl size=36528 sha256=de3e8bb90b1d4023c3b046e48f0d9cb9a2477006fad1cbab1e4487527005029c
  Stored in directory: /home/cmhan616/.cache/pip/wheels/01/5c/ff/1906bfb1f9d704dd8e7a49bf7332ffeb36fd2884beec2e90f6
Successfully built kabuki
Installing collected packages: pillow, fonttools, pyparsing, cycler, kiwisolver, packaging, matplotlib, kabuki
Successfully installed cycler-0.11.0 fonttools-4.37.1 kabuki-0.6.3 kiwisolver-1.4.4 matplotlib-3.5.3 packaging-21.3 pillow-9.2.0 pyparsing-3.0.9
(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ pip3 install git+https://github.com/hddm-devs/hddm
Collecting git+https://github.com/hddm-devs/hddm
  Cloning https://github.com/hddm-devs/hddm to /tmp/pip-req-build-f7u1avj7
  Running command git clone -q https://github.com/hddm-devs/hddm /tmp/pip-req-build-f7u1avj7
  Running command git submodule update --init --recursive -q
Requirement already satisfied: NumPy>=1.6.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from HDDM==0.9.7) (1.23.2)
Requirement already satisfied: PyMC<3.0.0,>=2.3.3 in /home/cmhan616/.local/lib/python3.8/site-packages (from HDDM==0.9.7) (2.3.8)
Collecting SciPy>=0.6.0
  Using cached scipy-1.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.4 MB)
Collecting arviz>=0.11
  Using cached arviz-0.12.1-py3-none-any.whl (1.6 MB)
Collecting cloudpickle>=2.0.0
  Using cached cloudpickle-2.1.0-py3-none-any.whl (25 kB)
Requirement already satisfied: cython>=0.29.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from HDDM==0.9.7) (0.29.32)
Requirement already satisfied: kabuki>=0.6.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from HDDM==0.9.7) (0.6.3)
Requirement already satisfied: pandas>=0.12.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from HDDM==0.9.7) (1.4.3)
Collecting patsy
  Using cached patsy-0.5.2-py2.py3-none-any.whl (233 kB)
Collecting scikit-learn>=0.24
  Using cached scikit_learn-1.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.2 MB)
Collecting seaborn>=0.11.0
  Using cached seaborn-0.11.2-py3-none-any.whl (292 kB)
Collecting statsmodels>=0.12.0
  Using cached statsmodels-0.13.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.9 MB)
Collecting tqdm>=4.1.0
  Using cached tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
Requirement already satisfied: matplotlib>=3.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from arviz>=0.11->HDDM==0.9.7) (3.5.3)
Requirement already satisfied: packaging in /home/cmhan616/.local/lib/python3.8/site-packages (from arviz>=0.11->HDDM==0.9.7) (21.3)
Collecting xarray-einstats>=0.2
  Using cached xarray_einstats-0.3.0-py3-none-any.whl (34 kB)
Collecting typing-extensions>=3.7.4.3
  Using cached typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Collecting netcdf4
  Using cached netCDF4-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB)
Requirement already satisfied: setuptools>=38.4 in /usr/lib/python3/dist-packages (from arviz>=0.11->HDDM==0.9.7) (45.2.0)
Collecting xarray>=0.16.1
  Using cached xarray-2022.6.0-py3-none-any.whl (927 kB)
Requirement already satisfied: pytz>=2020.1 in /home/cmhan616/.local/lib/python3.8/site-packages (from pandas>=0.12.0->HDDM==0.9.7) (2022.2.1)
Requirement already satisfied: python-dateutil>=2.8.1 in /home/cmhan616/.local/lib/python3.8/site-packages (from pandas>=0.12.0->HDDM==0.9.7) (2.8.2)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from patsy->HDDM==0.9.7) (1.14.0)
Collecting threadpoolctl>=2.0.0
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting joblib>=1.0.0
  Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Requirement already satisfied: fonttools>=4.22.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11->HDDM==0.9.7) (4.37.1)
Requirement already satisfied: cycler>=0.10 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11->HDDM==0.9.7) (0.11.0)
Requirement already satisfied: pyparsing>=2.2.1 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11->HDDM==0.9.7) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11->HDDM==0.9.7) (1.4.4)
Requirement already satisfied: pillow>=6.2.0 in /home/cmhan616/.local/lib/python3.8/site-packages (from matplotlib>=3.0->arviz>=0.11->HDDM==0.9.7) (9.2.0)
Collecting cftime
  Using cached cftime-1.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (241 kB)
Building wheels for collected packages: HDDM
  Building wheel for HDDM (setup.py) ... done
  Created wheel for HDDM: filename=HDDM-0.9.7-cp38-cp38-linux_x86_64.whl size=5948993 sha256=2bc57e80e5807182ed06f0292b3dbbbb48e8274330d7edbb9d5cd57fc6811453
  Stored in directory: /tmp/pip-ephem-wheel-cache-oe1z3g45/wheels/a2/5a/d8/330e0d6a8511ba264bfa2a2dcb52e4ff750163e59d8291bf34
Successfully built HDDM
Installing collected packages: SciPy, xarray, xarray-einstats, typing-extensions, cftime, netcdf4, arviz, cloudpickle, patsy, threadpoolctl, joblib, scikit-learn, seaborn, statsmodels, tqdm, HDDM
Successfully installed HDDM-0.9.7 SciPy-1.9.1 arviz-0.12.1 cftime-1.6.1 cloudpickle-2.1.0 joblib-1.1.0 netcdf4-1.6.0 patsy-0.5.2 scikit-learn-1.1.2 seaborn-0.11.2 statsmodels-0.13.2 threadpoolctl-3.1.0 tqdm-4.64.0 typing-extensions-4.3.0 xarray-2022.6.0 xarray-einstats-0.3.0
(conda_hddm_py3) cmhan616@LAPTOP-1C0RTV90:/mnt/c/Users/owner/Ubuntu_pg$ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hddm
HDDM: pytorch module seems missing. No LAN functionality can be loaded.
It seems that you do not have pytorch installed. You cannot use the network_inspector module.
It seems that you do not have pytorch installed.The HDDMnn, HDDMnnRegressor, HDDMnnStimCoding, HDDMnnRL and HDDMnnRLRegressorclasses will not work
It seems that you do not have pytorch installed.The HDDMnn, HDDMnnRegressor, HDDMnnStimCoding, HDDMnnRL and HDDMnnRLRegressorclasses will not work
It seems that you do not have pytorch installed.The HDDMnn, HDDMnnRegressor and HDDMnnStimCodingclasses will not work
It seems that you do not have pytorch installed.The HDDMnn, HDDMnnRL, HDDMnnRegressor, HDDMnnStimCoding, HDDMnnRL and HDDMnnRLRegressorclasses will not work
It seems that you do not have pytorch installed.The HDDMnn, HDDMnnRegressor, HDDMnnStimCoding, HDDMnnRL and HDDMnnRLRegressorclasses will not work
>>> exit()


Hope this helps with anyone tries to run HDDM on Windows WSL. 
Best

Jamie
Reply all
Reply to author
Forward
0 new messages