LondonComputadores / LondonComputadores/grpc-python-flask-microservices
Error: While importing "marketplace", an ImportError was raised:
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Traceback (most recent call last):
File "/home/alexandrepaes/.local/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/alexandrepaes/Documents/projects websites apps ideas all/grpc-python-flask-microservices/marketplace/marketplace.py", line 4, in
import grpc
ModuleNotFoundError: No module named 'grpc'
This couple of lines below comment has been added up temporaly to fix an importation issue of the grpc when running: FLASK_APP=marketplace.py flask run
even after hard installed it and also added it up to this own directory's requirements.txt with pip install instead a simple import
if __name__ == '__main__':
app.run('localhost',50052, debug=True)
Addiional information: Below ate the parameter on marketplace.py that I think that might be misconfigured and causing the bug:
recommendations_host = os.getenv("RECOMMENDATIONS_HOST", "localhost")
recommendations_channel = grpc.insecure_channel(
f"{recommendations_host}:50051" # Already tried port 50052 here but didn't work either.
)
recommendations_client = RecommendationsStub(recommendations_channel)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with marketplace/marketplace.py and its requirements.txt, then reproduce the reported command: FLASK_APP=marketplace.py flask run. Check why importing grpc fails despite the dependency being installed; done means the marketplace app imports and starts without the reported ImportError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, grpc, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100