Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AttributeError: partially initialized module 'graphene' has no attribute 'ObjectType' (most likely due to a circular import)

オープン
#1,373 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
graphql, python
領域
api, backend

調査の方向性

issue 内の traceback と最小限の Python 例から始め、ローカルの v4/graphql.py エントリーポイントと graphene のインポートチェーンに注意してください。報告された動作を、記載された Python 3.9.7 環境で再現できるか確認してください。完了とは、これが Graphene のバグなのか、例のモジュール構成に固有の問題なのかを特定することです。

索引モデルが issue の本文から書いたものです。

説明

🐛 bug

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • What is the current behavior?
  File "/Users/noj/recurrency/legacy-api/v4/graphql.py", line 1, in <module>
    import graphene
  File "/opt/homebrew/lib/python3.9/site-packages/graphene/__init__.py", line 3, in <module>
    from .types import (
  File "/opt/homebrew/lib/python3.9/site-packages/graphene/types/__init__.py", line 2, in <module>
    from graphql import ResolveInfo
  File "/Users/noj/recurrency/legacy-api/v4/graphql.py", line 3, in <module>
    class Query(graphene.ObjectType):
AttributeError: partially initialized module 'graphene' has no attribute 'ObjectType' (most likely due to a circular import)
  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    a github repo, https://repl.it or similar.
import graphene

class Query(graphene.ObjectType):
    hello = graphene.String(description='A typical hello world')

    def resolve_hello(self, info):
        return 'World'

schema = graphene.Schema(query=Query)

if __name__ == "__main__":
    query = '''
        query SayHello {
          hello
        }
    '''
    result = schema.execute(query)

    print (result)

  • What is the expected behavior?

No errors.

  • Please tell us about your environment:

    • Version: Python 3.9.7
    • Platform: Mac
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

主要言語
Python
スター
8.2k
フォーク
818
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphql-python/graphene のほかの issue

graphql-python/graphene の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。