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

Using the gensim module (NLP) #2545

Closed
Amodio opened this issue May 11, 2022 · 1 comment
Closed

Using the gensim module (NLP) #2545

Amodio opened this issue May 11, 2022 · 1 comment

Comments

@Amodio
Copy link
Contributor

Amodio commented May 11, 2022

🐍 Package Request

Hello, I am unable to load the gensim module (for doing NLP in the browser) with micropip: ValueError: 'gensim-4.2.0-cp310-cp310-win_amd64.whl' is not a pure Python 3 wheel
Is there any solution to fix this or is someone working on including it to pyodide?

Loading another module by URL works on the same host:

      async function main() {
        let pyodide = await loadPyodide()
        await pyodide.loadPackage("micropip")
        await pyodide.runPythonAsync(`
        import micropip
        await micropip.install('https://files.pythonhosted.org/packages/ed/dc/c02e01294f7265e63a7315fe086dd1df7dacb9f840a804da846b96d01b96/snowballstemmer-2.2.0-py2.py3-none-any.whl')
        print(micropip.list()) 
      `)

Thanks

@dopplershift
Copy link
Contributor

The gensim wheel you mention is pre-compiled for x86_64 for Windows, while the other wheel (for snowballstemmer) only contains Python code. Using gensim in pyodide will require adding it as a package to pyodide so that the C/C++ code in gensim is compiled to Wasm.

rth pushed a commit that referenced this issue Dec 6, 2022
@Amodio Amodio closed this as completed Dec 7, 2022
dcherian added a commit to dcherian/pyodide that referenced this issue Dec 13, 2022
* main: (45 commits)
  Remove pre-built docker image support (pyodide#3342)
  Remove "Python initialization complete" log line (pyodide#3247)
  Use a more robust method to improve our ModuleNotFound errors (pyodide#3263)
  Distinguish between sync and async JavaScript iterators when possible (pyodide#3339)
  [pre-commit.ci] pre-commit autoupdate (pyodide#3345)
  NFC Place js_flags in separate dict (pyodide#3338)
  NFC Use initialization function to load _pyodide_core (pyodide#3333)
  Make fs timestamps have millisecond resolution rather than second resolution (pyodide#3313)
  Add gensim package pyodide#2545 (pyodide#3326)
  [pre-commit.ci] pre-commit autoupdate (pyodide#3325)
  Update scikit-learn to 1.1.3 (pyodide#3324)
  Fix markdown in doc (pyodide#3323)
  Emscripten 3.1.27 (pyodide#3314)
  [pre-commit.ci] pre-commit autoupdate (pyodide#3254)
  Add a typeshed for the js module (pyodide#3298)
  Unpin host Python patch versions in GHA (pyodide#3309)
  Package pyinstrument (pyodide#3258)
  Add athrow and aclose to JsProxy of an AsyncGenerator (pyodide#3299)
  Add test for MutableMapping methods on object_maps and fix bug (pyodide#3297)
  Bump minimatch from 3.0.4 to 3.1.2 in /src/js (pyodide#3306)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants