unable to import 'pymongo'












0















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.










share|improve this question

























  • 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











  • 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


















0















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.










share|improve this question

























  • 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











  • 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
















0












0








0








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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











  • 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











  • @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














1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer























    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%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









    0














    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.






    share|improve this answer




























      0














      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.






      share|improve this answer


























        0












        0








        0







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 15:06









        AyubxAyubx

        45118




        45118






























            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%2f53457355%2funable-to-import-pymongo%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

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)