WebFaction
Community site: login faq

After using "pip install pandas" the package loads fine when i do

python2.7
import pandas

However if I run the following cronjob:

44 */1 * * * $HOME/webapps/mongodb/scripts/cronjobs.sh > $HOME/webapps/mongodb/logs/cronjobs.log 2>&1

Which calls this line:

/usr/local/bin/python2.7 $HOME/webapps/mongodb/scripts/run_notebook.py $HOME/webapps/mongodb/scripts/python/notebooks/nutshell_dashboard.ipynb

Which in turn contains the:

import pandas

There's an error message in the cronjobs.log:

ImportError: No module named pandas

Any ideas how to make the package available there?

asked 25 Jan '14, 19:25

ampelmann
3521924
accept rate: 0%

edited 27 Jan '14, 18:51

What is your cron entry and/or the script that it is calling?

(25 Jan '14, 19:32) timg ♦♦

@timg I added the cron

(27 Jan '14, 18:51) ampelmann

Where is the pandas library installed?

(27 Jan '14, 19:03) seanf

@seanf I'm not sure, I installed them like this: pip install pandas

(27 Jan '14, 21:12) ampelmann

Please try adding the following line somewhere near the beginning of $HOME/webapps/mongodb/scripts/cronjobs.sh:

export PYTHONPATH=$HOME/lib/python2.7:$PYTHONPATH

Hope that helps!

permanent link

answered 27 Jan '14, 22:05

seanf
12.2k41836
accept rate: 37%

@Seanf excellent, this loads pandas fine. Now I run into another problem which i believe is related to the Python path: https://community.webfaction.com/questions/15996/python-path-for

(28 Jan '14, 10:13) ampelmann
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×81

question asked: 25 Jan '14, 19:25

question was seen: 4,233 times

last updated: 28 Jan '14, 10:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM