voxel51 / fiftyone-docs-search

Search docs.voxel51.com with an LLM!
Apache License 2.0
356 stars 60 forks source link

fiftyone-docs-search using fiftyone error #10

Closed JansenSmith closed 8 months ago

JansenSmith commented 1 year ago

I'm not exactly certain what the issue here is, but it looks like I'm getting ModuleNotFoundError: No module named 'fiftyone.__public__' despite fiftyone being at version 0.21.0

jansen@chonkers:~/git/fiftyone-docs-search$ pip show fiftyone
Name: fiftyone
Version: 0.21.0

full stacktrace:

jansen@foo:~/git/fiftyone-docs-search$ sudo fiftyone-docs-search --help
Traceback (most recent call last):
  File "/usr/local/bin/fiftyone-docs-search", line 33, in <module>
    sys.exit(load_entry_point('fiftyone-docs-search', 'console_scripts', 'fiftyone-docs-search')())
  File "/usr/local/bin/fiftyone-docs-search", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/jansen/git/fiftyone-docs-search/fiftyone/__init__.py", line 10, in <module>
    from fiftyone.__public__ import *
ModuleNotFoundError: No module named 'fiftyone.__public__'
jansen@foo:~/git/fiftyone-docs-search$ pip show fiftyone
Name: fiftyone
Version: 0.21.0
Summary: FiftyOne: the open-source tool for building high-quality datasets and computer vision models
Home-page: https://github.com/voxel51/fiftyone
Author: Voxel51, Inc.
Author-email: info@voxel51.com
License: Apache
Location: /home/jansen/.local/lib/python3.10/site-packages
Requires: aiofiles, argcomplete, boto3, cachetools, dacite, Deprecated, eventlet, fiftyone-brain, fiftyone-db, ftfy, future, hypercorn, Jinja2, kaleido, matplotlib, mongoengine, motor, numpy, opencv-python-headless, packaging, pandas, Pillow, plotly, pprintpp, psutil, pymongo, pytz, PyYAML, regex, retrying, scikit-image, scikit-learn, setuptools, sse-starlette, sseclient-py, starlette, strawberry-graphql, tabulate, universal-analytics-python3, voxel51-eta, xmltodict
Required-by:
jacobmarks commented 1 year ago

Hi @JansenSmith, thanks for filing this - and sorry you are seeing this issue! I think the problem here might be that be you are importing fiftyone inside of the docs-search repo. If you change to a different directory and try again, you should be alright :)

The reason for this is that docs-search has a fiftyone module inside it, so that you can access the docs search module the same way other fiftyone modules are accessed:

from fiftyone.docs_search import FiftyOneDocsSearch
from fiftyone.types import LabeledVideoDataset

does this make sense?

Let me know if you're still experiencing an issue!

jacobmarks commented 8 months ago

Hey @JansenSmith, I'm going to close the issue for now, but please let me know if you still want help!