pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

import mda_xdrlib issue in blender/blenderlib.py and in blender/__init__.py

Open dazhang930 opened this issue 9 months ago • 1 comments

When running the command "cortex.segment.cut_surface(subjectID, "rh") ", it throws the following error:

File "~/.conda/envs/pycortex/lib/python3.8/site-packages/cortex/blender/blendlib.py", line 5, in import mda_xdrlib.xdrlib as xdrlib ModuleNotFoundError: No module named 'mda_xdrlib'

Then, I need to modify line 5 in ~/.conda/envs/pycortex/lib/python3.8/site-packages/cortex/blender/blendlib.py, changing "import mda_xdrlib as xdrlib" to "import xdrlib", and it works.

In another file "~/.conda/envs/pycortex/lib/python3.8/site-packages/cortex/blender/init.py", I have to change line 5 "import mda_xdrlib as xdrlib" to "import mda_xdrlib.xdrlib as xdrlib" and it works.

dazhang930 avatar Apr 02 '25 21:04 dazhang930

Hi, this sounds like an installation problem. I'd suggest uninstalling and reinstalling pycortex (python -m pip uninstall pycortex && python -m pip install -U pycortex). If it still doesn't work, python -m pip install mda_xdrlib should solve the problem (but please let us know, because all the requirements should be installed properly).

For context, xdrlib was a standard Python module but it will be removed in future python versions. So we recently switched to mda_xdrlib (https://github.com/gallantlab/pycortex/pull/564), which is now added as a requirement.

mvdoc avatar Apr 03 '25 13:04 mvdoc