I have been using the Jira python library successfully for a few weeks and all of a sudden it will not initialize. It stops at the very first line of the file, where Jira is imported.
Here's the error message (with directories removed) from PyCharm:
Traceback (most recent call last):
File "jira_probe.py", line 1, in <module>
from jira.client import JIRA
File ".venv\Lib\site-packages\jira\__init__.py", line 11, in <module>
from jira.client import (
File ".venv\Lib\site-packages\jira\client.py", line 43, in <module>
import requests
File ".venv\Lib\site-packages\requests\__init__.py", line 43, in <module>
import urllib3
File ".venv\Lib\site-packages\urllib3\__init__.py", line 14, in <module>
from . import exceptions
File ".venv\Lib\site-packages\urllib3\exceptions.py", line 6, in <module>
from email.errors import MessageDefect
ModuleNotFoundError: No module named 'email.errors'; 'email' is not a package
I installed the jira library with pip per the API reference instructions, and it was working fine for a while, so I suspect something is broken in jira-python. I already tried deleting all the packages from my interpreter and reinstalling them. The two things that stand out to me are "import ( " in line 5 of the above error and "from . import exceptions" in line 11. I greatly appreciate any help with this.
By any chance have you created a file named email.py or a module named email?
if yes, it would be clashing with the required package.
Can you check and confirm?
Yes, that was it, thank you! I have never heard of this kind of problem before. It works now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.