Python Flask Blueprints “project.routes.loginScreen import login_blueprint ImportError: No module named...












0















thank you in advance, I am a python novice--I'm working on a school group project, and they insist on using Blueprints with Flask. We're all working on Macs. I'm doing a clean clone of the repo, and getting this error when trying to run "python app.py" :



from project.routes.loginScreen import login_blueprint
ImportError: No module named routes.loginScreen


However, they can run the same code. I am so stumped, since there must be an environmental difference on my machine--I don't think the import headers matter since again, they can run this with no additional steps.



I already set 'export PYTHONDONTWRITEBYTECODE="true"' in my bash profile, and "git status' returns "working tree clean."



This is our file structure with modular routes:



├── __pycache__
│   └── app.cpython-37.pyc
├── app.py
├── create_tables.sql
└── project
├── __init__.py
├── __pycache__
│   └── __init__.cpython-37.pyc
├── routes
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── addCorkboard.cpython-37.pyc
│   │   ├── addPushPin.cpython-37.pyc
│   │   ├── followUser.cpython-37.pyc
│   │   ├── likePushPin.cpython-37.pyc
│   │   ├── loginScreen.cpython-37.pyc
│   │   ├── postComment.cpython-37.pyc
│   │   ├── searchPushPin.cpython-37.pyc
│   │   ├── viewCorkboard.cpython-37.pyc
│   │   ├── viewHomescreen.cpython-37.pyc
│   │   ├── viewPopularSites.cpython-37.pyc
│   │   ├── viewPopularTags.cpython-37.pyc
│   │   ├── viewPushPin.cpython-37.pyc
│   │   ├── viewStatistics.cpython-37.pyc
│   │   └── watchCorkboard.cpython-37.pyc
│   ├── addCorkboard.py
│   ├── addPushPin.py
│   ├── followUser.py
│   ├── likePushPin.py
│   ├── loginScreen.py
│   ├── loginScreen.pyc
│   ├── postComment.py
│   ├── searchPushPin.py
│   ├── viewCorkboard.py
│   ├── viewCorkboard.pyc
│   ├── viewHomescreen.py
│   ├── viewPopularSites.py
│   ├── viewPopularTags.py
│   ├── viewPushPin.py
│   ├── viewStatistics.py
│   └── watchCorkboard.py
└── templates
├── _messages.html
├── addCorkboard.html
├── addPushPin.html
├── followUser.html
├── layout.html
├── likePushPin.html
├── loginScreen.html
├── postComment.html
├── searchPushPin.html
├── userLoginError.html
├── viewCorkboard.html
├── viewHomeScreen.html
├── viewPopularSites.html
├── viewPopularTags.html
├── viewPushPin.html
├── viewStatistics.html
└── watchCorkboard.html


Environment info:



Python 2.7.15
pip 10.0.1



pip list all



Package                            Version
---------------------------------- -------
appnope 0.1.0
asn1crypto 0.24.0
backports.shutil-get-terminal-size 1.0.0
blueprint 3.4.2
cffi 1.11.5
Click 7.0
cryptography 2.3.1
decorator 4.3.0
enum34 1.1.6
Flask 1.0.2
flask-blueprint 1.2.6
Flask-Login 0.4.1
Flask-MySQL 1.4.0
Flask-MySQLdb 0.2.0
Flask-WTF 0.14.2
idna 2.7
ipaddress 1.0.22
ipython 5.8.0
ipython-genutils 0.2.0
ItsDangerous 1.0.0
Jinja2 2.10
MarkupSafe 1.0
MySQL-python 1.2.5
mysqlclient 1.3.13
pathlib2 2.3.2
pbr 5.1.0
pexpect 4.6.0
pickleshare 0.7.5
pip 10.0.1
prompt-toolkit 1.0.15
ptyprocess 0.6.0
pycparser 2.19
Pygments 2.2.0
PyMySQL 0.9.2
scandir 1.9.0
setuptools 40.5.0
simplegeneric 0.8.1
six 1.11.0
stevedore 1.30.0
traitlets 4.3.2
virtualenv 16.0.0
virtualenv-clone 0.4.0
virtualenvwrapper 4.8.2
wcwidth 0.1.7
Werkzeug 0.14.1
wheel 0.31.1
WTForms 2.2.1


Thank you in advance!










share|improve this question























  • shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

    – gittert
    Nov 21 '18 at 9:21


















0















thank you in advance, I am a python novice--I'm working on a school group project, and they insist on using Blueprints with Flask. We're all working on Macs. I'm doing a clean clone of the repo, and getting this error when trying to run "python app.py" :



from project.routes.loginScreen import login_blueprint
ImportError: No module named routes.loginScreen


However, they can run the same code. I am so stumped, since there must be an environmental difference on my machine--I don't think the import headers matter since again, they can run this with no additional steps.



I already set 'export PYTHONDONTWRITEBYTECODE="true"' in my bash profile, and "git status' returns "working tree clean."



This is our file structure with modular routes:



├── __pycache__
│   └── app.cpython-37.pyc
├── app.py
├── create_tables.sql
└── project
├── __init__.py
├── __pycache__
│   └── __init__.cpython-37.pyc
├── routes
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── addCorkboard.cpython-37.pyc
│   │   ├── addPushPin.cpython-37.pyc
│   │   ├── followUser.cpython-37.pyc
│   │   ├── likePushPin.cpython-37.pyc
│   │   ├── loginScreen.cpython-37.pyc
│   │   ├── postComment.cpython-37.pyc
│   │   ├── searchPushPin.cpython-37.pyc
│   │   ├── viewCorkboard.cpython-37.pyc
│   │   ├── viewHomescreen.cpython-37.pyc
│   │   ├── viewPopularSites.cpython-37.pyc
│   │   ├── viewPopularTags.cpython-37.pyc
│   │   ├── viewPushPin.cpython-37.pyc
│   │   ├── viewStatistics.cpython-37.pyc
│   │   └── watchCorkboard.cpython-37.pyc
│   ├── addCorkboard.py
│   ├── addPushPin.py
│   ├── followUser.py
│   ├── likePushPin.py
│   ├── loginScreen.py
│   ├── loginScreen.pyc
│   ├── postComment.py
│   ├── searchPushPin.py
│   ├── viewCorkboard.py
│   ├── viewCorkboard.pyc
│   ├── viewHomescreen.py
│   ├── viewPopularSites.py
│   ├── viewPopularTags.py
│   ├── viewPushPin.py
│   ├── viewStatistics.py
│   └── watchCorkboard.py
└── templates
├── _messages.html
├── addCorkboard.html
├── addPushPin.html
├── followUser.html
├── layout.html
├── likePushPin.html
├── loginScreen.html
├── postComment.html
├── searchPushPin.html
├── userLoginError.html
├── viewCorkboard.html
├── viewHomeScreen.html
├── viewPopularSites.html
├── viewPopularTags.html
├── viewPushPin.html
├── viewStatistics.html
└── watchCorkboard.html


Environment info:



Python 2.7.15
pip 10.0.1



pip list all



Package                            Version
---------------------------------- -------
appnope 0.1.0
asn1crypto 0.24.0
backports.shutil-get-terminal-size 1.0.0
blueprint 3.4.2
cffi 1.11.5
Click 7.0
cryptography 2.3.1
decorator 4.3.0
enum34 1.1.6
Flask 1.0.2
flask-blueprint 1.2.6
Flask-Login 0.4.1
Flask-MySQL 1.4.0
Flask-MySQLdb 0.2.0
Flask-WTF 0.14.2
idna 2.7
ipaddress 1.0.22
ipython 5.8.0
ipython-genutils 0.2.0
ItsDangerous 1.0.0
Jinja2 2.10
MarkupSafe 1.0
MySQL-python 1.2.5
mysqlclient 1.3.13
pathlib2 2.3.2
pbr 5.1.0
pexpect 4.6.0
pickleshare 0.7.5
pip 10.0.1
prompt-toolkit 1.0.15
ptyprocess 0.6.0
pycparser 2.19
Pygments 2.2.0
PyMySQL 0.9.2
scandir 1.9.0
setuptools 40.5.0
simplegeneric 0.8.1
six 1.11.0
stevedore 1.30.0
traitlets 4.3.2
virtualenv 16.0.0
virtualenv-clone 0.4.0
virtualenvwrapper 4.8.2
wcwidth 0.1.7
Werkzeug 0.14.1
wheel 0.31.1
WTForms 2.2.1


Thank you in advance!










share|improve this question























  • shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

    – gittert
    Nov 21 '18 at 9:21
















0












0








0








thank you in advance, I am a python novice--I'm working on a school group project, and they insist on using Blueprints with Flask. We're all working on Macs. I'm doing a clean clone of the repo, and getting this error when trying to run "python app.py" :



from project.routes.loginScreen import login_blueprint
ImportError: No module named routes.loginScreen


However, they can run the same code. I am so stumped, since there must be an environmental difference on my machine--I don't think the import headers matter since again, they can run this with no additional steps.



I already set 'export PYTHONDONTWRITEBYTECODE="true"' in my bash profile, and "git status' returns "working tree clean."



This is our file structure with modular routes:



├── __pycache__
│   └── app.cpython-37.pyc
├── app.py
├── create_tables.sql
└── project
├── __init__.py
├── __pycache__
│   └── __init__.cpython-37.pyc
├── routes
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── addCorkboard.cpython-37.pyc
│   │   ├── addPushPin.cpython-37.pyc
│   │   ├── followUser.cpython-37.pyc
│   │   ├── likePushPin.cpython-37.pyc
│   │   ├── loginScreen.cpython-37.pyc
│   │   ├── postComment.cpython-37.pyc
│   │   ├── searchPushPin.cpython-37.pyc
│   │   ├── viewCorkboard.cpython-37.pyc
│   │   ├── viewHomescreen.cpython-37.pyc
│   │   ├── viewPopularSites.cpython-37.pyc
│   │   ├── viewPopularTags.cpython-37.pyc
│   │   ├── viewPushPin.cpython-37.pyc
│   │   ├── viewStatistics.cpython-37.pyc
│   │   └── watchCorkboard.cpython-37.pyc
│   ├── addCorkboard.py
│   ├── addPushPin.py
│   ├── followUser.py
│   ├── likePushPin.py
│   ├── loginScreen.py
│   ├── loginScreen.pyc
│   ├── postComment.py
│   ├── searchPushPin.py
│   ├── viewCorkboard.py
│   ├── viewCorkboard.pyc
│   ├── viewHomescreen.py
│   ├── viewPopularSites.py
│   ├── viewPopularTags.py
│   ├── viewPushPin.py
│   ├── viewStatistics.py
│   └── watchCorkboard.py
└── templates
├── _messages.html
├── addCorkboard.html
├── addPushPin.html
├── followUser.html
├── layout.html
├── likePushPin.html
├── loginScreen.html
├── postComment.html
├── searchPushPin.html
├── userLoginError.html
├── viewCorkboard.html
├── viewHomeScreen.html
├── viewPopularSites.html
├── viewPopularTags.html
├── viewPushPin.html
├── viewStatistics.html
└── watchCorkboard.html


Environment info:



Python 2.7.15
pip 10.0.1



pip list all



Package                            Version
---------------------------------- -------
appnope 0.1.0
asn1crypto 0.24.0
backports.shutil-get-terminal-size 1.0.0
blueprint 3.4.2
cffi 1.11.5
Click 7.0
cryptography 2.3.1
decorator 4.3.0
enum34 1.1.6
Flask 1.0.2
flask-blueprint 1.2.6
Flask-Login 0.4.1
Flask-MySQL 1.4.0
Flask-MySQLdb 0.2.0
Flask-WTF 0.14.2
idna 2.7
ipaddress 1.0.22
ipython 5.8.0
ipython-genutils 0.2.0
ItsDangerous 1.0.0
Jinja2 2.10
MarkupSafe 1.0
MySQL-python 1.2.5
mysqlclient 1.3.13
pathlib2 2.3.2
pbr 5.1.0
pexpect 4.6.0
pickleshare 0.7.5
pip 10.0.1
prompt-toolkit 1.0.15
ptyprocess 0.6.0
pycparser 2.19
Pygments 2.2.0
PyMySQL 0.9.2
scandir 1.9.0
setuptools 40.5.0
simplegeneric 0.8.1
six 1.11.0
stevedore 1.30.0
traitlets 4.3.2
virtualenv 16.0.0
virtualenv-clone 0.4.0
virtualenvwrapper 4.8.2
wcwidth 0.1.7
Werkzeug 0.14.1
wheel 0.31.1
WTForms 2.2.1


Thank you in advance!










share|improve this question














thank you in advance, I am a python novice--I'm working on a school group project, and they insist on using Blueprints with Flask. We're all working on Macs. I'm doing a clean clone of the repo, and getting this error when trying to run "python app.py" :



from project.routes.loginScreen import login_blueprint
ImportError: No module named routes.loginScreen


However, they can run the same code. I am so stumped, since there must be an environmental difference on my machine--I don't think the import headers matter since again, they can run this with no additional steps.



I already set 'export PYTHONDONTWRITEBYTECODE="true"' in my bash profile, and "git status' returns "working tree clean."



This is our file structure with modular routes:



├── __pycache__
│   └── app.cpython-37.pyc
├── app.py
├── create_tables.sql
└── project
├── __init__.py
├── __pycache__
│   └── __init__.cpython-37.pyc
├── routes
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── addCorkboard.cpython-37.pyc
│   │   ├── addPushPin.cpython-37.pyc
│   │   ├── followUser.cpython-37.pyc
│   │   ├── likePushPin.cpython-37.pyc
│   │   ├── loginScreen.cpython-37.pyc
│   │   ├── postComment.cpython-37.pyc
│   │   ├── searchPushPin.cpython-37.pyc
│   │   ├── viewCorkboard.cpython-37.pyc
│   │   ├── viewHomescreen.cpython-37.pyc
│   │   ├── viewPopularSites.cpython-37.pyc
│   │   ├── viewPopularTags.cpython-37.pyc
│   │   ├── viewPushPin.cpython-37.pyc
│   │   ├── viewStatistics.cpython-37.pyc
│   │   └── watchCorkboard.cpython-37.pyc
│   ├── addCorkboard.py
│   ├── addPushPin.py
│   ├── followUser.py
│   ├── likePushPin.py
│   ├── loginScreen.py
│   ├── loginScreen.pyc
│   ├── postComment.py
│   ├── searchPushPin.py
│   ├── viewCorkboard.py
│   ├── viewCorkboard.pyc
│   ├── viewHomescreen.py
│   ├── viewPopularSites.py
│   ├── viewPopularTags.py
│   ├── viewPushPin.py
│   ├── viewStatistics.py
│   └── watchCorkboard.py
└── templates
├── _messages.html
├── addCorkboard.html
├── addPushPin.html
├── followUser.html
├── layout.html
├── likePushPin.html
├── loginScreen.html
├── postComment.html
├── searchPushPin.html
├── userLoginError.html
├── viewCorkboard.html
├── viewHomeScreen.html
├── viewPopularSites.html
├── viewPopularTags.html
├── viewPushPin.html
├── viewStatistics.html
└── watchCorkboard.html


Environment info:



Python 2.7.15
pip 10.0.1



pip list all



Package                            Version
---------------------------------- -------
appnope 0.1.0
asn1crypto 0.24.0
backports.shutil-get-terminal-size 1.0.0
blueprint 3.4.2
cffi 1.11.5
Click 7.0
cryptography 2.3.1
decorator 4.3.0
enum34 1.1.6
Flask 1.0.2
flask-blueprint 1.2.6
Flask-Login 0.4.1
Flask-MySQL 1.4.0
Flask-MySQLdb 0.2.0
Flask-WTF 0.14.2
idna 2.7
ipaddress 1.0.22
ipython 5.8.0
ipython-genutils 0.2.0
ItsDangerous 1.0.0
Jinja2 2.10
MarkupSafe 1.0
MySQL-python 1.2.5
mysqlclient 1.3.13
pathlib2 2.3.2
pbr 5.1.0
pexpect 4.6.0
pickleshare 0.7.5
pip 10.0.1
prompt-toolkit 1.0.15
ptyprocess 0.6.0
pycparser 2.19
Pygments 2.2.0
PyMySQL 0.9.2
scandir 1.9.0
setuptools 40.5.0
simplegeneric 0.8.1
six 1.11.0
stevedore 1.30.0
traitlets 4.3.2
virtualenv 16.0.0
virtualenv-clone 0.4.0
virtualenvwrapper 4.8.2
wcwidth 0.1.7
Werkzeug 0.14.1
wheel 0.31.1
WTForms 2.2.1


Thank you in advance!







python flask blueprint






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 4:03









user3626793user3626793

61




61













  • shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

    – gittert
    Nov 21 '18 at 9:21





















  • shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

    – gittert
    Nov 21 '18 at 9:21



















shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

– gittert
Nov 21 '18 at 9:21







shouldn't there be an empty "init.py" file (add the underscores!) in the routes subdirectory? Also see docs.python.org/2/tutorial/modules.html

– gittert
Nov 21 '18 at 9:21














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405105%2fpython-flask-blueprints-project-routes-loginscreen-import-login-blueprint-impor%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405105%2fpython-flask-blueprints-project-routes-loginscreen-import-login-blueprint-impor%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith