How do I add Flask-PyMongo to environment.yml?

193 Views Asked by At

I'm trying to add Flask-PyMongo as a dependency to my environment.yml but when trying to push it says the package wasn't found. How do I add Flask-PyMongo so it works?

Link to PyPi for reference

environment.yml file:

name: anon_tool_backend
dependencies:
- flask
- flask-pymongo

Error:

2019-12-05 13:13:53 [STG/0] ERR
2019-12-05 13:13:53 [STG/0] ERR ResolvePackageNotFound:
2019-12-05 13:13:53 [STG/0] ERR - flask-pymongo
2019-12-05 13:13:53 [STG/0] ERR

Thanks in advance!

1

There are 1 best solutions below

1
Ernest Kabahima On

I may not recommend you to install packages to your base environment but if that is what you want, and I think you should not, you need to create a requirement.txt from dependencies. Pip works any weather in yml or requirements.txt

Flask-pymongo works with different package installers like pip, pipenv, conda . may try creating a virtual environment or learn more about them Conda still offers the best to me and then look at these references below;Flask-pymongo documentation

[about pipenv][2]

About Pymongo

Try looking at this for a demo

I hope this helps you work on your project but if you still want to stick to .yml then I think you will need to do a lot of research

[2]: https://pipenv.kennethreitzenter link description here.org/en/latest/