NiftyPET / NIPET

High-throughput PET image reconstruction with high quantitative accuracy and precision
Apache License 2.0
29 stars 7 forks source link

No module named dinf #18

Closed rijobro closed 3 years ago

rijobro commented 4 years ago

Normally I simply pip install niftypet and everything works fine. I want to modify the source code, so git clone both nipet and nimpa. I use pip install as per the readthedocs and the readme:

pip install --no-binary :all: --verbose -e .

and then test:

python -c "from niftypet import nipet"

Error:

No module named dinf
rijobro commented 4 years ago

However,

pip uninstall -y nimpa nipet
cd <nipet source>
pip install --no-binary :all: --verbose -e .
python -c "from niftypet import nipet"

does work. It seems that nipet wants to install nimpa anyway, and pre-installing it just creates problems.

casperdcl commented 3 years ago

FYI if you run import X in a directory containing X.py or X/__init__.py this can confuse python.

I presume you ran python -c "from niftypet import nipet" in nimpa's source directory so Python couldn't find nipet. Simply cd elsewhere to fix.

rijobro commented 3 years ago

I haven't got any way of checking now, but the fact that it worked after uninstalling makes me think that it wasn't related to which folder I was in.