ModuleNotFoundError: No module named 'pandas' (only as root)python3 - ImportError: No module named '_chipset'Problem getting script to run via cron tabBash script doesn't work properly in crontab but does work manuallyCalling .py script from .sh script error “ImportError: No module named apiclient.discovery”Python module not found when launched in cronCronjob - Unable to find module “pydub”
Is there a difference between historical fiction and creative non-fiction?
Why didn't Snape ask Dumbledore why he let "Moody" search his office?
What are the most important factors in determining how fast technology progresses?
Does SQL Server's serializable isolation level lock entire table
Composing religious songs and melodies on Shabbos
In the Star Trek: TNG continuity is cloning illegal?
Determine the Winner of a Game of Australian Football
What is the next number in the sequence 21, 21, 23, 20, 5, 25, 31, 24, ...?
Can 35 mm film which went through a washing machine still be developed?
What's the difference between motherboard and chassis?
Is there any specific significance of inverse demand?
Is there a penalty for switching targets?
Making a animation of multiple 3D objects rotating
Power Adapter for Traveling to Scotland (I live in the US)
How to catch creatures that can predict the next few minutes?
Are 1 in 6 deaths in the USA due to lead exposure?
Spectrometer vs Spectrometry vs Spectroscopy
Why is the time of useful consciousness only seconds at high altitudes, when I can hold my breath much longer at ground level?
I pay for a service, but I miss the broadcast
Fair Use of Photos as a Derivative Work
Would we have more than 8 minutes of light, if the sun "went out"?
What is /dev/null and why can't I use hx on it?
Is there any problem with students seeing faculty naked in university gym?
Applying UK Visit Visa Application from AU
ModuleNotFoundError: No module named 'pandas' (only as root)
python3 - ImportError: No module named '_chipset'Problem getting script to run via cron tabBash script doesn't work properly in crontab but does work manuallyCalling .py script from .sh script error “ImportError: No module named apiclient.discovery”Python module not found when launched in cronCronjob - Unable to find module “pydub”
.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 bronze badge
61 bronze badge
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/4.0/"u003ecc by-sa 4.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 Apr 17 at 6:45
answered Apr 17 at 6:36
Lucas Vasconcellos CzepanikiLucas Vasconcellos Czepaniki
869 bronze badges
869 bronze badges
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