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;
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
add a comment |
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
Please add output ofpip freeze | grep pandas
,su -c "pip freeze | grep pandas"
andapt-cache policy python-pandas
to the question.
– N0rbert
Jan 18 at 21:39
add a comment |
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
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
python
asked Jan 18 at 10:12
Michael DeYoungMichael DeYoung
61
61
Please add output ofpip freeze | grep pandas
,su -c "pip freeze | grep pandas"
andapt-cache policy python-pandas
to the question.
– N0rbert
Jan 18 at 21:39
add a comment |
Please add output ofpip freeze | grep pandas
,su -c "pip freeze | grep pandas"
andapt-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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
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%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
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.
add a comment |
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.
add a comment |
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.
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.
edited 7 mins ago
answered 16 mins ago
Lucas CzepanikiLucas Czepaniki
668
668
add a comment |
add a comment |
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.
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%2faskubuntu.com%2fquestions%2f1110822%2fmodulenotfounderror-no-module-named-pandas-only-as-root%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
Please add output of
pip freeze | grep pandas
,su -c "pip freeze | grep pandas"
andapt-cache policy python-pandas
to the question.– N0rbert
Jan 18 at 21:39