Page MenuHomePhabricator

Import error after already installed with virtualenv
Closed, ResolvedPublic

Description

"ImportError: No module named wikitools"

I have followed the instructions at https://wikitech.wikimedia.org/wiki/Help:Toolforge/FAQ#My_Tool_requires_a_package_that_is_not_currently_installed_in_Toolforge._How_can_I_add_it?
and did so again just now, it says it is already installed.

What am I missing?

Running from the following command:
/usr/bin/jsub -l release=trusty -N cron-tools.deltaquad-bots-Imagerevdel -once -quiet python /data/project/deltaquad-bots/jobs/imagerevdel/main.py > /dev/null 2&>1

Event Timeline

It looks like you aren't using your virtualenv.

I'd create a wrapper script like this (asssumes your virtualenv is at ~/python/venv):

imagerevdel
#!/bin/bash
source ~/python/venv/bin/activate
cd ~/python/src # adjust or remove as needed
python /data/project/deltaquad-bots/jobs/imagerevdel/main.py

and use:

jstart -N cron-tools.deltaquad-bots-Imagerevdel /data/project/deltaquad-bots/{...}/imagerevdel > /dev/null 2&>1