Skip to content
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

polars failed to import after install version newer than 0.20.16 #15450

Open
2 tasks done
l1t1 opened this issue Apr 3, 2024 · 7 comments
Open
2 tasks done

polars failed to import after install version newer than 0.20.16 #15450

l1t1 opened this issue Apr 3, 2024 · 7 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@l1t1
Copy link

l1t1 commented Apr 3, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

pip install jupysql duckdb-engine
pip install asqlcell
pip install polars -U

then

C:\Users\LD>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars as pl
D:\Python38\lib\site-packages\polars\meta\build.py:5: UserWarning: Polars binary is missing!
  from polars._utils.polars_version import get_polars_version
>>> df = pl.read_parquet("d:/1687.zstd.parquet")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python38\lib\site-packages\polars\_utils\deprecation.py", line 134, in wrapper
    return function(*args, **kwargs)
  File "D:\Python38\lib\site-packages\polars\_utils\deprecation.py", line 134, in wrapper
    return function(*args, **kwargs)
  File "D:\Python38\lib\site-packages\polars\io\parquet\functions.py", line 171, in read_parquet
    lf = scan_parquet(
  File "D:\Python38\lib\site-packages\polars\_utils\deprecation.py", line 134, in wrapper
    return function(*args, **kwargs)
  File "D:\Python38\lib\site-packages\polars\_utils\deprecation.py", line 134, in wrapper
    return function(*args, **kwargs)
  File "D:\Python38\lib\site-packages\polars\io\parquet\functions.py", line 311, in scan_parquet
    return pl.LazyFrame._scan_parquet(
  File "D:\Python38\lib\site-packages\polars\lazyframe\frame.py", line 472, in _scan_parquet
    self._ldf = PyLazyFrame.new_from_parquet(
NameError: name 'PyLazyFrame' is not defined

Log output

No response

Issue description

all features of polars cannot be use

Expected behavior

it works as normal

Installed versions

--------Version info---------
Polars:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python38\lib\site-packages\polars\meta\versions.py", line 53, in show_versions
    print(f"{'Index type:':{keylen}s} {get_index_type()}")
  File "D:\Python38\lib\site-packages\polars\meta\index_type.py", line 27, in get_index_type
    return plr.get_index_type()
NameError: name 'plr' is not defined
@l1t1 l1t1 added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Apr 3, 2024
@l1t1
Copy link
Author

l1t1 commented Apr 3, 2024

pip logs
pip-log.txt

@l1t1
Copy link
Author

l1t1 commented Apr 9, 2024

version 0.20.19 still cannot run

D:\>pip install polars -U
WARNING: Ignoring invalid distribution -uckdb (d:\python38\lib\site-packages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: polars in d:\python38\lib\site-packages (0.20.18)
Collecting polars
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a6/78/d8ce1fe04adb29fa25bdc56c27a07bbbdd3acb3e8eedc4c116a427f86ee9/polars-0.20.19-cp38-abi3-win_amd64.whl (26.2 MB)
     ---------------------------------------- 26.2/26.2 MB 22.6 MB/s eta 0:00:00
WARNING: Ignoring invalid distribution -uckdb (d:\python38\lib\site-packages)
DEPRECATION: pytorch-lightning 1.7.7 has a non-standard dependency specifier torch>=1.9.*. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pytorch-lightning or contact the author to s
uggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: polars
  Attempting uninstall: polars
    Found existing installation: polars 0.20.18
    Uninstalling polars-0.20.18:
      Successfully uninstalled polars-0.20.18
Successfully installed polars-0.20.19


C:\Users\LD>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars
D:\Python38\lib\site-packages\polars\meta\build.py:5: UserWarning: Polars binary is missing!
  from polars._utils.polars_version import get_polars_version
>>> polars.__version__
''

@l1t1
Copy link
Author

l1t1 commented Apr 9, 2024

but If I install it on a new machine, everything is ok

C:\Users\LD>pip install polars
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting polars
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a6/78/d8ce1fe04adb29fa25bdc56c27a07bbbdd3acb3e8eedc4c116a427f86ee9/polars-0.20.19-cp38-abi3-win_amd64.whl (26.2 MB)
     ---------------------------------------- 26.2/26.2 MB 13.6 MB/s eta 0:00:00
Installing collected packages: polars
Successfully installed polars-0.20.19

C:\Users\LD>pip list installed
Package Version
------- -------
pip     24.0
polars  0.20.19

C:\Users\LD>python
Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars
>>> polars.__version__
'0.20.19'

@im5h
Copy link

im5h commented Apr 13, 2024

This error message only appears on Windows 7 systems. It works fine on Windows 11 systems. Based on my testing, installing a version higher than 0.20.16 on Windows 7 results in this error, while installing version 0.20.16 works correctly.

这个报错信息只出现在Windows7系统上,在Windows11系统上正常,经过我的测试,在Windows7上安装大于0.20.16的版本就会有这个报错,安装0.20.16版本则正常。

@l1t1
Copy link
Author

l1t1 commented Apr 15, 2024

This error message only appears on Windows 7 systems. It works fine on Windows 11 systems. Based on my testing, installing a version higher than 0.20.16 on Windows 7 results in this error, while installing version 0.20.16 works correctly.

这个报错信息只出现在Windows7系统上,在Windows11系统上正常,经过我的测试,在Windows7上安装大于0.20.16的版本就会有这个报错,安装0.20.16版本则正常。

you are right, 0.20.16 is ok

C:\Users\LD>pip install polars==0.20.16
WARNING: Ignoring invalid distribution -uckdb (d:\python38\lib\site-packages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting polars==0.20.16
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ed/bd/35e3480f180c3e9bc57ef402c0b6e881da6909aaeff4eb31790e2e07beea/polars-0.20.16-cp38-abi3-win_amd64.whl (26.1 MB)
     ---------------------------------------- 26.1/26.1 MB 34.5 MB/s eta 0:00:00
WARNING: Ignoring invalid distribution -uckdb (d:\python38\lib\site-packages)
DEPRECATION: pytorch-lightning 1.7.7 has a non-standard dependency specifier torch>=1.9.*. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pytorch-lightning or contact the author to s
uggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: polars
  Attempting uninstall: polars
    Found existing installation: polars 0.20.19
    Uninstalling polars-0.20.19:
      Successfully uninstalled polars-0.20.19
Successfully installed polars-0.20.16

C:\Users\LD>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars
>>> polars.__version__
'0.20.16'
>>> df = polars.read_parquet("d:/1687.zstd.parquet")
>>> df
shape: (16_870_000, 16)

@l1t1 l1t1 changed the title polars failed to import after install jupysql and asqlcell polars failed to import after install version newer than 0.20.16 Apr 15, 2024
@cmdlineluser
Copy link
Contributor

Not sure if it will be any help here but trying to read polars.abi3.so with ctypes.DLL() may yield some extra error information.

#13094 (comment)

(Not sure if the same applies for Windows)

@eitsupi
Copy link
Contributor

eitsupi commented Apr 15, 2024

Maybe related to rust-lang/rust#121317

If I understand correctly, rustc no longer generates binaries compatible with Windows 7 by default.
So if you build polars from source it may work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

4 participants