Bentoml: Python packaged model implicitly requires bentoml package

Created on 25 Nov 2019  路  3Comments  路  Source: bentoml/BentoML

Describe the bug

A Python package built by BentoML requires the bentoml Python package implicitly.

To Reproduce

$ pip install my_packaged_model

Then:

>>> import my_packaged_model
ModuleNotFoundError: No module named 'bentoml'

Not only do I need to install BentoML, I need to install the precise version used to create the Python package, else the package fails to import because of apparent BentoML API changes.

Expected behavior

import my_packaged_model should Just Work.

Environment:

  • OS: Arch Linux
  • Python Version: Both Python 3.8.0 (Arch Linux) and Docker image python:3.7
  • BentoML Version: Both 0.4.9 and 0.5.0
bug

All 3 comments

@Kevlar1818 Thanks for reporting this issue! The BentoML package should indeed be added to the install_requires list with fixed version, will follow up with a PR soon.

The fix has just been merged to master https://github.com/bentoml/BentoML/pull/396 @kevlar1818 thanks again for reporting the issue.

We will do some more testing before making a release, in the meanwhile, feel free to try it out by installing BentoML from master branch: pip install git+https://github.com/bentoml/BentoML.git

Release 0.5.2 is out now including the fix. It should be able to use saved BentoService bundle as PyPI package with all the pip dependencies specified with the setup.py file.

Closing this issue now, feel free to reopen if you are still seeing this/related issues with it.

Was this page helpful?
0 / 5 - 0 ratings