Import yfinance as yf ModuleNotFoundError: No module named 'yfinance'

Hi dear Community,

I feel really desperate currently. Was looking so much forward to my deployment and then it doesn’t work.

Here are some important infos to know about it:
I ran the following commands to deploy my Streamlit app:

pip install pipreqs
pipreqs./
git init
git add .
git commit -m 'first commit'
git remote add origin https://github.com/checkmarkets/cm_risk.git
git push origin master

ERROR #1:
When deploying the app, when I ran the command

git push origin main

I was asked for my credentials:

Username for 'https://github.com': 
Password for 'https://checkmarkets@github.com':

, but nothing sufficed. I could not enter my credentials accordingly although I login with them at Github.

ERROR #2: AFTER DEPLOYMENT
Somehow, it seems that no module could be imported to the several sites. Here’s my Github link again to check out if you find a reason that I don’t see: GitHub - checkmarkets/cm_risk: This repository contains a Streamlit App focusing on deep financial risk analysis for US stocks primarily. This App can be used for free and is therefore limited to the constraints that I regularly use this screener for.

I especially need the following modules so that my app functions:
yfinance
eod
pyEX

Unfortunately, they are not imported accordingly it seems:

Can somebody please help me? :frowning_face: :pray:
Here’s the full log data (this error will most probably occur with any site that I access with my app):

[     UTC     ] Logs for checkmarkets-cm-risk-01-our-story-bwh5ix.streamlit.app/
────────────────────────────────────────────────────────────────────────────────────────
[09:14:10] πŸ–₯ Provisioning machine...
[09:14:15] πŸŽ› Preparing system...
[09:14:21] β›“ Spinning up manager process...
[09:14:27] 🎈 Inflating balloons...
[09:14:08] πŸš€ Starting up repository: 'cm_risk', branch: 'main', main module: '01_Our_Story.py'
[09:14:08] πŸ™ Cloning repository...
[09:14:10] πŸ™ Cloning into '/app/cm_risk'...

[09:14:10] πŸ™ Cloned repository!
[09:14:10] πŸ™ Pulling code changes from Github...
[09:14:12] πŸ“¦ Processing dependencies...

─────────────────────────────────────── pipenv ─────────────────────────────────────────

/app/cm_risk /app/cm_risk
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Locking [dev-packages] dependencies...
Updated Pipfile.lock (fedbd2ab7afd84cf16f128af0619749267b62277b4cb6989ef16d4bef6e4eef2)!
Installing dependencies from Pipfile.lock (e4eef2)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
/app/cm_risk

────────────────────────────────────────────────────────────────────────────────────────

[09:14:13] 🐍 Python dependencies were installed from /app/cm_risk/Pipfile using pipenv.
[09:14:13] πŸ“¦ WARN: More than one requirements file detected in the repository. Available options: pipenv /app/cm_risk/Pipfile, pip /app/cm_risk/requirements.txt. Used: pipenv with /app/cm_risk/Pipfile
Check if streamlit is installed

──────────────────────────────── Installing Streamlit ──────────────────────────────────

Collecting streamlit
  Downloading streamlit-1.18.1-py2.py3-none-any.whl (9.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.6/9.6 MB 122.6 MB/s eta 0:00:00[2023-02-17 09:14:14.456993] 
Collecting pydeck>=0.1.dev5
  Downloading pydeck-0.8.0-py2.py3-none-any.whl (4.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 233.7 MB/s eta 0:00:00[2023-02-17 09:14:14.569382] 
Collecting numpy
  Downloading numpy-1.24.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 198.1 MB/s eta 0:00:00[2023-02-17 09:14:15.179113] 
Collecting gitpython!=3.1.19
  Downloading GitPython-3.1.31-py3-none-any.whl (184 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 184.3/184.3 KB 220.7 MB/s eta 0:00:00[2023-02-17 09:14:15.297884] 
Collecting altair>=3.2.0
  Downloading altair-4.2.2-py3-none-any.whl (813 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 813.6/813.6 KB 235.0 MB/s eta 0:00:00[2023-02-17 09:14:15.352602] 
Collecting typing-extensions>=3.10.0.0
  Downloading typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting cachetools>=4.0
  Downloading cachetools-5.3.0-py3-none-any.whl (9.3 kB)
Collecting tornado>=6.0.3
  Downloading tornado-6.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (423 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 424.0/424.0 KB 215.0 MB/s eta 0:00:00[2023-02-17 09:14:15.586581] 
Collecting validators>=0.2
  Downloading validators-0.20.0.tar.gz (30 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pympler>=0.9
  Downloading Pympler-1.0.1-py3-none-any.whl (164 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.8/164.8 KB 170.1 MB/s eta 0:00:00[2023-02-17 09:14:16.165975] 
Collecting tzlocal>=1.1
  Downloading tzlocal-4.2-py3-none-any.whl (19 kB)
Collecting toml
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting blinker>=1.0.0
  Downloading blinker-1.5-py2.py3-none-any.whl (12 kB)
Collecting watchdog
  Downloading watchdog-2.2.1-py3-none-manylinux2014_x86_64.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.0/79.0 KB 216.9 MB/s eta 0:00:00[2023-02-17 09:14:16.422774] 
Collecting requests>=2.4
  Downloading requests-2.28.2-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 181.4 MB/s eta 0:00:00[2023-02-17 09:14:16.517328] 
Collecting click>=7.0
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 KB 201.3 MB/s eta 0:00:00[2023-02-17 09:14:16.587425] 
Collecting pyarrow>=4.0
  Downloading pyarrow-11.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.9/34.9 MB 180.8 MB/s eta 0:00:00[2023-02-17 09:14:16.967600] 
Collecting python-dateutil
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 189.8 MB/s eta 0:00:00[2023-02-17 09:14:17.065224] 
Collecting packaging>=14.1
  Downloading packaging-23.0-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 KB 123.2 MB/s eta 0:00:00
Collecting importlib-metadata>=1.4
  Downloading importlib_metadata-6.0.0-py3-none-any.whl (21 kB)
Collecting pandas>=0.25
  Downloading pandas-1.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 199.8 MB/s eta 0:00:00[2023-02-17 09:14:17.650993] 
Collecting protobuf<4,>=3.12
  Downloading protobuf-3.20.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 230.4 MB/s eta 0:00:00[2023-02-17 09:14:18.220650] 
Collecting pillow>=6.2.0
  Downloading Pillow-9.4.0-cp39-cp39-manylinux_2_28_x86_64.whl (3.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 213.0 MB/s eta 0:00:00[2023-02-17 09:14:18.786524] 
Collecting semver
  Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)
Collecting rich>=10.11.0
  Downloading rich-13.3.1-py3-none-any.whl (239 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.0/239.0 KB 187.6 MB/s eta 0:00:00[2023-02-17 09:14:19.002188] 
Collecting toolz
  Downloading toolz-0.12.0-py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 KB 151.7 MB/s eta 0:00:00[2023-02-17 09:14:19.062833] 
Collecting entrypoints
  Downloading entrypoints-0.4-py3-none-any.whl (5.3 kB)
Collecting jsonschema>=3.0
  Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 KB 196.8 MB/s eta 0:00:00[2023-02-17 09:14:19.209416] 
Collecting jinja2
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 KB 214.7 MB/s eta 0:00:00[2023-02-17 09:14:19.269570] 
Collecting gitdb<5,>=4.0.1
  Downloading gitdb-4.0.10-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.7/62.7 KB 114.8 MB/s eta 0:00:00[2023-02-17 09:14:19.333572] 
Collecting zipp>=0.5
  Downloading zipp-3.13.0-py3-none-any.whl (6.7 kB)
Collecting pytz>=2020.1
  Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 KB 232.5 MB/s eta 0:00:00[2023-02-17 09:14:19.602952] 
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 KB 183.7 MB/s eta 0:00:00[2023-02-17 09:14:19.856057] 
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 181.7 MB/s eta 0:00:00[2023-02-17 09:14:19.910036] 
Collecting certifi>=2017.4.17
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 145.8 MB/s eta 0:00:00[2023-02-17 09:14:19.993605] 
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (198 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 198.8/198.8 KB 187.3 MB/s eta 0:00:00[2023-02-17 09:14:20.147896] 
Collecting pygments<3.0.0,>=2.14.0
  Downloading Pygments-2.14.0-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 230.2 MB/s eta 0:00:00[2023-02-17 09:14:20.233688] 
Collecting markdown-it-py<3.0.0,>=2.1.0
  Downloading markdown_it_py-2.1.0-py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.5/84.5 KB 142.8 MB/s eta 0:00:00[2023-02-17 09:14:20.302427] 
Collecting pytz-deprecation-shim
  Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Collecting decorator>=3.4.0
  Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting smmap<6,>=3.0.1
  Downloading smmap-5.0.0-py3-none-any.whl (24 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.19.3-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 KB 130.3 MB/s eta 0:00:00[2023-02-17 09:14:20.901061] 
Collecting attrs>=17.4.0
  Downloading attrs-22.2.0-py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 KB 125.8 MB/s eta 0:00:00[2023-02-17 09:14:20.976410] 
Collecting mdurl~=0.1
  Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting tzdata
  Downloading tzdata-2022.7-py2.py3-none-any.whl (340 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 340.1/340.1 KB 230.1 MB/s eta 0:00:00[2023-02-17 09:14:21.197131] 
Building wheels for collected packages: validators
  Building wheel for validators (setup.py): started
  Building wheel for validators (setup.py): finished with status 'done'
  Created wheel for validators: filename=validators-0.20.0-py3-none-any.whl size=19581 sha256=3e8bdb300e422d0bffb7bdca4ca906358ddb72a76b7c1eea5e9942846c823614
  Stored in directory: /tmp/pip-ephem-wheel-cache-nu0t6nk9/wheels/2d/f0/a8/1094fca7a7e5d0d12ff56e0c64675d72aa5cc81a5fc200e849
Successfully built validators
Installing collected packages: pytz, charset-normalizer, zipp, watchdog, urllib3, tzdata, typing-extensions, tornado, toolz, toml, smmap, six, semver, pyrsistent, pympler, pygments, protobuf, pillow, packaging, numpy, mdurl, MarkupSafe, idna, entrypoints, decorator, click, certifi, cachetools, blinker, attrs, validators, requests, pytz-deprecation-shim, python-dateutil, pyarrow, markdown-it-py, jsonschema, jinja2, importlib-metadata, gitdb, tzlocal, rich, pydeck, pandas, gitpython, altair, streamlit
Successfully installed MarkupSafe-2.1.2 altair-4.2.2 attrs-22.2.0 blinker-1.5 cachetools-5.3.0 certifi-2022.12.7 charset-normalizer-3.0.1 click-8.1.3 decorator-5.1.1 entrypoints-0.4 gitdb-4.0.10 gitpython-3.1.31 idna-3.4 importlib-metadata-6.0.0 jinja2-3.1.2 jsonschema-4.17.3 markdown-it-py-2.1.0 mdurl-0.1.2 numpy-1.24.2 packaging-23.0 pandas-1.5.3 pillow-9.4.0 protobuf-3.20.3 pyarrow-11.0.0 pydeck-0.8.0 pygments-2.14.0 pympler-1.0.1 pyrsistent-0.19.3 python-dateutil-2.8.2 pytz-2022.7.1 pytz-deprecation-shim-0.1.0.post0 requests-2.28.2 rich-13.3.1 semver-2.13.0 six-1.16.0 smmap-5.0.0 streamlit-1.18.1 toml-0.10.2 toolz-0.12.0 tornado-6.2 typing-extensions-4.5.0 tzdata-2022.7 tzlocal-4.2 urllib3-1.26.14 validators-0.20.0 watchdog-2.2.1 zipp-3.13.0
WARNING: You are using pip version 22.0.3; however, version 23.0 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.

────────────────────────────────────────────────────────────────────────────────────────

[09:14:37] πŸ“¦ Processed dependencies!

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.




2023-02-17 09:14:54.989 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/app/cm_risk/pages/02_Markets.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'
2023-02-17 09:22:32.854 Uncaught exception GET /_stcore/stream (127.0.0.1)
HTTPServerRequest(protocol='http', host='checkmarkets-cm-risk-01-our-story-bwh5ix.streamlit.app', method='GET', uri='/_stcore/stream', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/tornado/websocket.py", line 942, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/web/server/browser_websocket_handler.py", line 123, in open
    self._session_id = self._runtime.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/runtime.py", line 349, in connect_session
    session_id = self._session_mgr.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/websocket_session_manager.py", line 65, in connect_session
    assert (
AssertionError: session with id 'd5857ba6-ffed-4eae-a4f2-fa02b60291f2' is already connected!
2023-02-17 09:22:33.419 Uncaught exception GET /_stcore/stream (127.0.0.1)
HTTPServerRequest(protocol='http', host='checkmarkets-cm-risk-01-our-story-bwh5ix.streamlit.app', method='GET', uri='/_stcore/stream', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/tornado/websocket.py", line 942, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/web/server/browser_websocket_handler.py", line 123, in open
    self._session_id = self._runtime.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/runtime.py", line 349, in connect_session
    session_id = self._session_mgr.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/websocket_session_manager.py", line 65, in connect_session
    assert (
AssertionError: session with id 'd5857ba6-ffed-4eae-a4f2-fa02b60291f2' is already connected!
2023-02-17 09:22:33.996 Uncaught exception GET /_stcore/stream (127.0.0.1)
HTTPServerRequest(protocol='http', host='checkmarkets-cm-risk-01-our-story-bwh5ix.streamlit.app', method='GET', uri='/_stcore/stream', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/tornado/websocket.py", line 942, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/web/server/browser_websocket_handler.py", line 123, in open
    self._session_id = self._runtime.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/runtime.py", line 349, in connect_session
    session_id = self._session_mgr.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/websocket_session_manager.py", line 65, in connect_session
    assert (
AssertionError: session with id 'd5857ba6-ffed-4eae-a4f2-fa02b60291f2' is already connected!
[...]
AssertionError: session with id 'd5857ba6-ffed-4eae-a4f2-fa02b60291f2' is already connected!
2023-02-17 09:23:04.823 Uncaught exception GET /_stcore/stream (127.0.0.1)
HTTPServerRequest(protocol='http', host='checkmarkets-cm-risk-01-our-story-bwh5ix.streamlit.app', method='GET', uri='/_stcore/stream', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/tornado/websocket.py", line 942, in _accept_connection
    open_result = handler.open(*handler.open_args, **handler.open_kwargs)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/web/server/browser_websocket_handler.py", line 123, in open
    self._session_id = self._runtime.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/runtime.py", line 349, in connect_session
    session_id = self._session_mgr.connect_session(
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/websocket_session_manager.py", line 65, in connect_session
    assert (
AssertionError: session with id 'd5857ba6-ffed-4eae-a4f2-fa02b60291f2' is already connected!
2023-02-17 09:23:05.524 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/app/cm_risk/pages/02_Markets.py", line 2, in <module>
    import yfinance as yf
ModuleNotFoundError: No module named 'yfinance'

The error message already tells you where the problem might be.
You have multiple sources for the external dependencies.
Solution: Remove the Pipfile from your repo.

1 Like

I think you can’t push on github with credentials anymore, as far as I know you have to use the ssh keys method to push by now.

1 Like

Thanks, Franky1, you’re fully right and I was wrong. It’s an incredible pleasure to receive help from pros like you are! Thanks there!
I corrected all scripts from unnecessary modules and tried to clear other issues, too.

However, Streamlit now tells me that I can’t access my api token.

I entered them like that in the secrets.toml file:

eod_api = "XXX"
secret_key = "YYY"

In my py scripts, I access them with this piece of code:

headers = {
	"authorization": st.secrets["eod_api"],
	"authorization": st.secrets["secret_key"]}

Unfortunately, the following error message occurs:

[13:18:40] β›“ Spinning up manager process...

2023-02-17 13:18:50.474 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/cm_risk/pages/02_Markets.py", line 13, in <module>

    c = pyEX.Client(secret_key)

NameError: name 'secret_key' is not defined

Do you happen to know how to go for this issue?

What do you mean by this sentence?

The error messages in your web app suggest that there are quite a few other bugs e.g.

  • you missed plotly
  • you try to load images from local drives
1 Like

I don’t understand what you are trying to achieve with this piece of code:

headers = {
	"authorization": st.secrets["eod_api"],
	"authorization": st.secrets["secret_key"]}
c = pyEX.Client(secret_key)

This example should work:

c = pyEX.Client(st.secrets["secret_key"])
2 Likes

Thanks to you I could deploy my first app successfully, Franky!
Thank you so much! :heart_eyes::pray:t2:
Yet, it only loads successfully on my Mac Mini with 16 GB RAM and Brave as a browser. But I’m sure to find a way to change this to make it accessible for everybody being interested :pray:t2::muscle:t2:

Hooooo dam ok thanks a lot guys !

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