# MONAI error: cannot import name

**URL:** https://discourse.slicer.org/t/monai-error-cannot-import-name/28222
**Category:** Support
**Created:** [March 7, 2023, 3:08pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222 "2023-03-07T15:08:08Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 7, 2023, 3:08pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/1 "2023-03-07T15:08:08Z")

</div>

When I run (in Windows 10):

_monailabel start\_server --app monaibundle --studies Task09\_Spleen/imagesTr --conf models renalStructures\_UNEST\_segmentation_

I get:

_Using PYTHONPATH=C:\Users\Gene\AppData\Local\Programs\Python;C:\Users\Gene\AppData\Local\Programs\Python\Python39;  
“”  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: version = False  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: app = C:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monaibundle  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: studies = C:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\Task09\_Spleen\imagesTr  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: verbose = INFO  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: conf = [[‘models’, ‘renalStructures\_UNEST\_segmentation’]]  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: host = 0.0.0.0  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: port = 8000  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: uvicorn\_app = monailabel.app:app  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: ssl\_keyfile = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: ssl\_certfile = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: ssl\_keyfile\_password = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: ssl\_ca\_certs = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: workers = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: limit\_concurrency = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: access\_log = False  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: log\_config = None  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: dryrun = False  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :276) - USING:: action = start\_server  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_API\_STR =  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_PROJECT\_NAME = MONAILabel  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_APP\_DIR =  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_STUDIES =  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_AUTH\_ENABLE = False  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_AUTH\_DB =  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_APP\_CONF = ‘{}’  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_TRAIN = True  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_STRATEGY = True  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_SCORING = True  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_BATCH\_INFER = True  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE =  
[2023-03-07 10:49:47,870] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_URL =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_USERNAME =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_PASSWORD =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_API\_KEY =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_CACHE\_PATH =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_PROJECT =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_ASSET\_PATH =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_DSA\_ANNOTATION\_GROUPS =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_USERNAME =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_PASSWORD =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CACHE\_PATH =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_QIDO\_PREFIX = None  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_WADO\_PREFIX = None  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_STOW\_PREFIX = None  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_FETCH\_BY\_FRAME = False  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CONVERT\_TO\_NIFTI = True  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_SEARCH\_FILTER = ‘{“Modality”: “CT”}’  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CACHE\_EXPIRY = 180  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_PROXY\_TIMEOUT = 30.0  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_READ\_TIMEOUT = 5.0  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_AUTO\_RELOAD = True  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_READ\_ONLY = False  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_FILE\_EXT = '["_.nii.gz", “_.nii", "_.nrrd”, “_.jpg", "_.png”, “_.tif", "_.svs”, "_.xml"]’  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_SERVER\_PORT = 8000  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_CORS\_ORIGINS = ‘[]’  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_SESSIONS = True  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_SESSION\_PATH =  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_SESSION\_EXPIRY = 3600  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_INFER\_CONCURRENCY = -1  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_INFER\_TIMEOUT = 600  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TRACKING\_ENABLED = True  
[2023-03-07 10:49:47,885] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_TRACKING\_URI =  
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_ZOO\_SOURCE = github  
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_ZOO\_REPO = Project-MONAI/model-zoo/hosting\_storage\_v1  
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_ZOO\_AUTH\_TOKEN = ghp\_2unR2llPM32J7B4oVHgJz8hVTHjhSh4LbDnr  
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] ( **main** :280) - ENV SETTINGS:: MONAI\_LABEL\_AUTO\_UPDATE\_SCORING = True  
[2023-03-07 10:49:47,901] [15316] [MainThread] [INFO] ( **main** :281) -  
Traceback (most recent call last):  
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\runpy.py”, line 197, in \_run\_module\_as\_main  
return \_run\_code(code, main\_globals, None,  
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\runpy.py”, line 87, in run\_code  
exec(code, run\_globals)  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 342, in   
Main().run()  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 133, in run  
self.action\_start\_server(args)  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\main.py”, line 234, in action\_start\_server  
uvicorn.run(  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\main.py”, line 463, in run  
server.run()  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\server.py”, line 60, in run  
return asyncio.run(self.serve(sockets=sockets))  
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\asyncio\runners.py”, line 44, in run  
return loop.run\_until\_complete(main)  
File “C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\asyncio\base\_events.py”, line 647, in run\_until\_complete  
return future.result()  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\server.py”, line 67, in serve  
config.load()  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\config.py”, line 458, in load  
self.loaded\_app = import\_from\_string(self.app)  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\importer.py”, line 24, in import\_from\_string  
raise exc from None  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\uvicorn\importer.py”, line 21, in import\_from\_string  
module = importlib.import\_module(module\_str)  
File "C:\Users\Gene\AppData\Local\Programs\python\Python39\lib\importlib\_init.py", line 127, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 1030, in \_gcd\_import  
File “”, line 1007, in \_find\_and\_load  
File “”, line 986, in \_find\_and\_load\_unlocked  
File “”, line 680, in \_load\_unlocked  
File “”, line 850, in exec\_module  
File “”, line 228, in call\_with\_frames\_removed  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\app.py”, line 23, in   
from monailabel.endpoints import (  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\endpoints\activelearning.py”, line 19, in   
from monailabel.interfaces.app import MONAILabelApp  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\interfaces\app.py”, line 38, in   
from monailabel.datastore.dicom import DICOMwebClientX, DICOMWebDatastore  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\datastore\dicom.py”, line 26, in   
from monailabel.datastore.utils.convert import binary\_to\_image, dicom\_to\_nifti, nifti\_to\_dicom\_seg  
File “c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monailabel\datastore\utils\convert.py”, line 24, in   
from monai.data import nifty\_writer  
ImportError: cannot import name ‘nifty\_writer’ from ‘monai.data’ (c:\Users\Gene\AppData\Local\Programs\Python\Python39\Lib\site-packages\monai\data\_init.py)_

I don’t know what to do next. I installed monailabel and then monai-weekly to avoid the hardcoded site request issue with running the server in Windows.

Gene

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 7, 2023, 8:37pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/2 "2023-03-07T20:37:19Z")

</div>

I installed monailabel-weekly…

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [March 7, 2023, 10:01pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/3 "2023-03-07T22:01:28Z")

</div>

Did you install MonaiLabel as [described here](https://projectweek.na-mic.org/PW37_2022_Virtual/Projects/MONAILabelLung/MONAILabel_Installation.html) and which works for most use cases?

What did you do differently?

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 2:37pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/5 "2023-03-08T14:37:08Z")

</div>

Thank you for your assistance!

I was following directions from another web site, so I started over and used your directions. It got me this far:

_requests.exceptions.HTTPError: 404 Client Error: Not Found for url: [https://api.github.com/repos/Project-MONAI\model-zoo/releases](https://api.github.com/repos/Project-MONAI%5Cmodel-zoo/releases)_

The "" is the problem. I believe I read about this Windows specific error and that the solution was to install monailabel-weekly. I don’t know if this is what I should do and I don’t want to mess up what has gotten me this far. Do you have a suggestion?

Thanks again.

Gene

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [March 8, 2023, 7:09pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/6 "2023-03-08T19:09:29Z")

</div>

> [@GeneRisi](#):
>
> requests.exceptions.HTTPError: 404 Client Error: Not Found for url: [https://api.github.com/repos/Project-MONAI\model-zoo/releases](https://api.github.com/repos/Project-MONAI%5Cmodel-zoo/releases)

At which installation stage/command from the script (link above) does this happen?

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 7:12pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/7 "2023-03-08T19:12:04Z")

</div>

PS C:\Users\Gene\> monailabel datasets --download --name Task09\_Spleen --output datasets  
Using PYTHONPATH=C:\Users\Gene\MONAILabel;  
“”  
Directory already exists: datasets\Task09\_Spleen  
PS C:\Users\Gene\> monailabel start\_server --app monaibundle --studies Task09\_Spleen/imagesTr --conf models renalStructures\_UNEST\_segmentation  
Using PYTHONPATH=C:\Users\Gene\MONAILabel;  
“”  
2023-03-08 08:56:00,220 - USING:: version = False  
2023-03-08 08:56:00,220 - USING:: app = C:\Users\Gene\monaibundle  
2023-03-08 08:56:00,221 - USING:: studies = C:\Users\Gene\Task09\_Spleen\imagesTr  
2023-03-08 08:56:00,222 - USING:: verbose = INFO  
2023-03-08 08:56:00,222 - USING:: conf = [[‘models’, ‘renalStructures\_UNEST\_segmentation’]]  
2023-03-08 08:56:00,222 - USING:: host = 0.0.0.0  
2023-03-08 08:56:00,223 - USING:: port = 8000  
2023-03-08 08:56:00,223 - USING:: uvicorn\_app = monailabel.app:app  
2023-03-08 08:56:00,223 - USING:: ssl\_keyfile = None  
2023-03-08 08:56:00,224 - USING:: ssl\_certfile = None  
2023-03-08 08:56:00,224 - USING:: ssl\_keyfile\_password = None  
2023-03-08 08:56:00,224 - USING:: ssl\_ca\_certs = None  
2023-03-08 08:56:00,225 - USING:: workers = None  
2023-03-08 08:56:00,225 - USING:: limit\_concurrency = None  
2023-03-08 08:56:00,225 - USING:: access\_log = False  
2023-03-08 08:56:00,226 - USING:: log\_config = None  
2023-03-08 08:56:00,226 - USING:: dryrun = False  
2023-03-08 08:56:00,226 - USING:: action = start\_server  
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI\_LABEL\_API\_STR =  
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI\_LABEL\_PROJECT\_NAME = MONAILabel  
2023-03-08 08:56:00,227 - ENV SETTINGS:: MONAI\_LABEL\_APP\_DIR =  
2023-03-08 08:56:00,228 - ENV SETTINGS:: MONAI\_LABEL\_STUDIES =  
2023-03-08 08:56:00,228 - ENV SETTINGS:: MONAI\_LABEL\_AUTH\_ENABLE = False  
2023-03-08 08:56:00,229 - ENV SETTINGS:: MONAI\_LABEL\_AUTH\_DB =  
2023-03-08 08:56:00,229 - ENV SETTINGS:: MONAI\_LABEL\_APP\_CONF = ‘{}’  
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_TRAIN = True  
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_STRATEGY = True  
2023-03-08 08:56:00,230 - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_SCORING = True  
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI\_LABEL\_TASKS\_BATCH\_INFER = True  
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE =  
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_URL =  
2023-03-08 08:56:00,231 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_USERNAME =  
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_PASSWORD =  
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_API\_KEY =  
2023-03-08 08:56:00,232 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_CACHE\_PATH =  
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_PROJECT =  
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_ASSET\_PATH =  
2023-03-08 08:56:00,233 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_DSA\_ANNOTATION\_GROUPS =  
2023-03-08 08:56:00,234 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_USERNAME =  
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_PASSWORD =  
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CACHE\_PATH =  
2023-03-08 08:56:00,236 - ENV SETTINGS:: MONAI\_LABEL\_QIDO\_PREFIX = None  
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI\_LABEL\_WADO\_PREFIX = None  
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI\_LABEL\_STOW\_PREFIX = None  
2023-03-08 08:56:00,237 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_FETCH\_BY\_FRAME = False  
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CONVERT\_TO\_NIFTI = True  
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_SEARCH\_FILTER = ‘{“Modality”: “CT”}’  
2023-03-08 08:56:00,238 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_CACHE\_EXPIRY = 180  
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_PROXY\_TIMEOUT = 30.0  
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI\_LABEL\_DICOMWEB\_READ\_TIMEOUT = 5.0  
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_AUTO\_RELOAD = True  
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_READ\_ONLY = False  
2023-03-08 08:56:00,239 - ENV SETTINGS:: MONAI\_LABEL\_DATASTORE\_FILE\_EXT = ‘[“_.nii.gz", "_.nii”, “_.nrrd", "_.jpg”, “_.png", "_.tif”, “_.svs", "_.xml”]’  
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI\_LABEL\_SERVER\_PORT = 8000  
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI\_LABEL\_CORS\_ORIGINS = ‘’  
2023-03-08 08:56:00,240 - ENV SETTINGS:: MONAI\_LABEL\_SESSIONS = True  
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI\_LABEL\_SESSION\_PATH =  
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI\_LABEL\_SESSION\_EXPIRY = 3600  
2023-03-08 08:56:00,241 - ENV SETTINGS:: MONAI\_LABEL\_INFER\_CONCURRENCY = -1  
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI\_LABEL\_INFER\_TIMEOUT = 600  
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI\_LABEL\_TRACKING\_ENABLED = True  
2023-03-08 08:56:00,242 - ENV SETTINGS:: MONAI\_LABEL\_TRACKING\_URI =  
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI\_ZOO\_SOURCE = github  
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI\_ZOO\_REPO = Project-MONAI/model-zoo/hosting\_storage\_v1  
2023-03-08 08:56:00,243 - ENV SETTINGS:: MONAI\_ZOO\_AUTH\_TOKEN = ghp\_fk4weq08N1TRkJvFfyDIJY72PzmjhB1G3DEZ  
2023-03-08 08:56:00,244 - ENV SETTINGS:: MONAI\_LABEL\_AUTO\_UPDATE\_SCORING = True  
2023-03-08 08:56:00,244 -  
Allow Origins: [‘\*’]  
[2023-03-08 08:56:01,589] [9072] [MainThread] [INFO] (uvicorn.error:75) - Started server process [9072]  
[2023-03-08 08:56:01,589] [9072] [MainThread] [INFO] (uvicorn.error:45) - Waiting for application startup.  
[2023-03-08 08:56:01,591] [9072] [MainThread] [INFO] (monailabel.interfaces.utils.app:37) - Initializing App from: C:\Users\Gene\monaibundle; studies: C:\Users\Gene\Task09\_Spleen\imagesTr; conf: {‘models’: ‘renalStructures\_UNEST\_segmentation’}  
[2023-03-08 08:56:01,660] [9072] [MainThread] [INFO] (monailabel.utils.others.class\_utils:57) - Subclass for MONAILabelApp Found: \<class ‘main.MyApp’\>  
[2023-03-08 08:56:05,915] [9072] [MainThread] [INFO] (monailabel.utils.others.generic:303) - +++ Adding Bundle from Zoo: renalStructures\_UNEST\_segmentation =\> C:\Users\Gene\monaibundle\model\renalStructures\_UNEST\_segmentation  
2023-03-08 08:56:05,915 - INFO - — input summary of monai.bundle.scripts.download —  
2023-03-08 08:56:05,916 - INFO - \> name: ‘renalStructures\_UNEST\_segmentation’  
2023-03-08 08:56:05,917 - INFO - \> bundle\_dir: ‘C:\Users\Gene\monaibundle\model’  
2023-03-08 08:56:05,918 - INFO - \> source: ‘github’  
2023-03-08 08:56:05,918 - INFO - \> repo: ‘Project-MONAI/model-zoo/hosting\_storage\_v1’  
2023-03-08 08:56:05,919 - INFO - \> remove\_prefix: ‘monai\_’  
2023-03-08 08:56:05,919 - INFO - \> progress: True  
2023-03-08 08:56:05,920 - INFO - —

[2023-03-08 08:56:06,060] [9072] [MainThread] [ERROR] (uvicorn.error:119) - Traceback (most recent call last):  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 635, in lifespan  
async with self.lifespan\_context(app):  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 530, in **aenter**  
await self._router.startup()  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py”, line 612, in startup  
await handler()  
File “C:\Users\Gene\MONAILabel\monailabel\app.py”, line 106, in startup\_event  
instance = app\_instance()  
File “C:\Users\Gene\MONAILabel\monailabel\interfaces\utils\app.py”, line 50, in app\_instance  
app = c(app\_dir=app\_dir, studies=studies, conf=conf)  
File “C:\Users\Gene\monaibundle\main.py”, line 36, in **init**  
self.models = get\_bundle\_models(app\_dir, conf)  
File “C:\Users\Gene\MONAILabel\monailabel\utils\others\generic.py”, line 307, in get\_bundle\_models  
download(name=name, version=version, bundle\_dir=model\_dir, source=zoo\_source, repo=zoo\_repo)  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 302, in download  
version_ = _get\_latest\_bundle\_version(source=source_, name=name\_, repo=repo\_)  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 185, in \_get\_latest\_bundle\_version  
return get\_bundle\_versions(name, repo=os.path.join(repo\_owner, repo\_name), tag=tag\_name)[“latest\_version”]  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 520, in get\_bundle\_versions  
bundles\_info = \_get\_all\_bundles\_info(repo=repo, tag=tag, auth\_token=auth\_token)  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\monai\bundle\scripts.py”, line 434, in \_get\_all\_bundles\_info  
resp.raise\_for\_status()  
File “C:\Users\Gene\AppData\Roaming\Python\Python39\site-packages\requests\models.py”, line 1021, in raise\_for\_status  
raise HTTPError(http\_error\_msg, response=self)  
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: [https://api.github.com/repos/Project-MONAI\model-zoo/releases](https://api.github.com/repos/Project-MONAI%5Cmodel-zoo/releases)

[2023-03-08 08:56:06,061] [9072] [MainThread] [ERROR] (uvicorn.error:56) - Application startup failed. Exiting.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [March 8, 2023, 7:32pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/8 "2023-03-08T19:32:00Z")

</div>

I can reproduce that.  
Have you tried the radiology apps? Do you rely on monaibundle?

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 7:36pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/9 "2023-03-08T19:36:01Z")

</div>

This is where I confess my ignorance… I want to use Slicer3d with a radiology app and was excited when I saw the kidney study because I have kidney cancer and want to learn as much as I can. Is there another way to run this study?

Is there a way to download the models and then refer to them on my PC vs getting them from github ?

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [March 8, 2023, 7:51pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/10 "2023-03-08T19:51:53Z")

</div>

Sorry to hear that. Good luck.

Maybe @diazandr3s can comment.

---

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)
#### Post date: [March 8, 2023, 8:10pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/11 "2023-03-08T20:10:05Z")

</div>

Give it some time. You should get it going.  
I would recommend studying kidney (and related organs/tissues) anatomy.  
Also checkout this:

> **[NA-MIC Project Weeks](https://projectweek.na-mic.org/PW38_2023_GranCanaria/Projects/SlicerLiver/)**
>
> Website for NA-MIC Project Weeks

Best of luck

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 8:24pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/12 "2023-03-08T20:24:21Z")

</div>

I figured it out. There are environment variables (MONI\_ZOO\_SOURCE = ‘’ and MONI\_ZOO\_REPO = ) that seems to be working.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [March 8, 2023, 8:39pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/13 "2023-03-08T20:39:41Z")

</div>

Could you write a short passage that I could add to the installation script? Thank you.

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 9:05pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/14 "2023-03-08T21:05:36Z")

</div>

How’s this?

**IF**

the git api request for a model fails due to an improperly formatted URL

(for example _[https://api.github.com/repos/Project-MONAI\model-zoo/releases](https://api.github.com/repos/Project-MONAI%5Cmodel-zoo/releases)_)

**THEN**

Step 1: The model “.zip” file can be downloaded (via web browser, for example) with a properly formatted version of the URL (replace '' with ‘/’) and then expanded into a folder on your PC.

Step 2: Set values for two environment variable the server will use as an override:

- $Env:MONAI\_ZOO\_SOURCE = ‘local’
- $Env:MONAI\_ZOO\_REPO = \< folder name \>

Step 3: Start monailabel server

---

<div class="post-metadata">

### Author: ![GeneRisi](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GeneRisi](https://discourse.slicer.org/u/GeneRisi)
#### Post date: [March 8, 2023, 9:11pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/15 "2023-03-08T21:11:49Z")

</div>

Also, “git” was not installed on my Win 10 pro. “winget install git.git” made it available.

---

<div class="post-metadata">

### Author: ![diazandr3s](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diazandr3s/32/9973_2.png) [@diazandr3s](https://discourse.slicer.org/u/diazandr3s)
#### Post date: [March 8, 2023, 9:49pm UTC](https://discourse.slicer.org/t/monai-error-cannot-import-name/28222/16 "2023-03-08T21:49:41Z")

</div>

Thanks for the ping @rbumm  
I’d suggest asking questions or reporting any issues on using MONAI Bundle or models from the model Zoo directly on the main GitHub repo ([GitHub - Project-MONAI/model-zoo: MONAI Model Zoo that hosts models in the MONAI Bundle format.](https://github.com/project-monai/model-zoo)). The developers will answer you within hours 🙂
