Skip to content

ModuleNotFoundError for a Pyodide package #570

@qu8n

Description

@qu8n

The docs showed that Pyodide official packages can be simply imported in the code snippet. In the example, the asciitree import works.

However, I tried importing the tiktoken package, which I confirmed to be part of the Pyodide packages, and got this error:

Traceback (most recent call last):
ModuleNotFoundError: No module named 'tiktoken'

The code snippet I used:

import tiktoken

enc = tiktoken.get_encoding("cl100k_base")
text = "Hello, World"

tokens = enc.encode(text)
print(tokens)

We can reproduce this error by running the snippet above in any of the code runners in the docs site.

Could I be missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions