-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load mizani.transforms on some platforms due to lack of system tzdata on some platforms #27
Comments
|
tzdata is a required dependency on windows. That specification is enabled by PEP 508 which makes it possible to condition requirements based on different markers in the installation environment. I suspect it is pyodide/micropip not being fully compliant with these environment markers. But then there is this function in micropip dedicated to pep508 without any caveats! I don't know what to make of it, something is not quite right. |
|
Got it. pyodide is not Windows. Welcome to the Pyodide terminal emulator 🐍
Python 3.10.2 (main, Jan 25 2023 18:32:53) on WebAssembly/Emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.system()
'Emscripten'
>>> |
|
Testing that micropip respects environment markers Welcome to the Pyodide terminal emulator 🐍
Python 3.10.2 (main, Jan 25 2023 18:32:53) on WebAssembly/Emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.system()
'Emscripten'
>>> platform.system = lambda: "Windows"
>>> platform.system()
'Windows'
>>> import micropip
>>> await micropip.install("mizani")
>>> import mizani.transforms
>>> |
|
Here is a comment about |
On some platforms, the system does not provide
tzdata, and this causesimport mizani.transformsto result in an error.For example, on recent versions of Pyodide, tzdata is not included. If you run the following in the pyodide web console, it will result in an error.
The error comes from this line:
mizani/mizani/transforms.py
Line 54 in eb78065
I believe that Windows also does not include tzdata by default, but I don't know for sure. PEP 615 has something to say about this.
It is possible to make it work, by installing the
tzdatamodule from PyPI. Running this in the pyodide web console will work:I don't know what the best way is to specify a dependency on the tzdata module -- it doesn't seem like it should be a hard dependency, because it is only necessary if the system doesn't provide tzdata.
The text was updated successfully, but these errors were encountered: