I have a project using python eve, but lately I have been running into an infuriating dependency problem with pip.
I use a requirements.txt file to install the dependencies in a docker container
however installing the Eve
package installs pymongo
as a depdency. pymongo
depends on a bson
module, but not the pypi bson
module. However, pip install the pypi bson
module which will not work with pymongo, leading to an error of:
from bson.py3compat import abc, string_type, PY3, text_type
ImportError: cannot import name 'abc'
when pymongo is imported.
I have to adjust my dockerfile to do something like this:
RUN pip3 install -r requirements.txt
RUN pip3 uninstall bson --yes
RUN pip3 uninstall pymongo --yes
RUN pip3 install pymongo --user
Is there a way to indicate in a pipefile or a requirements.txt that it needs to not attempt to install bson from pypi?