Skip to content

require-python hides useful python error messages #159

@behrica

Description

@behrica

By doing this

(libpython-clj2.require/require-python '[top2vec])

vs.

(py/import-module "top2vec")

the first hides the root cause of an issue with the module.
Only the import-module prints this on the console:

Execution error at libpython-clj2.python/path->py-obj (python.clj:627).
Failed to find module or class top2Vec
Execution error at libpython-clj2.python.ffi/check-error-throw (ffi.clj:670).
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/top2vec/__init__.py", line 1, in <module>
    from top2vec.Top2Vec import Top2Vec
  File "/usr/local/lib/python3.9/site-packages/top2vec/Top2Vec.py", line 20, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

while require-python only gives this stacktrace:

 Unhandled java.lang.Exception
   Failed to find module or class top2Vec

                python.clj:  627  libpython-clj2.python/path->py-obj
                python.clj:  608  libpython-clj2.python/path->py-obj
               RestFn.java:  439  clojure.lang.RestFn/invoke
               require.clj:  109  libpython-clj2.require/do-require-python
               require.clj:   86  libpython-clj2.require/do-require-python
               require.clj:  273  libpython-clj2.require/require-python/fn
               require.clj:  265  libpython-clj2.require/require-python
               require.clj:  173  libpython-clj2.require/require-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy