pertpy icon indicating copy to clipboard operation
pertpy copied to clipboard

pertpy cannot be imported on windows

Open pandaqiuqiu opened this issue 1 year ago • 5 comments

Report

When I install pertpy and then try to import it, I always encounter an error that cannot be loaded successfully. The error message is: import pertpy Fatal error: unable to initialize the JIT.

Specifically, the error occurs when trying to import pertpy:

Error in .makeMessage(..., domain = domain) : 3 arguments passed to .Internal(gettext) which requires 2 Error in gettext(fmt, domain = domain, trim = trim) : 3 arguments passed to .Internal(gettext) which requires 2 Error in Ops.numeric_version(R_version_built_under, "4.0.0") : there is no . .Internal function 'compareNumericVersion'.

It seems there may be an issue with the Just-In-Time (JIT) compiler, and it could be related to the version of R or some internal functions. The version of yy installed pertpy is 0.6.0, R is 4.1.1.

Version information


session_info 1.0.0

nt NA

Python 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)] Windows-10-10.0.22621-SP0

pandaqiuqiu avatar Nov 03 '23 14:11 pandaqiuqiu

Could you please tell me how R is related to this? Are you attempting to use pertpy through reticulate?

Zethson avatar Nov 03 '23 14:11 Zethson

Could you please tell me how R is related to this? Are you attempting to use pertpy through reticulate?

In fact, I initially used pip install pertpy to install pertpy, and the installation process seemed to proceed without errors. However, when I attempted to import pertpy, I encountered the following error:

import pertpy Installed version 0.4.0 of pertpy is outdated. Newest version is 0.6.0! AttributeError: module 'ml_dtypes' has no attribute 'float8_e4m3b11' Traceback (most recent call last): File "", line 1, in File "E:\software\anaconda3\lib\site-packages\pertpy_init_.py", line 13, in from . import data as dt File "E:\software\anaconda3\lib\site-packages\pertpy\data_init_.py", line 1, in from pertpy.data.datasets import ( File "E:\software\anaconda3\lib\site-packages\pertpy\data_datasets.py", line 3, in import muon as mu File "C:\Users\erzac\AppData\Roaming\Python\Python39\site-packages\muon_init.py", line 6, in from .core import preproc as pp File "C:\Users\erzac\AppData\Roaming\Python\Python39\site-packages\muon_core\preproc.py", line 16, in from umap.distances import euclidean File "E:\software\anaconda3\lib\site-packages\umap_init.py", line 7, in from .parametric_umap import ParametricUMAP File "E:\software\anaconda3\lib\site-packages\umap\parametric_umap.py", line 14, in import tensorflow as tf File "E:\software\anaconda3\lib\site-packages\tensorflow_init_.py", line 38, in from tensorflow.python.tools import module_util as module_util File "E:\software\anaconda3\lib\site-packages\tensorflow\python_init.py", line 42, in from tensorflow.python.saved_model import saved_model File "E:\software\anaconda3\lib\site-packages\tensorflow\python\saved_model\saved_model.py", line 20, in from tensorflow.python.saved_model import builder File "E:\software\anaconda3\lib\site-packages\tensorflow\python\saved_model\builder.py", line 23, in from tensorflow.python.saved_model.builder_impl import _SavedModelBuilder File "E:\software\anaconda3\lib\site-packages\tensorflow\python\saved_model\builder_impl.py", line 26, in from tensorflow.python.framework import dtypes File "E:\software\anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py", line 39, in _np_float8_e5m2 = pywrap_ml_dtypes.float8_e5m2() TypeError: Unable to convert function return value to a Python type! The signature was () -> handle

Subsequently, I created a new environment in Conda and installed pertpy within this environment. I also installed R-4.1.1 in this environment and configured os.environ["R_HOME"] and os.environ['R_path']. However, when I tried to import pertpy in this new environment, I still encountered the same error as before.

pandaqiuqiu avatar Nov 03 '23 14:11 pandaqiuqiu

Ah okay.

So

  1. You're not installing the latest pertpy version. Please run pip install -U pertpy
  2. You're using Windows which is the root of all evil here. We cannot provide perfect support for Windows at this stage because we have no developers using it. Please use WSL or Docker or something. Jax also has limited support for Windows.

Zethson avatar Nov 03 '23 14:11 Zethson

Yes, I initially installed the latest version 0.6.0 using "pip install pertpy --user" on Windows. After the installation, I encountered the following error when trying to import pertpy:

"ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (C:\Users\erzac\AppData\Roaming\Python\Python39\site-packages\torchmetrics\utilities\imports.py)."

So, I switched to using Anaconda, created a new environment for installation, but I still encountered numerous errors, and the import was unsuccessful.

pandaqiuqiu avatar Nov 03 '23 15:11 pandaqiuqiu

Yeah, as mentioned above, we cannot provide Windows support at the moment. Please use WSL or a Linux machine for now.

Zethson avatar Nov 07 '23 10:11 Zethson