TractSeg icon indicating copy to clipboard operation
TractSeg copied to clipboard

Issue: No module named 'torch'

Open shakhu29 opened this issue 3 years ago • 3 comments

I previously was getting the following error: ImportError: cannot import name 'compress_streamlines' from 'dipy.tracking.streamline' (/Users/shakhu/opt/anaconda3/lib/python3.9/site-packages/dipy/tracking/streamline.py)

So I downgraded dipy as mentioned somewhere on this site using: pip install --upgrade dipy==1.4.0

While that seemed to fix the above error, I am now getting this error: ModuleNotFoundError: No module named 'torch'

I am currently still just trying the first command line of tractseg within the examples module and I cannot get it to run due to these errors. Looking forward to any inputs. Thanks!

shakhu29 avatar Jun 02 '22 16:06 shakhu29

I published a new TractSeg version (v2.6) which should fix the compress_streamlines error. So you do not have to downgrade dipy. Does it work if you simply do pip install --upgrade dipy TractSeg ? If you get the torch error again could you post the entire error message?

wasserth avatar Jun 07 '22 14:06 wasserth

I published a new TractSeg version (v2.6) which should fix the compress_streamlines error. So you do not have to downgrade dipy. Does it work if you simply do pip install --upgrade dipy TractSeg ? If you get the torch error again could you post the entire error message?

I tried what you said here and I am still getting that error, here is the complete message: Traceback (most recent call last): File "/Users/shakhu/opt/anaconda3/bin/TractSeg", line 22, in from tractseg.python_api import run_tractseg File "/Users/shakhu/opt/anaconda3/lib/python3.9/site-packages/tractseg/python_api.py", line 18, in from tractseg.libs import direction_merger File "/Users/shakhu/opt/anaconda3/lib/python3.9/site-packages/tractseg/libs/direction_merger.py", line 8, in from tractseg.data.data_loader_inference import DataLoaderInference File "/Users/shakhu/opt/anaconda3/lib/python3.9/site-packages/tractseg/data/data_loader_inference.py", line 14, in from tractseg.data.DLDABG_standalone import ZeroMeanUnitVarianceTransform as ZeroMeanUnitVarianceTransform_Standalone File "/Users/shakhu/opt/anaconda3/lib/python3.9/site-packages/tractseg/data/DLDABG_standalone.py", line 14, in import torch ModuleNotFoundError: No module named 'torch'

shakhu29 avatar Jun 07 '22 17:06 shakhu29

Did you install pytorch? This has to be installed before installing TractSeg. When you start a python Terminal and enter import torch, do you get any error?

wasserth avatar Jun 08 '22 07:06 wasserth