python : cannot import name JIRA

Scooby picture Scooby · Jan 12, 2017 · Viewed 7.8k times · Source

I have already done pip install jira

but when I run the following it fails with ImportError: cannot import name JIRA

import re
from jira import JIRA

jira = JIRA('https://issues.net')
# all values are samples and won't work in your code!
key_cert_data = None
key_cert_file = "cert/jiraprivatekey.pub"
with open(key_cert, 'r') as key_cert_file:
    key_cert_data = key_cert_file.read()

Answer

Scooby picture Scooby · Jan 12, 2017

fixed it.

The file I was running was called jira.py so when I did from

jira import JIRA

It was trying to look up self.