I’m encountering an issue where Flask-Mail is not being recognized or imported in my project directory cloned from Bitbucket, even though it’s installed within the virtual environment and pip list confirms its presence. Despite activating the virtual environment, running any pip commands, Flask-Mail remains unrecognized within the project directory. How can I resolve this?
I initially wrote most of my python code in a local project directory and then when I cloned Bitbucket repository into my local machine and started working on it through the cloned directory.
I first stumbled upon a similar ModuleNotFoundError of twilio.rest in the same cloned repo directory not being recognized.
from flask_mail import Mail, Message ModuleNotFoundError: No module named 'flask_mail'
An acquaintance of mine suggested that I go to the venv->Lib->site-packages of the local project directory and copy-pasted the twilio packages of that directory to the cloned repo directory. And it worked.
When I got the same error with Flask-Mail, I did the same with twilio.rest problem. Copying the Flask-Mail package from the site-packages folder of local project directory’s venv folder and pasting it in the venv->Lib->site-packages of the cloned repo project directory. But it didnt work this time and got the same 'ModuleNotFoundError: No module named 'flask_mail'
(This is the first project I am working on, I am new to this.) Can someone help me with this? And what is the usual procedure of working on a project and when should I clone BitBucket repo?
nandini prattipati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.