Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Error when importing flask_graphql

Offen
#92 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
flask, graphql, python
Bereich
api, backend

Rechercherichtung

Beginne damit, den Import mit den Versionen aus requirements.txt unter Python 3.10 zu reproduzieren. Untersuche die im Traceback genannten Pfade flask_graphql/init.py, blueprint.py, graphqlview.py und graphql_server/init.py; als erledigt gilt die Aufgabe, wenn der gemeldete Import ohne den MutableMapping-Fehler erfolgreich ist und der relevante Test- oder Anwendungsstartpfad erfolgreich durchläuft.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Unable to import this library into my project. I always get an ImportError even if I create a new project with only one import.

My code api.py

from http.client import HTTPException
from multiprocessing import AuthenticationError
import os
from flask import Flask, request, jsonify, abort
from sqlalchemy import exc
import json
from flask_cors import CORS
from graphene import ObjectType, String, Schema
from flask_graphql import GraphQLView

app = Flask(__name__)

My requirements.txt
In the beginning, I specify the version of each library, but there was an error. To solve the error, I removed the FLask-GraphQL because it is in conflict with other graphene dependency. As it said, could not import flask_graphql I remove graphene version and specify the last version in the Flask-GraphQL so that my project use the last version of this library and solve the dependency conflict with graphene. But always the same error.

Flask == 2.2.2
Flask-SQLAlchemy == 3.0.2
Jinja2 == 3.1.2
pylint == 2.15.9
Flask-Cors == 3.0.10
graphene  #For graphql python support
Flask-GraphQL == 2.0.1

Error message

Error: While importing 'src.api', an ImportError was raised:

Traceback (most recent call last):
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/venv/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
    __import__(module_name)
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/src/api.py", line 9, in <module>
    from flask_graphql import GraphQLView
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/venv/lib/python3.10/site-packages/flask_graphql/__init__.py", line 1, in <module>
    from .blueprint import GraphQL
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/venv/lib/python3.10/site-packages/flask_graphql/blueprint.py", line 5, in <module>
    from .graphqlview import GraphQLView
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/venv/lib/python3.10/site-packages/flask_graphql/graphqlview.py", line 7, in <module>
    from graphql_server import (HttpQueryError, default_format_error,
  File "/home/sticlab/Documents/NotebookProject/rasa-car-location-services/backend/venv/lib/python3.10/site-packages/graphql_server/__init__.py", line 2, in <module>
    from collections import namedtuple, MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Vorherrschende Sprache
Python
Sterne
1.3k
Forks
138
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus graphql-python/flask-graphql

Alle Issues in graphql-python/flask-graphql

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.