N
N
Nikita Kotenko2016-02-25 14:53:41
Python
Nikita Kotenko, 2016-02-25 14:53:41

How to import modules installed in the environment when running python.py with Cron in virtualenv?

When Cron runs the python.py script in the virtualenv, the modules installed in the environment are not imported. Writes No module named ...
Through the terminal, under the environment, it is imported normally
. I suspect that cron is looking for globally (not in the environment).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kotenko, 2016-02-25
@n_angelo

In the crone, write like this:
source [path to the environment] && python [path to the script]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question