-
Notifications
You must be signed in to change notification settings - Fork 489
Closed
Description
The dateparser library uses a exec_module on the _strptime. This causes the import to fail when using the the embedded version of python as the import happens via zipimport and zipimport does not have exec_module() so the following error gets thrown on import dateparser
D:\DateParser Test\python-3.9.0-embed-amd64>python
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateparser
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\__init__.py", line 3, in <module>
from .date import DateDataParser
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\date.py", line 9, in <module>
from dateparser.date_parser import date_parser
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\date_parser.py", line 5, in <module>
from .conf import apply_settings
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\conf.py", line 5, in <module>
from .parser import date_order_chart
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\parser.py", line 12, in <module>
from dateparser.utils.strptime import strptime
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\utils\strptime.py", line 57, in <module>
__strptime = patch_strptime()
File "D:\DateParser Test\python-3.9.0-embed-amd64\lib\site-packages\dateparser\utils\strptime.py", line 28, in patch_strptime
_strptime_spec.loader.exec_module(_strptime)
AttributeError: 'zipimporter' object has no attribute 'exec_module'
>>>
Steps to Reproduce
-
Download the python.zip file the link below
https://www.python.org/ftp/python/3.9.0/python-3.9.0-embed-amd64.zip -
Uncomment import site in the python39._pth
-
Download pip from https://bootstrap.pypa.io/get-pip.py and run python get-pip.py to install pip
-
pip install dateparser
-
Run python
-
import dateparser
-
error above is thrown.
Please do let me know if any further information is required to reproduce problem.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels