unable to import 'pymongo'
So i learning flask web dev with mongodb. I am getting an error on the following code,
import pymongo
I am using virtualenv and the following are configured on it, obtained via pip3 freeze
,
Flask==1.0.2
Flask-MongoAlchemy==0.7.2
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
MongoAlchemy==0.19
pymongo==2.8.1
Werkzeug==0.14.1
I am getting the error unable to import 'pymongo'
via pylint on Visual studio code.
FYI i was getting a similar error when using MongoAlchemy. I thought i'd switch and give it a go with pymongo.
from flask.ext.mongoalchemy import MongoAlchemy
I have run python3 -m pip install pymongo
but as you may correctly guess i am getting Requirement already satisfied: pymongo in ./venv/lib/python3.7/site-packages (2.8.1)
How could i solve this ? Thank you.
python python-3.x flask pymongo-3.x
|
show 3 more comments
So i learning flask web dev with mongodb. I am getting an error on the following code,
import pymongo
I am using virtualenv and the following are configured on it, obtained via pip3 freeze
,
Flask==1.0.2
Flask-MongoAlchemy==0.7.2
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
MongoAlchemy==0.19
pymongo==2.8.1
Werkzeug==0.14.1
I am getting the error unable to import 'pymongo'
via pylint on Visual studio code.
FYI i was getting a similar error when using MongoAlchemy. I thought i'd switch and give it a go with pymongo.
from flask.ext.mongoalchemy import MongoAlchemy
I have run python3 -m pip install pymongo
but as you may correctly guess i am getting Requirement already satisfied: pymongo in ./venv/lib/python3.7/site-packages (2.8.1)
How could i solve this ? Thank you.
python python-3.x flask pymongo-3.x
are you using python3 everywhere? Perhaps you have installed it withpython3
and see it inpip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)
– lucidbrot
Nov 24 '18 at 10:52
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
1
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18
|
show 3 more comments
So i learning flask web dev with mongodb. I am getting an error on the following code,
import pymongo
I am using virtualenv and the following are configured on it, obtained via pip3 freeze
,
Flask==1.0.2
Flask-MongoAlchemy==0.7.2
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
MongoAlchemy==0.19
pymongo==2.8.1
Werkzeug==0.14.1
I am getting the error unable to import 'pymongo'
via pylint on Visual studio code.
FYI i was getting a similar error when using MongoAlchemy. I thought i'd switch and give it a go with pymongo.
from flask.ext.mongoalchemy import MongoAlchemy
I have run python3 -m pip install pymongo
but as you may correctly guess i am getting Requirement already satisfied: pymongo in ./venv/lib/python3.7/site-packages (2.8.1)
How could i solve this ? Thank you.
python python-3.x flask pymongo-3.x
So i learning flask web dev with mongodb. I am getting an error on the following code,
import pymongo
I am using virtualenv and the following are configured on it, obtained via pip3 freeze
,
Flask==1.0.2
Flask-MongoAlchemy==0.7.2
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
MongoAlchemy==0.19
pymongo==2.8.1
Werkzeug==0.14.1
I am getting the error unable to import 'pymongo'
via pylint on Visual studio code.
FYI i was getting a similar error when using MongoAlchemy. I thought i'd switch and give it a go with pymongo.
from flask.ext.mongoalchemy import MongoAlchemy
I have run python3 -m pip install pymongo
but as you may correctly guess i am getting Requirement already satisfied: pymongo in ./venv/lib/python3.7/site-packages (2.8.1)
How could i solve this ? Thank you.
python python-3.x flask pymongo-3.x
python python-3.x flask pymongo-3.x
edited Nov 24 '18 at 13:35
dcrosta
19k65877
19k65877
asked Nov 24 '18 at 10:47
AyubxAyubx
45118
45118
are you using python3 everywhere? Perhaps you have installed it withpython3
and see it inpip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)
– lucidbrot
Nov 24 '18 at 10:52
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
1
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18
|
show 3 more comments
are you using python3 everywhere? Perhaps you have installed it withpython3
and see it inpip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)
– lucidbrot
Nov 24 '18 at 10:52
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
1
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18
are you using python3 everywhere? Perhaps you have installed it with
python3
and see it in pip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)– lucidbrot
Nov 24 '18 at 10:52
are you using python3 everywhere? Perhaps you have installed it with
python3
and see it in pip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)– lucidbrot
Nov 24 '18 at 10:52
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
1
1
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18
|
show 3 more comments
1 Answer
1
active
oldest
votes
so it seems like flask.ext..
is deprecated. so from flask_pymongo import PyMongo
is the way to go if i want to use pymongo. As for the error vscode was showing it seems like it's related to linting.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457355%2funable-to-import-pymongo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
so it seems like flask.ext..
is deprecated. so from flask_pymongo import PyMongo
is the way to go if i want to use pymongo. As for the error vscode was showing it seems like it's related to linting.
add a comment |
so it seems like flask.ext..
is deprecated. so from flask_pymongo import PyMongo
is the way to go if i want to use pymongo. As for the error vscode was showing it seems like it's related to linting.
add a comment |
so it seems like flask.ext..
is deprecated. so from flask_pymongo import PyMongo
is the way to go if i want to use pymongo. As for the error vscode was showing it seems like it's related to linting.
so it seems like flask.ext..
is deprecated. so from flask_pymongo import PyMongo
is the way to go if i want to use pymongo. As for the error vscode was showing it seems like it's related to linting.
answered Nov 26 '18 at 15:06
AyubxAyubx
45118
45118
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457355%2funable-to-import-pymongo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
are you using python3 everywhere? Perhaps you have installed it with
python3
and see it inpip3 freeze
, but are running your program with a different version of python (or even the same version, but installed somewhere else)– lucidbrot
Nov 24 '18 at 10:52
@lucidbrot I am using python3 everywhere. My virtualenv is using python3.7
– Ayubx
Nov 24 '18 at 10:55
And the virtualenv is activated?
– lucidbrot
Nov 24 '18 at 11:10
@lucidbrot yes it is. What i have done now is deleted the virtualenv directory and reinstalled everything. I am now using 'from flask_pymongo import PyMongo'. That seems to be working but i am still getting unable to import pylint error on VsCode. Weird.
– Ayubx
Nov 24 '18 at 11:46
1
@RahulBharadwaj Thank you. I downloaded all the latest versions via pip. Will try this and let you know. Not on my personal mac atm.
– Ayubx
Nov 25 '18 at 15:18