Error when do "pip install hddm"

74 views
Skip to first unread message

Su Wang

unread,
Oct 30, 2024, 10:39:15 PM10/30/24
to hddm-users
Hi, when I did "!pip install hddm", I got the following error.I have also tried "!pip install git+https://github.com/hddm-devs/hddm" and got the same error.I used python 3.7, numpy version is 1.14.6 (lower than 1.23.0), and cython version is 0.29.32. I could not figure out how to fix this error and install hddm correctly so far. Please help.Gratefully,-Su(I attached the error messages below.)--------------------------------------------------------------------Collecting hddm Using cached HDDM-1.0.1.tar.gz (4.2 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): still running... Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error python setup.py egg_info did not run successfully. exit code: 1 [69 lines of output] error: subprocess-exited-with-error Building wheel for ssm-simulators (pyproject.toml) did not run successfully. exit code: 1 [25 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-37 creating build\lib.win-amd64-cpython-37\ssms copying ssms\__init__.py -> build\lib.win-amd64-cpython-37\ssms creating build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\boundary_functions.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\drift_functions.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\simulator.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\__init__.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators creating build\lib.win-amd64-cpython-37\ssms\config copying ssms\config\config.py -> build\lib.win-amd64-cpython-37\ssms\config copying ssms\config\__init__.py -> build\lib.win-amd64-cpython-37\ssms\config creating build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\lan_mlp.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\snpe.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\__init__.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators creating build\lib.win-amd64-cpython-37\ssms\support_utils copying ssms\support_utils\kde_class.py -> build\lib.win-amd64-cpython-37\ssms\support_utils copying ssms\support_utils\__init__.py -> build\lib.win-amd64-cpython-37\ssms\support_utils running build_ext building 'cssm' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ssm-simulators ERROR: Failed to build one or more wheels D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. SetuptoolsDeprecationWarning, Traceback (most recent call last): File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py", line 82, in fetch_build_egg subprocess.check_call(cmd) File "D:\ProgramData\conda_envs\myenv_py37\lib\subprocess.py", line 341, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['D:\\ProgramData\\conda_envs\\myenv_py37\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\suewa\\AppData\\Local\\Temp\\tmpjjpsa41f', '--quiet', 'ssm-simulators==0.3.2']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 36, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\suewa\AppData\Local\Temp\pip-install-vb9q167u\hddm_d1d270b338844ffab168cdccf968cb42\setup.py", line 43, in <module> ext_modules = ext_modules File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\__init__.py", line 152, in setup _install_setup_requires(attrs) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\dist.py", line 815, in fetch_build_eggs replace_conflicting=True, File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 773, in resolve replace_conflicting=replace_conflicting File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 1056, in best_match return self.obtain(req, installer) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 1068, in obtain return installer(requirement) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\dist.py", line 883, in fetch_build_egg return fetch_build_egg(self, req) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py", line 84, in fetch_build_egg raise DistutilsError(str(e)) from e distutils.errors.DistutilsError: Command '['D:\\ProgramData\\conda_envs\\myenv_py37\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\suewa\\AppData\\Local\\Temp\\tmpjjpsa41f', '--quiet', 'ssm-simulators==0.3.2']' returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Encountered error while generating package metadata. See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
Collecting hddm Downloading HDDM-1.0.1.tar.gz (4.2 MB) ---------------------------------------- 4.2/4.2 MB 8.5 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): still running... Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error python setup.py egg_info did not run successfully. exit code: 1 [69 lines of output] error: subprocess-exited-with-error Building wheel for ssm-simulators (pyproject.toml) did not run successfully. exit code: 1 [25 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-37 creating build\lib.win-amd64-cpython-37\ssms copying ssms\__init__.py -> build\lib.win-amd64-cpython-37\ssms creating build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\boundary_functions.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\drift_functions.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\simulator.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators copying ssms\basic_simulators\__init__.py -> build\lib.win-amd64-cpython-37\ssms\basic_simulators creating build\lib.win-amd64-cpython-37\ssms\config copying ssms\config\config.py -> build\lib.win-amd64-cpython-37\ssms\config copying ssms\config\__init__.py -> build\lib.win-amd64-cpython-37\ssms\config creating build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\lan_mlp.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\snpe.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators copying ssms\dataset_generators\__init__.py -> build\lib.win-amd64-cpython-37\ssms\dataset_generators creating build\lib.win-amd64-cpython-37\ssms\support_utils copying ssms\support_utils\kde_class.py -> build\lib.win-amd64-cpython-37\ssms\support_utils copying ssms\support_utils\__init__.py -> build\lib.win-amd64-cpython-37\ssms\support_utils running build_ext building 'cssm' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ssm-simulators ERROR: Failed to build one or more wheels D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. SetuptoolsDeprecationWarning, Traceback (most recent call last): File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py", line 82, in fetch_build_egg subprocess.check_call(cmd) File "D:\ProgramData\conda_envs\myenv_py37\lib\subprocess.py", line 341, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['D:\\ProgramData\\conda_envs\\myenv_py37\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\suewa\\AppData\\Local\\Temp\\tmp0xtneh6n', '--quiet', 'ssm-simulators==0.3.2']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 36, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\suewa\AppData\Local\Temp\pip-install-hzqndg3_\hddm_073e5722fa524744a63f6e4958bdc451\setup.py", line 43, in <module> ext_modules = ext_modules File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\__init__.py", line 152, in setup _install_setup_requires(attrs) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\dist.py", line 815, in fetch_build_eggs replace_conflicting=True, File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 773, in resolve replace_conflicting=replace_conflicting File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 1056, in best_match return self.obtain(req, installer) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\pkg_resources\__init__.py", line 1068, in obtain return installer(requirement) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\dist.py", line 883, in fetch_build_egg return fetch_build_egg(self, req) File "D:\ProgramData\conda_envs\myenv_py37\lib\site-packages\setuptools\installer.py", line 84, in fetch_build_egg raise DistutilsError(str(e)) from e distutils.errors.DistutilsError: Command '['D:\\ProgramData\\conda_envs\\myenv_py37\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\suewa\\AppData\\Local\\Temp\\tmp0xtneh6n', '--quiet', 'ssm-simulators==0.3.2']' returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Encountered error while generating package metadata. See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Veronika Wendler

unread,
Feb 4, 2025, 7:54:10 AMFeb 4
to hddm-users
Hello Su,

I could perhaps help you out with this—but from a slightly different approach. If you want to install the latest HDDM with all its functionality and without having to deal with difficult and time-consuming dependency and wheel-building issues, I would suggest installing the Docker HDDM image (dockerHDDM: A user-friendly environment for Bayesian Hierarchical Drift-Diffusion Modeling by Pan et al., 2024).

For this to work, I recommend first installing Docker for your desktop. I use Windows Subsystem for Linux 2 (WSL 2). Then, you can simply create a Docker image exactly as outlined by Pan et al. (2024) in their paper. If you install the latest version, you can convert output into InferenceData, get pointwise likelihood calculations, and perform posterior predictive checks with additional functionality. On top of that, the Arviz library is used for model plots.

When you want to run HDDM, I suggest running the Docker image and attaching to your container in VS Code. I’ve found that using HDDM this way has saved me a lot of time.

I believe this does not quite answer your question, but it might help with future HDDM use.
 
Best,

Veronika
Reply all
Reply to author
Forward
0 new messages