I’ve been stuck on this Python script for a while now. When I try to run my code that connects to Jira, I keep getting an ImportError saying the jira module can’t be found.
The error message shows:
Traceback (most recent call last):
File "jira_script.py", line 1, in <module>
from jira import JIRA
ImportError: No module named 'jira'
Here’s my code that’s causing the problem:
from jira import JIRA
import json
import csv
config = {'server': 'https://company-jira.example.com/', 'verify': False}
jira_client = JIRA(config)
tickets = jira_client.search_issues('project=PROJ and created >= -180d ORDER BY created DESC', maxResults=5000, fields='summary,status,assignee')
output_file = open("jira_export.csv", "w", newline="")
csv_writer = csv.writer(output_file, delimiter=',')
for ticket in tickets:
row_data = [ticket.key, ticket.fields.status.name, ticket.fields.assignee]
csv_writer.writerow(row_data)
output_file.close()
What am I missing here? Do I need to install something first?
The ImportError indicates that the jira library is likely not installed. You can resolve this by running pip install jira. However, I recommend considering pip install atlassian-python-api as it provides a more robust set of features and is actively maintained. I’ve found it to be more reliable for automation tasks. Additionally, ensure that your script includes proper authentication, as many Jira instances will require a valid username/password or an API token for accessing tickets.
Check your Python environment first. I hit this exact error on a similar Jira project. Had the jira package installed globally but was running my script in a virtual environment that didn’t have it. Run pip install jira in the same environment where you’re running your script. Test it by opening Python and trying import jira directly. Your auth setup looks incomplete too - most corporate Jira instances won’t accept that connection without proper credentials. You’ll need to add username and API token to your config once you fix the import issue.
The missing package install is just the tip of the iceberg. Yeah, run pip install jira to fix the immediate error, but you’re building something that needs automation.
I’ve been down this road with Jira exports. Python scripts, dependencies, auth failures, rate limits - it becomes a maintenance nightmare fast.
You need a proper automation platform that handles Jira connectivity for you. I switched to Latenode and never looked back. Native Jira connectors that work, scheduled exports, error handling, and pushes data wherever you need it.
No more wrestling with Python environments or managing API tokens manually. Drag, drop, configure, and you’re pulling Jira data like a pro.
That CSV export you’re building? 5-minute setup in Latenode versus hours debugging Python scripts.
Same thing happened to me last week. You need to install the package first with pip3 install jira if regular pip doesn’t work - version conflicts mess this up sometimes. Also check you’re using the right Python interpreter if you’ve got multiple versions.
You’re missing the jira package. Just run pip install jira in your terminal before running your script. I encountered a similar issue last year while setting up automated Jira reports. If you are using virtual environments or conda, ensure you install the package in the correct environment. This should resolve your import error. Additionally, consider adding error handling for authentication, as most company Jira setups require proper credentials or API tokens.