Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'megaparse.api' - in docker setup #147

Open
JayaKrishna-P opened this issue Nov 23, 2024 · 6 comments

Comments

@JayaKrishna-P
Copy link

JayaKrishna-P commented Nov 23, 2024

When running 'sudo make dev', i get the below error:

 => => exporting layers                                                                                            0.0s
 => => writing image sha256:70203052eb52378760709c628b60f98870d3e701267cf2f010aeb943ea9766c2                       0.0s
 => => naming to docker.io/library/megaparse:latest                                                                0.0s
 => [megaparse] resolving provenance for metadata file                                                             0.0s
[+] Running 1/0
 ✔ Container megaparse  Recreated                                                                                  0.0s
Attaching to megaparse
megaparse  | INFO:     Will watch for changes in these directories: ['/app']
megaparse  | INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
megaparse  | INFO:     Started reloader process [1] using StatReload
megaparse  | /usr/local/lib/python3.11/site-packages/pydantic/_internal/_fields.py:132: UserWarning: Field "model_name" in UploadFileConfig has conflict with protected namespace "model_".
megaparse  |
megaparse  | You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
megaparse  |   warnings.warn(
megaparse  | Process SpawnProcess-1:
megaparse  | Traceback (most recent call last):
megaparse  |   File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
megaparse  |     self.run()
megaparse  |   File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
megaparse  |     self._target(*self._args, **self._kwargs)
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
megaparse  |     target(sockets=sockets)
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
megaparse  |     return asyncio.run(self.serve(sockets=sockets))
megaparse  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
megaparse  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
megaparse  |     return runner.run(main)
megaparse  |            ^^^^^^^^^^^^^^^^
megaparse  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
megaparse  |     return self._loop.run_until_complete(task)
megaparse  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
megaparse  |   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
megaparse  |     await self._serve(sockets)
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
megaparse  |     config.load()
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
megaparse  |     self.loaded_app = import_from_string(self.app)
megaparse  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
megaparse  |     raise exc from None
megaparse  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
megaparse  |     module = importlib.import_module(module_str)
megaparse  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
megaparse  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
megaparse  |     return _bootstrap._gcd_import(name[level:], package, level)
megaparse  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
megaparse  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
megaparse  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
megaparse  |   File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
megaparse  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
megaparse  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
megaparse  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
megaparse  |   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
megaparse  | ModuleNotFoundError: No module named 'megaparse.api'

while building the image, this is the only error i see:

=> ERROR [megaparse] importing cache manifest from megaparse:latest 1.6s

@JayaKrishna-P JayaKrishna-P changed the title ModuleNotFoundError: No module named 'megaparse.api' ModuleNotFoundError: No module named 'megaparse.api' - in docker setup Nov 23, 2024
@geoHeil
Copy link

geoHeil commented Dec 5, 2024

#158 might be related. I am observing the same issue the last tag (0.0.21) still seems to build the container though - but is really old.

@pmkrawczyk
Copy link

pmkrawczyk commented Dec 5, 2024

I get the same on docker compose up (so non-dev setup)

@StanGirard
Copy link
Contributor

@chloedia can you take a look

@russellballestrini
Copy link

bump I'm very interested in using this software but it throws this error.

@KennethBore
Copy link

I also get this error. I'm interested in using this for a project I'm working on

@russellballestrini
Copy link

russellballestrini commented Dec 11, 2024

Work around fork to unblock your research:

https://git.unturf.com/engineering/unturf/megafarce

Single file application avoids this class of module error.

Live demo here, view source

https://ai.unturf.com/demo.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants