Dennis
February 28, 2024, 8:48am
1
I got the feedback below while trying to deploy my app. Anyone with some assistance?
ImportError: cannot import name 'NewsApiClient' from 'newsapi' (/home/adminuser/venv/lib/python3.9/site-packages/newsapi/__init__.py)
2024-02-28 08:46:02.355 503 GET /script-health-check (10.12.123.4) 48.26ms
here’s the github repo
Goyo
February 28, 2024, 9:12am
2
Do you expect 'NewsApiClient' to be defined in 'newsapi'? Why is that?
Dennis
February 28, 2024, 10:03am
3
But the script runs just perfectly on PC, can’t figure out why it fails on cloud.
Goyo
February 28, 2024, 10:08am
4
Maybe because you have a different newsapi installed.
Dennis
February 28, 2024, 10:18am
5
should I include my newsapi version on the requirements file?
Dennis
February 28, 2024, 11:55am
7
I’m now getting the error code below:
Collecting bs4
Downloading bs4-0.0.2-py2.py3-none-any.whl (1.2 kB)
ERROR: Could not find a version that satisfies the requirement newsapi==0.2.7 (from versions: 0.1.0, 0.1.1)
ERROR: No matching distribution found for newsapi==0.2.7
WARNING: You are using pip version 22.0.3; however, version 24.0 is available.
You should consider upgrading via the '/home/adminuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed
Dennis
February 28, 2024, 12:12pm
8
figured it, it’s newsapi-python not news api
1 Like
Dennis
February 28, 2024, 12:17pm
9
I however ran into another problem, the app is deployed but my api keys are not defined, i pasted them on the secrets under advanced settings
Goyo
February 28, 2024, 12:41pm
10
Indeed, news_api_key is undefined. Putting stuff in secrets is not going to magically define it.
system
Closed
August 26, 2024, 1:11pm
12
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.