Help regarding installation of flask

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.

HOW TO FIX IT

Don’t use pip, use replit.nix instead. Or use a template that has it installed by default

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.

3 Likes

Try creating and activating a venv first

1 Like

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.

2 Likes

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.

1 Like

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

NOT WORKING STILL PLEASE HELP

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)

can you tell

Go to the tool panel, there should be a package tool. Search for flask and add it.

1 Like

No such options present :face_in_clouds:

can you Share the repl?

1 Like

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 )

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.