Hello. I’ve tried installing using pip install atlassian-python-api, but when I write the script, python is giving me ModuleNotFoundError: No module named ‘atlassian’ when I run my Script.Please Help. Thanks in Advance.
Reference link: https://atlassian-python-api.readthedocs.io/index.html
This is the code.
from atlassian import Confluence
confluence = Confluence(
status = confluence.create_page(
title=‘This is the title’,
body=‘This is the body. You can use HTML tags!’)
You may have to use python3 instead of python2 or python (if python2 is the default on your OS).
I tested it (same script) and I was able to create the page by either calling the script with python3 or setting the shebang in the script's first line pointing it to
Can you confirm if the script runs when calling it with python3?
The error you're receiving indicates that, wherever you may have installed the package, it's not in the python installation that you're using to run the script.
If you have python 2 and python 3 installed, you may have used the pip from one installation whilst you're running the script with the other.
The easiest thing to check is to run which pip and which python (or which python3, whichever is the binary that you used when you tried running the script). Are they in the same place? If not, then that explains why: the python you're running is from a different installation than the pip you used to install.
As a general rule I would recommend using virtual environments, as this simplifies everything and ensures you're using a default python local to your project:
mkdir my_project && cd my_project
python3 -m venv .env #this creates a virtual environment in the folder ".env"
pip3 install atlassian-python-api
If you take this approach you should be guaranteed to be using the right python and pip from the virtual environment installation and you shouldn't get the module import error.
Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond. A long time favorite, Team Cale...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events