daducci / COMMIT

Linear framework to combine tractography and tissue micro-structure estimation with diffusion MRI
Other
43 stars 33 forks source link

Numpy version incompatability? #108

Closed smeisler closed 2 years ago

smeisler commented 2 years ago

Hello,

I get the following error when trying to import commit:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [6], in <module>
      1 import os
      2 import numpy
----> 3 import commit
      4 from commit import trk2dictionary

File /om2/user/smeisler/anaconda3/envs/commit/lib/python3.9/site-packages/commit/__init__.py:3, in <module>
      1 __all__ = ['core','models','solvers','trk2dictionary']
      2 from .info import __version__
----> 3 from .core import Evaluation, setup

File commit/core.pyx:1, in init commit.core()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Steps to replicate

1) Create new conda environment with python 3.9, ipykernel, and some compiler libraries needed to install pip packages conda create -n commit -c conda-forge python=3.9 gxx_linux-64 gcc gcc_linux-64 isl libblas ipykernel liblapack 2) install dmri-commit: pip install dmri-commit 3) error occurs upon importing commit with import commit

Troubleshooting steps

I have tried using pip to uninstall and reinstall numpy, with different versions (one 1.21 installation, and one 1.22 installation)

I am on a Linux HPC running CentOs 7.6. Please let me know if any other information would help.

Thank you, Steven

smeisler commented 2 years ago

Update: Uninstalling Numpy via pip then reinstalling numpy from conda-forge (1.22.2) seems to have done the trick. Perhaps it would help to note in documentation that numpy should be installed before pip install dmri-commit

MarioOcampo commented 2 years ago

Hello @smeisler, thank you for letting us know about the issue and for sharing a solution.

Best regards Mario