Skip to content

ModuleNotFoundError: No module named 'jiter.jiter' when Importing openai Package #1864

@fedorowych

Description

@fedorowych

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

Description
I'm encountering a ModuleNotFoundError when attempting to import the openai Python library. The error indicates that the jiter.jiter module is missing, preventing the import from succeeding.

Error Message
plaintext
Copy code
ModuleNotFoundError: No module named 'jiter.jiter'

To Reproduce

Steps to Reproduce
Set Up Virtual Environment:

bash
Copy code
python -m venv myenv_py311
myenv_py311\Scripts\activate # On Windows
Install openai:

bash
Copy code
pip install openai==1.54.3
Also tried openai==1.53.0 with the same result.
Install jiter from GitHub:

bash
Copy code
pip install git+https://github.com/openai/jiter.git
Attempt to Import openai:

python
Copy code
import openai
Result: Raises ModuleNotFoundError: No module named 'jiter.jiter'
Additional Steps Taken:

Uninstalled External jiter:
bash
Copy code
pip uninstall jiter
Reinstalled openai:
bash
Copy code
pip uninstall openai
pip install openai
Verified Package Structure:
Checked the jiter package directory; jiter.py is present after installing from GitHub.
Created a Fresh Virtual Environment:
Issue persists even in a new environment.

Code snippets

(myenv) D:\Resume Project>python -c "import openai"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import openai
  File "D:\Resume Project\myenv\Lib\site-packages\openai\__init__.py", line 11, in <module>
    from ._client import Client, OpenAI, Stream, Timeout, Transport, AsyncClient, AsyncOpenAI, AsyncStream, RequestOptions
  File "D:\Resume Project\myenv\Lib\site-packages\openai\_client.py", line 11, in <module>
    from . import resources, _exceptions
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\__init__.py", line 3, in <module>
    from .beta import (
    ...<6 lines>...
    )
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\beta\__init__.py", line 3, in <module>
    from .beta import (
    ...<6 lines>...
    )
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\beta\beta.py", line 14, in <module>
    from .chat.chat import Chat, AsyncChat
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\beta\chat\__init__.py", line 3, in <module>
    from .chat import Chat, AsyncChat
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\beta\chat\chat.py", line 6, in <module>
    from .completions import Completions, AsyncCompletions
  File "D:\Resume Project\myenv\Lib\site-packages\openai\resources\beta\chat\completions.py", line 27, in <module>
    from ....lib.streaming.chat import ChatCompletionStreamManager, AsyncChatCompletionStreamManager
  File "D:\Resume Project\myenv\Lib\site-packages\openai\lib\streaming\chat\__init__.py", line 21, in <module>
    from ._completions import (
    ...<4 lines>...
    )
  File "D:\Resume Project\myenv\Lib\site-packages\openai\lib\streaming\chat\_completions.py", line 8, in <module>
    from jiter import from_json
  File "D:\Resume Project\myenv\Lib\site-packages\jiter\__init__.py", line 1, in <module>
    from .jiter import *
ModuleNotFoundError: No module named 'jiter.jiter'

OS

Windows 11

Python version

Python 3.13

Library version

both OpenAI 1.54. 3 AND 1.53.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions