[Bug]: cannot import name 'Spec' from 'openapi_core' version 0.23.1

Open
#1,225 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api

Research direction

Reproduce the failure with pip install openapi-core and from openapi_core import Spec using version 0.23.1. Inspect the openapi_core/__init__.py export shown in the traceback and related package tests or documentation. Done means the reported import works without an ImportError, with the intended public API confirmed.

Written by the indexing model from the issue text.

Description

kind/bug
Actual Behavior

It is impossible to import Spec from openapi_core installed with pip.

Traceback (most recent call last):
   <Package that calls Spec>
    from openapi_core import Spec
ImportError: cannot import name 'Spec' from 'openapi_core' (/opt/anaconda3/envs/native/lib/python3.13/site-packages/openapi_core/__init__.py)
Expected Behavior

There should be no error.

Steps to Reproduce

pip install openapi-core, then run a python script with from openapi_core import Spec.

OpenAPI Core Version

0.23.1

OpenAPI Core Integration

Don't know

Affected Area(s)

importing in another program

References

No response

Anything else we need to know?

No response

Would you like to implement a fix?

None

Dominant language
Python
Stars
368
Forks
140
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-openapi/openapi-core

All issues in python-openapi/openapi-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.