how to install flask in replit
when i install : pip install flask
it shows: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: ‘/nix/store/mycsjqkf0adh8wsl3pf5kn29ag9gi6x2-python3-3.8.15/lib/python3.8/site-packages/zipp’
Consider using the --user option or check the permissions.
Welcome to the community! The default Python template has Flask installed already. Just add import flask or some other import statement to the beginning of your Py file.
Not sure if this works for blank Repls or just python templates, but typically just put import flask at the top if your code as you would if it already was installed. Replit should automatically install it for you.
Yes I can confirm that if guess imports is on (which it is by default in Python Repls) it will automatically install anything that poetry thinks your Repl needs (such as a dependency like flask). In addition, as I previously stated, flask should be installed already. If it’s not working, perhaps the installation attempts broke the Repl. Try making a new Repl if this doesn’t work.
python app.py
Traceback (most recent call last):
File “app.py”, line 1, in
from flask import Flask
ModuleNotFoundError: No module named ‘flask’
exit status 1
Can you share the repl?
Is it using the official replit template?
If import flask fails, use the package tool to install it or allow auto guess import (see .replit and set it to true)
Bro its working now, it was my mistake while I imported it my project from github replit auto selected
“bash flask” rather than selecting python that’s why it shows error ]. After that I again imported my repo again from github but selected language python. You can compare the 2 SS .
Thankyou very much to whole replit community. ( I am new here and I am loving it <3 )