Python Forum
ImportError: cannot import name 'DEFUSEDXML' from 'openpyxl'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError: cannot import name 'DEFUSEDXML' from 'openpyxl'
#1
Hello dear friends,

I am trying to read in an Excel file with openpyxl.

But it always gives me this stacktrace:

C:\Users\kanin\venv\Python3.7\Scripts\python.exe C:/Users/kanin/IdeaProjects/PythonPrograms/hallo3/hallo3.py
Traceback (most recent call last):
File "C:/Users/kanin/IdeaProjects/PythonPrograms/hallo3/hallo3.py", line 2, in <module>
import openpyxl
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\__init__.py", line 5, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\workbook\__init__.py", line 5, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\workbook\workbook.py", line 8, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\worksheet\worksheet.py", line 30, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\cell\__init__.py", line 4, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\cell\cell.py", line 46, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\utils\inference.py", line 10, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\styles\__init__.py", line 5, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\styles\alignment.py", line 6, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\descriptors\__init__.py", line 5, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\descriptors\sequence.py", line 5, in <module>
File "C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\xml\functions.py", line 14, in <module>
ImportError: cannot import name 'DEFUSEDXML' from 'openpyxl' (C:\Users\kanin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl-2.6.1-py3.7.egg\openpyxl\__init__.py)

Process finished with exit code 1


Can anybody tell me how to solve this problem? Because I have installed defusedxml..

Cheers, Kaspar
Reply
#2
never mind, I just uninstalled and reinstalled openpyxl and now it works! Don't know how to delete this post.. Cheers
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Cannot import easysnmp: ImportError: libnetsnmp.so.30 Calab 4 1,046 Jun-08-2023, 08:52 PM
Last Post: Gribouillis
  ImportError: cannot import name 'Pyfhel' from 'Pyfhel' Anldra12 9 3,543 Dec-13-2021, 06:55 PM
Last Post: Anldra12
  ImportError: cannot import name 'get_config' russray2008 0 4,738 Sep-20-2021, 02:18 PM
Last Post: russray2008
  ImportError: cannot import name 'Union' from '_ctypes' (unknown location) ciuffoly 15 10,381 Oct-09-2020, 06:58 AM
Last Post: ciuffoly
  ImportError: cannot import name 'Request' from 'request' abhishek81py 1 3,922 Jun-18-2020, 08:07 AM
Last Post: buran
  ImportError: cannot import name 'MidiEvaluator' from 'parser' (Windows 10) spiffspaceman 4 2,669 May-22-2020, 10:16 PM
Last Post: snippsat
  ImportError: cannot import name 'X ' from ' Y' (Unknown location) Arjunpi 1 4,355 Apr-30-2020, 12:56 AM
Last Post: Larz60+
  problem with mapnik in anaconda python 2: from _mapnik import * ImportError: DLL load parsley 0 1,904 Dec-11-2019, 07:50 AM
Last Post: parsley
  getting ImportError: cannot import name 'HAProxyServer' deepakkr3110 0 1,638 Nov-12-2019, 07:48 AM
Last Post: deepakkr3110
  ImportError: cannot import name 'gui' from 'appJar' CabbageMan 1 2,814 Sep-04-2019, 07:31 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020