Hallo zusammen,
wollte einmal die INBOX von meinem Mail-Account auslesen.
unter Pycharm funktioniert der Code auch einwandfrei.
wenn ich das Programm per py2exe compiliere kriege ich Fehler.
Kann mir jemand helfen?
Hier der Code:
from exchangelib import Credentials, Account
import elementpath
from xml.etree import ElementTree
user = 'xxxxx.yyyyy.de'
pw ='abcedf'
credentials = Credentials(user, pw)
try:
account = Account(user, credentials=credentials, autodiscover=True)
for item in account.inbox.all().order_by('-datetime_received')[:10]:
print(item.subject, item.sender, item.datetime_received)
except:
input ('leider Fehler')
-----
Hier die Fehlermeldung:
--
Traceback (most recent call last):
File "EDIMail2a.py", line 1, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\__init__.py", line 1, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\account.py", line 6, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\autodiscover\__init__.py", line 1, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\autodiscover\cache.py", line 11, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\configuration.py", line 7, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\protocol.py", line 31, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\properties.py", line 11, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\fields.py", line 8, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\ewsdatetime.py", line 12, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\winzone.py", line 7, in <module>
File "c:\users\rcc ulc\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
exec(bytecode, module.__dict__)
File "exchangelib\util.py", line 17, in <module>
File "src\lxml\etree.pyx", line 74, in init lxml.etree
ImportError: cannot import name _elementpath
[7048] Failed to execute script 'EDIMail2a' due to unhandled exception!
Read Mail vom Exchange-Server
Hallo,
schau mal, hilft dir das weiter?
https://stackoverflow.com/questions/221 ... mporterror
Schau mal in das neu erstellte Verzeichnis, kannst du darin 'elementpath' finden? Wenn nicht, würde ich mal die 'include'-Option beim erstellen der *.exe versuchen.
Grüße
Dennis
schau mal, hilft dir das weiter?
https://stackoverflow.com/questions/221 ... mporterror
Schau mal in das neu erstellte Verzeichnis, kannst du darin 'elementpath' finden? Wenn nicht, würde ich mal die 'include'-Option beim erstellen der *.exe versuchen.
Grüße
Dennis
"When I got the music, I got a place to go" [Rancid, 1993]
-
- User
- Beiträge: 40
- Registriert: Donnerstag 7. März 2019, 09:48
Hallo Dennis,
erst einmal vielen Dank für die Info.
Ich arbeite mit der GUI des pyinstallers 'auto-py-to-exe'
kannst Du mir sagen wo ich hier die include-Option angeben kann?
ich habe das ganze Netz durchsucht, aber nichts gefunden.
ich kann leider auch auf der Webseite des pyinstallers nicht hierzu finden
Vielen Dank vorab.
Rudi
erst einmal vielen Dank für die Info.
Ich arbeite mit der GUI des pyinstallers 'auto-py-to-exe'
kannst Du mir sagen wo ich hier die include-Option angeben kann?
ich habe das ganze Netz durchsucht, aber nichts gefunden.
ich kann leider auch auf der Webseite des pyinstallers nicht hierzu finden
Vielen Dank vorab.
Rudi
-
- User
- Beiträge: 40
- Registriert: Donnerstag 7. März 2019, 09:48
danke gefunden : ---collect-submodules=elementpath 