ModuleNotFoundError: No module named 'jiter.jiter' when Importing openai Package
envgap__openai__openai-python-1864
Original GitHub issue ↗Opened 2024-11-12
01 / FAILURE SIGNATURE
As reported upstream
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.
Not a benchmark task.
- No curated issue-specific recipe or verified environment fix is available.
02 / ENVIRONMENT RECIPE
- Base commit
Not freshly verified- Manifest
requirements.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
openai/openai-python #1864 · read the original issue
### Confirm this is an issue with the Python library and not an underlying OpenAI API
- [X] 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
```Python
(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 (
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]
Issue-specific recipe and runtime smoke command require review against the complete issue and repository.
Legacy already_works is install-only; proposed control still requires runtime verification.