ModuleNotFoundError: No module named 'pandas' (only as root) Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)python3 - ImportError: No module named '_chipset'Problem getting script to run via cron tabBash script doesn't work properly in crontab but does work manuallyFatal Python error: Py_Initialize: Unable to get the locale encoding - ImportError: No module named 'encodings'Calling .py script from .sh script error “ImportError: No module named apiclient.discovery”Python module not found when launched in cronFailing to import pandas in Anjuta “module functions cannot set METH_CLASS or METH_STATIC”Cronjob - Unable to find module “pydub”python: mingus.midi does not workUgraded to Ubuntu 18.04.2 LTS From Ubuntu 16.04

Why are there no cargo aircraft with "flying wing" design?

How to override model in magento2?

Understanding Ceva's Theorem

The logistics of corpse disposal

Storing hydrofluoric acid before the invention of plastics

How to answer "Have you ever been terminated?"

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

What does the "x" in "x86" represent?

How do pianists reach extremely loud dynamics?

String `!23` is replaced with `docker` in command line

Why did the rest of the Eastern Bloc not invade Yugoslavia?

First console to have temporary backward compatibility

Why are both D and D# fitting into my E minor key?

How to find all the available tools in mac terminal?

Why did the Falcon Heavy center core fall off the ASDS OCISLY barge?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Generate an RGB colour grid

When were vectors invented?

Why aren't air breathing engines used as small first stages

List of Python versions

How come Sam didn't become Lord of Horn Hill?

How to bypass password on Windows XP account?

Gordon Ramsay Pudding Recipe



ModuleNotFoundError: No module named 'pandas' (only as root)



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)python3 - ImportError: No module named '_chipset'Problem getting script to run via cron tabBash script doesn't work properly in crontab but does work manuallyFatal Python error: Py_Initialize: Unable to get the locale encoding - ImportError: No module named 'encodings'Calling .py script from .sh script error “ImportError: No module named apiclient.discovery”Python module not found when launched in cronFailing to import pandas in Anjuta “module functions cannot set METH_CLASS or METH_STATIC”Cronjob - Unable to find module “pydub”python: mingus.midi does not workUgraded to Ubuntu 18.04.2 LTS From Ubuntu 16.04



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















So I'm having this weird issue.



I just installed server 18.04.1 LTS. The purpose of this server is to run scheduled Python scripts.



I can run my script just fine when authenticated with the user-account created during installation. But it won't run when scheduled with CRON (sudo crontab -e).



So... I set root password, authenticate and try running script and receive error "ModuleNotFoundError: No module named 'pandas'". So... I install pandas (sudo apt-get install python-pandas) and re-run. Same error










share|improve this question






















  • Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

    – N0rbert
    Jan 18 at 21:39

















1















So I'm having this weird issue.



I just installed server 18.04.1 LTS. The purpose of this server is to run scheduled Python scripts.



I can run my script just fine when authenticated with the user-account created during installation. But it won't run when scheduled with CRON (sudo crontab -e).



So... I set root password, authenticate and try running script and receive error "ModuleNotFoundError: No module named 'pandas'". So... I install pandas (sudo apt-get install python-pandas) and re-run. Same error










share|improve this question






















  • Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

    – N0rbert
    Jan 18 at 21:39













1












1








1








So I'm having this weird issue.



I just installed server 18.04.1 LTS. The purpose of this server is to run scheduled Python scripts.



I can run my script just fine when authenticated with the user-account created during installation. But it won't run when scheduled with CRON (sudo crontab -e).



So... I set root password, authenticate and try running script and receive error "ModuleNotFoundError: No module named 'pandas'". So... I install pandas (sudo apt-get install python-pandas) and re-run. Same error










share|improve this question














So I'm having this weird issue.



I just installed server 18.04.1 LTS. The purpose of this server is to run scheduled Python scripts.



I can run my script just fine when authenticated with the user-account created during installation. But it won't run when scheduled with CRON (sudo crontab -e).



So... I set root password, authenticate and try running script and receive error "ModuleNotFoundError: No module named 'pandas'". So... I install pandas (sudo apt-get install python-pandas) and re-run. Same error







python






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 18 at 10:12









Michael DeYoungMichael DeYoung

61




61












  • Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

    – N0rbert
    Jan 18 at 21:39

















  • Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

    – N0rbert
    Jan 18 at 21:39
















Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

– N0rbert
Jan 18 at 21:39





Please add output of pip freeze | grep pandas, su -c "pip freeze | grep pandas" and apt-cache policy python-pandas to the question.

– N0rbert
Jan 18 at 21:39










1 Answer
1






active

oldest

votes


















0














Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.



(I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).



With that in mind, I think you could solve this by either



1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:




usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.




or



2) setting a custom env for the script:



HOME=user-home-directory
LOGNAME=user-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
PYTHONPATH=/usr/lib/pythonX.X


For more detailed information check this crontrab reference.



Hope that helps.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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%2faskubuntu.com%2fquestions%2f1110822%2fmodulenotfounderror-no-module-named-pandas-only-as-root%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














    Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.



    (I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).



    With that in mind, I think you could solve this by either



    1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:




    usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.




    or



    2) setting a custom env for the script:



    HOME=user-home-directory
    LOGNAME=user-login-id
    PATH=/usr/bin:/usr/sbin:.
    SHELL=/usr/bin/sh
    PYTHONPATH=/usr/lib/pythonX.X


    For more detailed information check this crontrab reference.



    Hope that helps.






    share|improve this answer





























      0














      Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.



      (I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).



      With that in mind, I think you could solve this by either



      1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:




      usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.




      or



      2) setting a custom env for the script:



      HOME=user-home-directory
      LOGNAME=user-login-id
      PATH=/usr/bin:/usr/sbin:.
      SHELL=/usr/bin/sh
      PYTHONPATH=/usr/lib/pythonX.X


      For more detailed information check this crontrab reference.



      Hope that helps.






      share|improve this answer



























        0












        0








        0







        Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.



        (I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).



        With that in mind, I think you could solve this by either



        1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:




        usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.




        or



        2) setting a custom env for the script:



        HOME=user-home-directory
        LOGNAME=user-login-id
        PATH=/usr/bin:/usr/sbin:.
        SHELL=/usr/bin/sh
        PYTHONPATH=/usr/lib/pythonX.X


        For more detailed information check this crontrab reference.



        Hope that helps.






        share|improve this answer















        Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.



        (I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).



        With that in mind, I think you could solve this by either



        1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:




        usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.




        or



        2) setting a custom env for the script:



        HOME=user-home-directory
        LOGNAME=user-login-id
        PATH=/usr/bin:/usr/sbin:.
        SHELL=/usr/bin/sh
        PYTHONPATH=/usr/lib/pythonX.X


        For more detailed information check this crontrab reference.



        Hope that helps.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 7 mins ago

























        answered 16 mins ago









        Lucas CzepanikiLucas Czepaniki

        668




        668



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f1110822%2fmodulenotfounderror-no-module-named-pandas-only-as-root%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

            Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

            Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

            Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»