nnUNet
nnUNet copied to clipboard
importlib.metadata.PackageNotFoundError: nnunet
After I upgrade the python version from 3.6 to 3.8, the program continuously prompt:
importlib.metadata.PackageNotFoundError: nnunet
No matter what command I do. Any solutions?
You should give more details about what is actually happening before anyone can help you.
- Full stack trace?
- When does this happen? What are you running?
- What did you already try to resolve the problem?
The full stack trace is as follows:
Traceback (most recent call last):
File "/home/zhangge/.conda/envs/nnUNet/bin/nnUNet_convert_decathlon_task", line 33, in
The error continously prompt for all the command. In the previous scetion, I ran: nnUNet_plan_and_preprocess -t 8
I have checked the .bashrc file and the path is all correct.
When switching python versions, did you redo this command: pip install -e .
?
After I ran the command pip install -e .
The prompt became a warning:
-bash: The: command not found (nnUNet) [zhangge@KYJS-node-B-1 nnUNet]$ If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/ -bash: If: command not found (nnUNet) [zhangge@KYJS-node-B-1 nnUNet]$ (nnUNet) [zhangge@KYJS-node-B-1 nnUNet]$ warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
and an error message jumped after epoch 0:
`epoch: 0
Traceback (most recent call last):
File "/home/zhangge/.conda/envs/nnUNet/bin/nnUNet_train", line 33, in
Thread 0x00007f6095feb700 (most recent call first): File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 1202 in invoke_excepthook File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 934 in _bootstrap_inner File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 890 in _bootstrap
Thread 0x00007f60a5fff700 (most recent call first): File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 1202 in invoke_excepthook File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 934 in _bootstrap_inner File "/home/zhangge/.conda/envs/nnUNet/lib/python3.8/threading.py", line 890 in _bootstrap
Current thread 0x00007f61cd0a9740 (most recent call first): <no Python frame> Aborted`
Please check the installation instructions in the readme. They specify clearly that you need to have PyTorch properly installed first.
I have install PyTorch with command "pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116" before applying installation of nnUNet. The error remains the same.
Can you please start from a fresh virtual environment? Conda is preferred. Does the error still occur?
I have install PyTorch with command "pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116" before applying installation of nnUNet. The error remains the same.
Hi, do you solve the problem? I have the same error "importlib.metadata.PackageNotFoundError: No package metadata was found for nnunetv2"
I created a new environment and then I installed PyTorch with the command "conda install pytorch torchvision -c pytorch". But I still got the same error.
Hey @limyemily,
sounds like you did not install nnunetv2
yet.
As previously mentioned: pip install -e .
(with conda/virtualenv active in the root directory of nnunet (the one that contains setup.py or pyproject.toml)).
Best, Tassilo
Closing due to inactivity.