Python: Trouble importing JIRA module despite installation

Hey everyone, I’m having a weird issue with Python and the JIRA module. I’ve already run pip install jira but I’m still getting an error when I try to use it in my code.

Here’s what I’m trying to do:

from jira_module import JiraClient

jira_connection = JiraClient('https://mycompany.jiraserver.com')

# Reading a certificate file
cert_content = None
cert_file_path = 'certs/my_jira_cert.pem'
with open(cert_file_path, 'r') as cert_file:
    cert_content = cert_file.read()

# More code would go here...

But when I run this, I get an ImportError saying it can’t import JiraClient. Any ideas what might be going wrong? I’m pretty sure I installed it correctly, but maybe I’m missing something obvious. Thanks for any help!

hey emma, i ran into this b4. try from jira import JIRA instead. the module name is just ‘jira’. also double check ur running the script in same environment where u installed it. if that dont work, try pip install --upgrade jira to get latest version. Good luck!

Have you checked if the JIRA module is installed in the correct Python environment? Sometimes this issue occurs when you install packages in one environment but run your script in another. Try running ‘pip list’ in your terminal to verify the JIRA package is indeed installed.

Also, the import statement looks a bit off. The standard way to import JIRA is:

from jira import JIRA

Then you can create a client with:

jira = JIRA(‘https://mycompany.jiraserver.com’)

If you’re still facing issues, consider reinstalling the package with ‘pip install --upgrade jira’ to ensure you have the latest version. Let us know if these suggestions help!

I’ve encountered similar issues before, and it’s often due to a mismatch between the module name and the import statement. The JIRA module is usually imported as ‘jira’, not ‘jira_module’. Try modifying your import statement to:

from jira import JIRA

Then, you can create a JIRA client like this:

jira = JIRA(‘https://mycompany.jiraserver.com’)

Also, ensure you’re running the script in the same Python environment where you installed the module. Sometimes, people install packages in one environment but run their script in another.

If you’re still having trouble, check your Python path and make sure the jira package is in a location Python can find. You can print sys.path to see where Python is looking for modules.

Hope this helps! Let me know if you need any further clarification.