Apolymoxic
Apolymoxic

Reputation: 836

Python Jira module is not found, but it's installed

I have two files - one PHP file and one Python file. The python file imports the Jira module, searches for issues, and obtains information from Jira. This file does function correctly and it will find Jira issues and return all needed fields successfully.

The PHP file (for this example, let's call it py_exec.php) is part of a website and executes the Python file through shell_exec; something to the effect of:

$jira_issues = shell_exec(python3 py_search.py issue=blah);
print_r($jira_issues);

After troubleshooting a bit, I tried to run the command as the apache user and I am given the following error:

ModuleNotFoundError: No module named 'jira'

Obviously the module is installed, but it seems that it's not accessible to Apache.

How do I make this module accessible to Apache?

Many thanks, in advance, for any help I can get.

Upvotes: 0

Views: 1282

Answers (1)

Jessica
Jessica

Reputation: 201

su to the apache user and run pip install jira. Check that it worked by doing python and then import jira.

Sometimes pip ends up aliased to something other than python. So if you have issues, try python -m pip instead.

Upvotes: 1

Related Questions