As I told, I'm driving a pywikipedia bot (Alebot) into willow; I installed pywikipedia at $HOME, I set
PYTHONPATH=/home/alebot/pywikipedia [,.....]
into .environment file, and I am reviewing at my best python scripts to run them by qsub/qcronsub.
Most of my scripts obviously need a statement:
import wikipedia [,.....]
My questions: 1. Do I really need to install pywikipedia into $HOME? 2. My scripts run happily outside SGE, but when I try to run them under SGE I get an error: ImportError: No module named wikipedia
I didn't find doc for this ImportError (I suppose, PYTHONPATH is wrong).
Where am I going wrong?
Alex
I always include: import sys import os sys.path.append("PATH_TO_PYWIKIFOLDER") in all my scripts before I try to import wikipedia that should fix your issue
On Fri, May 17, 2013 at 6:29 PM, Alex Brollo alex.brollo@gmail.com wrote:
As I told, I'm driving a pywikipedia bot (Alebot) into willow; I installed pywikipedia at $HOME, I set
PYTHONPATH=/home/alebot/pywikipedia [,.....]
into .environment file, and I am reviewing at my best python scripts to run them by qsub/qcronsub.
Most of my scripts obviously need a statement:
import wikipedia [,.....]
My questions:
- Do I really need to install pywikipedia into $HOME?
- My scripts run happily outside SGE, but when I try to run them under
SGE I get an error: ImportError: No module named wikipedia
I didn't find doc for this ImportError (I suppose, PYTHONPATH is wrong).
Where am I going wrong?
Alex
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Let's try .....
OK! I didn't try this previously. Under qsub .environment PYTHONPATH is ignored.
Thanks!
Alex
2013/5/18 John phoenixoverride@gmail.com
I always include: import sys import os sys.path.append("PATH_TO_PYWIKIFOLDER") in all my scripts before I try to import wikipedia that should fix your issue
On Fri, May 17, 2013 at 6:29 PM, Alex Brollo alex.brollo@gmail.comwrote:
As I told, I'm driving a pywikipedia bot (Alebot) into willow; I installed pywikipedia at $HOME, I set
PYTHONPATH=/home/alebot/pywikipedia [,.....]
into .environment file, and I am reviewing at my best python scripts to run them by qsub/qcronsub.
Most of my scripts obviously need a statement:
import wikipedia [,.....]
My questions:
- Do I really need to install pywikipedia into $HOME?
- My scripts run happily outside SGE, but when I try to run them under
SGE I get an error: ImportError: No module named wikipedia
I didn't find doc for this ImportError (I suppose, PYTHONPATH is wrong).
Where am I going wrong?
Alex
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Alex Brollo alex.brollo@gmail.com wrote:
As I told, I'm driving a pywikipedia bot (Alebot) into willow; I installed pywikipedia at $HOME, I set
PYTHONPATH=/home/alebot/pywikipedia [,.....]
into .environment file, and I am reviewing at my best python scripts to run them by qsub/qcronsub.
Most of my scripts obviously need a statement:
import wikipedia [,.....]
My questions:
- Do I really need to install pywikipedia into $HOME?
- My scripts run happily outside SGE, but when I try to run them under SGE
I get an error: ImportError: No module named wikipedia
I didn't find doc for this ImportError (I suppose, PYTHONPATH is wrong).
Where am I going wrong?
If your job is executed on Linux hosts, ~/.environment isn't honoured (cf. https://jira.toolserver.org/browse/TS-1472). So at the moment it's best to follow John's advice and set sys.path in Python (or use a wrapper shell script), or use "-l arch=sol" to require that your job is executed on a So- laris host.
Tim
toolserver-l@lists.wikimedia.org