import streamlit as st
from hydralit_components import HyLoader, Loaders
from hydralit.app_template import HydraHeadApp
class LoadingApp(HydraHeadApp):
def run(self,app_target):
try:
app_title = ''
if hasattr(app_target,'title'):
app_title = app_target.title
# with HyLoader("Now loading {}".format(app_title), loader_name=Loaders.standard_loaders,index=[3,0,5]):
app_target.run()
except Exception as e:
raise e
File "/opt/conda/envs/lib/lib/python3.8/site-packages/streamlit/scriptrunner/script_runner.py", line 475, in _run_script
exec(code, module.__dict__)
File "/opt/ml/input/code/project/pipeline/zzolflix.py", line 4, in <module>
import hydralit as hy
File "/opt/conda/envs/lib/lib/python3.8/site-packages/hydralit/__init__.py", line 5, in <module>
from hydralit.hydra_app import HydraApp
File "/opt/conda/envs/lib/lib/python3.8/site-packages/hydralit/hydra_app.py", line 4, in <module>
from hydralit.sessionstate import SessionState
File "/opt/conda/envs/lib/lib/python3.8/site-packages/hydralit/sessionstate.py", line 8, in <module>
from streamlit.script_run_context import get_script_run_ctx
ModuleNotFoundError: No module named 'streamlit.script_run_context'
라이브러리를 설치하고, hydralit까지 설치해서 가장 기본적인 앱을 실행시켰는데, 해당 에러가 나왔다.
hydralit은 streamlit에 영향을 받는 라이브러리인 것 같다.
streamlit에 버전에 따라 hydralit쪽에서 에러가 발생할 수 있다.
[해결방법]
File "/opt/conda/envs/lib/lib/python3.8/site-packages/hydralit/sessionstate.py", line 8, in <module>
이 경로로 이동한 뒤, 소스를 직접 수정해주어야 한다.
#v1.7.0
from streamlit.script_run_context import get_script_run_ctx
#v1.8.0
from streamlit.scriptrunner.script_run_context import get_script_run_ctx
에러 메세지를 타이틀만 기록해서 상세한 에러 메세지는 stackoverflow에서 가지고 왔다.
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1