You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have dots in the packagename (e.g., openapi.client), then required directory structure is getting created like openapi/client. Inside openapi/client/, we will have api and models directories. But, __init__.py files are missing from those sub directories(at openapi and client level). So, the users of this built package will face ModuleNotFoundError: No module named 'openapi' error.
saigiridhar21
changed the title
[BUG][Python] ModuleNotFoundError when package names contains dots
[BUG][Python] ModuleNotFoundError when packagename contains dots
May 24, 2019
Bug Report Checklist
Description
If we have dots in the packagename (e.g., openapi.client), then required directory structure is getting created like
openapi/client
. Insideopenapi/client/
, we will have api and models directories. But,__init__.py
files are missing from those sub directories(at openapi and client level). So, the users of this built package will faceModuleNotFoundError: No module named 'openapi'
error.openapi-generator version
4.0.0
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate --generator-name python --input-spec openapi-schema.json --output openapi.client --additional-properties packagename=openapi.client
Steps to reproduce
ModuleNotFoundError: No module named 'openapi'
Related issues/PRs
Suggest a fix
If the packagename contain dots, add
__init__.py
files at each sub directory level.The text was updated successfully, but these errors were encountered: