ImportError: DLL load failed while importing error: The specified module could not be found

This error is showing while using streamlit for the first time

Uncaught app exception
Traceback (most recent call last):
File “C:\Users\shrut\anaconda3\envs\MachineLearing\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 552, in run_script
exec(code, module.dict)
File “C:\Users\shrut\anaconda3\Lib\site-packages\ipykernel_launcher.py”, line 15, in
from ipykernel import kernelapp as app
File "C:\Users\shrut\anaconda3\lib\site-packages\ipykernel_init
.py", line 2, in
from .connect import *
File “C:\Users\shrut\anaconda3\lib\site-packages\ipykernel\connect.py”, line 18, in
import jupyter_client
File “C:\Users\shrut\anaconda3\lib\site-packages\jupyter_client_init_.py”, line 4, in
from .connect import *
File “C:\Users\shrut\anaconda3\lib\site-packages\jupyter_client\connect.py”, line 21, in
import zmq
File “C:\Users\shrut\anaconda3\lib\site-packages\zmq_init_.py”, line 50, in
from zmq import backend
File “C:\Users\shrut\anaconda3\lib\site-packages\zmq\backend_init_.py”, line 40, in
reraise(*exc_info)
File “C:\Users\shrut\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py”, line 34, in reraise
raise value
File “C:\Users\shrut\anaconda3\lib\site-packages\zmq\backend_init_.py”, line 27, in
ns = select_backend(first)
File “C:\Users\shrut\anaconda3\lib\site-packages\zmq\backend\select.py”, line 28, in select_backend
mod = import(name, fromlist=public_api)
File "C:\Users\shrut\anaconda3\lib\site-packages\zmq\backend\cython_init
.py", line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.

please help

this is my code file

import streamlit as st
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
import xgboost as xgb
import numpy as np

st.header(“Thyroid Prediction App”)

Hi @Shruti_Rathore

There seems to be a package dependency error where some libraries may not have been properly installed.

  1. Could you try creating a new Python environment using a supported Python version: Requires: Python >=3.8, !=3.9.7 (according to streamlit · PyPI)

  2. Then install the prerequisite libraries: streamlit, pandas, scikit-learn, xgboost, numpy

  3. Try running the app again

Hope this helps!

Hi,
This actually did solve my problem.
Thank you.

1 Like

You’re welcome, glad to hear that!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.