ankitsejwal / Lyndor

:rocket: Powerful command line tool to download lynda.com courses for personal offline use. :part_alternation_mark:
MIT License
131 stars 32 forks source link

error of "ModuleNotFoundError: No module named 'flask'" when installing #72

Closed banpie closed 6 years ago

banpie commented 6 years ago

Please follow the guide below


Make sure you are using the latest version: run git pull to update your version from Lyndor directory

Before submitting an issue make sure you have:

What is the purpose of your issue?


If the purpose of this issue is a bug report, or you are not completely sure then provide the full terminal output as follows:

Copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

python settings/settings.py
Traceback (most recent call last):
  File "settings/settings.py", line 6, in <module>
    from flask import Flask, request, jsonify, render_template
ModuleNotFoundError: No module named 'flask'

Answer questions related to your Environment which will help in reproducing the issue:

The issue was encountered on: :computer:

Login method:

Enter the python version you are using for download. Find your python version by typing in terminal python -V


If the purpose of this issue is a bug report please provide all kinds of example URLs where you encountered issues (replace following example URLs by yours):


Description of your issue, suggested a solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.

banpie commented 6 years ago

I have tried those:

which flask
/usr/local/bin/flask
pip install flask
Requirement already satisfied: flask in /usr/local/lib/python2.7/site-packages (1.0.2)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/site-packages (from flask) (2.10)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/site-packages (from flask) (0.24)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/site-packages (from flask) (6.7)
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/site-packages (from flask) (0.14.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/site-packages (from Jinja2>=2.10->flask) (1.0)
ankitsejwal commented 6 years ago

Hi, @banpie it seems you have both Python 2 and 3 installed in your system. When you are running

pip install flask

These packages are being installed in python2.7 which comes by default in MacOS So you can try

# to download a single package
pip3 install flask
# or to download all the packages from requirements.txt
pip3 install -r requirements.txt    # (This should install all the modules in Python3)

# you can run settings.py in python 3
python3 settings/settings.py

I use this cool tool to manage several python versions on my machine https://github.com/pyenv/pyenv, you can set a default global python version or a local python version for a project as well.

Cheers ANk

banpie commented 6 years ago

Thanks for your reply. I think I was using python 3.6 before, as I have add those code to the bash_profile file:

alias python=”/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6”

and I also have tried you solution, but got those:

pip3 install flask

Requirement already satisfied: flask in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already satisfied: Jinja2>=2.10 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from flask)
Requirement already satisfied: itsdangerous>=0.24 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from flask)
Requirement already satisfied: Werkzeug>=0.14 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from flask)
Requirement already satisfied: click>=5.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from flask)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from Jinja2>=2.10->flask)
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

then

pip install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages (18.1)

but, when i use python3 settings/settings.py, it did works.

arjunhpes commented 4 years ago

Better to use pip3 for Python3+ version

Python2 Sysntax : pip install flask Python3+ Sysntax : pip3 install flask

ankit3110 commented 4 years ago

Hi i am facing an issue over here ModuleNotFoundError: No module named 'flask'

ankit3110 commented 4 years ago

I tried evrything pip3 install Flask Requirement already satisfied: Flask in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (1.1.2) Requirement already satisfied: click>=5.1 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (7.1.2) Requirement already satisfied: Jinja2>=2.10.1 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (2.11.2) Requirement already satisfied: itsdangerous>=0.24 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (1.1.0) Requirement already satisfied: Werkzeug>=0.15 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (1.0.1) Requirement already satisfied: MarkupSafe>=0.23 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Jinja2>=2.10.1->Flask) (1.1.1)

ankit3110 commented 4 years ago

pip3 install Flask Requirement already satisfied: Flask in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (1.1.2) Requirement already satisfied: click>=5.1 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (7.1.2) Requirement already satisfied: Jinja2>=2.10.1 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (2.11.2) Requirement already satisfied: itsdangerous>=0.24 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (1.1.0) Requirement already satisfied: Werkzeug>=0.15 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Flask) (1.0.1) Requirement already satisfied: MarkupSafe>=0.23 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from Jinja2>=2.10.1->Flask) (1.1.1)

ankit3110 commented 4 years ago

pip3 install virtualenv Requirement already satisfied: virtualenv in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (20.0.30) Requirement already satisfied: filelock<4,>=3.0.0 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from virtualenv) (3.0.12) Requirement already satisfied: appdirs<2,>=1.4.3 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from virtualenv) (1.4.4) Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from virtualenv) (0.3.1) Requirement already satisfied: six<2,>=1.9.0 in c:\users\ankit kumar\appdata\local\programs\python\python39\lib\site-packages (from virtualenv) (1.15.0)

saksham1709 commented 4 years ago

i am having the same issues

ankitsejwal commented 4 years ago

Hi guy at what point are you guys getting these errors? Please write you input. ex:

python settings/settings.py
ankit3110 commented 4 years ago

@saksham1709 close all the applications and restart the computer. sometime it doesn't read the flask.

angel951127 commented 3 years ago

oot@kali:~/Escritorio/SocialFish# python3 SocialFish.py Traceback (most recent call last): File "/root/Escritorio/SocialFish/SocialFish.py", line 3, in from flask import Flask, request, render_template, jsonify, redirect, g, flash ModuleNotFoundError: No module named 'flask' root@kali:~/Escritorio/SocialFish#

angel951127 commented 3 years ago

oot@kali:~/Escritorio/SocialFish# python3 SocialFish.py Traceback (most recent call last): File "/root/Escritorio/SocialFish/SocialFish.py", line 3, in from flask import Flask, request, render_template, jsonify, redirect, g, flash ModuleNotFoundError: No module named 'flask' root@kali:~/Escritorio/SocialFish#

as271996 commented 3 years ago

I'm trying to install pgadmin4 for postgresql but i'm getting following error, $ sudo apt-get install pgadmin4 pgadmin4-apache2 Reading package lists... Done Building dependency tree
Reading state information... Done pgadmin4-apache2 is already the newest version (4.25-1.pgdg18.04+1). pgadmin4 is already the newest version (4.29). 0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up pgadmin4-apache2 (4.25-1.pgdg18.04+1) ... apache2_invoke pgadmin4: already enabled Traceback (most recent call last): File "setup.py", line 18, in from pgadmin.model import db, User, Version, ServerGroup, Server, \ File "/usr/share/pgadmin4/web/pgadmin/init.py", line 19, in from flask import Flask, abort, request, current_app, session, url_for ModuleNotFoundError: No module named 'flask' dpkg: error processing package pgadmin4-apache2 (--configure): installed pgadmin4-apache2 package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: pgadmin4-apache2 E: Sub-process /usr/bin/dpkg returned an error code (1)

bejohns commented 3 years ago

total novice here, b ut i'm getting same erros no matter how many times i intall flask by italf or from requirements.txt. only time i made any headway in troublshooting the problem was shen I mucked around with the ssh key and github account, but now can't find the help file i was using! lol

ajaypediredla14 commented 3 years ago

Hi guy at what point are you guys getting these errors? Please write you input. ex:

python settings/settings.py

C:\Users\91939\AppData\Local\Programs\Python\Python38-32\python.exe: can't open file 'settings/settings.py': [Errno 2] No such file or directory

johnlarrywright commented 1 year ago

when changing the env to use python2 I get this when trying to run empire

Traceback (most recent call last): File "./empire", line 5, in from flask import Flask, request, jsonify, make_response, abort, url_for ImportError: No module named flask

When running regular using just python instead of 2 I get this File "/opt/Empire/./empire", line 35 print '[*] Fresh start in docker, running reset.sh for you' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

I see alot of people been reporting this issue using different thread sites. Is this thing broken due to new kali linux?