Error received while running python run.py file

An error is thrown for python run.py on Mac
ImportError: cannot import name ‘get_jwt_claims’ from ‘flask_jwt_extended’ (/opt/anaconda3/envs/mflix/lib/python3.9/site-packages/flask_jwt_extended/init.py)

flask_jwt_extended module is already present. Please assist.

Hi @Ruchi_Srivastava

In order to better understand exactly why you are encountering your import error with the run.py, we’ll need some further information to help frame a hypothesis. We can then test this to see if we can resolve your issue.

Can you provide the list of modules installed for your virtual environment and their versions by running the command, pip list , in your virtual environment? I’d like specifically to verify these correspond to the versions listed in the “requirements.txt” file to avoid any versioning issues with those modules where functions may have been renamed or changed.

Can you also provide the version of Python 3 you are running?

Can you also confirm that the import error occurred within your virtual environment and that you had activated the virtual environment before running the “python run.py” command?

This information will help better understand your environment and what may be the factors contributing to your assertion error.

Kindest regards,
Eoin

Hi @Eoin_Brazil,
Please find attached the pip list output:

I have not activated virtual environment before running the “python run.py” command because I had anaconda installed in my system and as tutorial mentioned:
Note: If you installed Anaconda instead, skip this step.

Please let me know if I need to activate virtual environment before running the “python run.py”.

Python version is: Python 3.9.5
Anaconda version: conda 4.9.2

Thank you,
Ruchi

Hi @Ruchi_Srivastava

I think there are two environments here, so you should use only one because we’ve designed the course to use either a virtual environment or a conda environment.

The course also isn’t yet compatible or tested with Python 3.9, so I’d suggest you configure Python 3.8 and create a virtual environment with Python 3.8.

If you can try this and let me know if it resolves your issue.

Kindest regards,
Eoin

Hi @Eoin_Brazil,

I uninstalled 3.9, installed 3.8 and followed the steps as suggested, still I was unable to run the run.py file. As per tutorial, pip and python command wasn’t working for me, then I tried with pip3 and python3, it worked and everything is set now.

Thanks for your help
Ruchi