I keep getting this error whenever I try to run my REPL, This worked yesterday but doesnt work today. ImportError: cannot import name 'Flask' from 'flask' (unknown location)
I have tried uninstalling and reinstalling flask, but I get this error when I try using pip. ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/runner/NexusFlow/venv/lib/python3.10/site-packages/Flask-2.2.3.dist-info/METADATA'
Here is all of the imports where I get the error.
from flask import Flask, jsonify, make_response, request, redirect, render_template, url_for
import sys
from json import loads
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
from functools import wraps
import uuid
from flaskext.markdown import Markdown
from sqlalchemy.inspection import inspect
import jwt
from datetime import datetime, timedelta
EDIT:
the solution was to delete and recreate the virtual envronment
Flask is currently installed using poetry, not pip. You can install it with pip if you’d like but right now it’s installed with poetry. poetry remove flask poetry add flask
That’s a weird error message. Poetry should always work as it is Replit’s built-in package manager. Try creating a blank Flask repl and copying the config file contents into this Repl.
I tried using pip for the new REPL but I get this error
Looking in indexes: https://package-proxy.replit.com/pypi/simple/
Requirement already satisfied: flask in ./venv/lib/python3.10/site-packages (2.2.3)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/runner/nexusflow/venv/lib/python3.10/site-packages/Flask-2.2.3.dist-info/METADATA'
I am trying to delete the virtual environment from the github repository and then ill try pulling it again
The virtual environment was the issue something messed up with it, Deleting it in the github repository and recreating it seemed to work to fix my issue
@Minejerik please press the “mark as solution” button below your post so that people will recognize that no more help is needed and the topic will auto-close.