You are not logged in.

#1 2024-08-08 10:26:36

archqt
Member
Registered: 2015-04-29
Posts: 200

polars and fastexcel not installed ?

Hi,
i installed python-polars, but when i use it it says that fastexcel is not installed. Fastexcel is used by polars but is not on dependencies.
When i type

pip install python-fastexcel

It doesn't work, and fastexcel is not on package from archlinux. I even tried pipx. Is there a way to install it ?

Sincerely

Offline

#2 2024-08-08 10:30:45

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,574

Re: polars and fastexcel not installed ?

There are 2 python-polars packages in aur, which one are you using ?


Moderator Note :
Moved to AUR Issues, Discussion & PKGBUILD Requests


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-08-08 12:14:57

archqt
Member
Registered: 2015-04-29
Posts: 200

Re: polars and fastexcel not installed ?

Lone_Wolf wrote:

There are 2 python-polars packages in aur, which one are you using ?

python-polars-bin 1.4.1-1

Offline

#4 2024-08-08 12:41:31

loqs
Member
Registered: 2014-03-06
Posts: 18,730

Re: polars and fastexcel not installed ?

fastexcel is an un-packaged optional dependency of polars at least based on:

python -c 'import polars'

How can I reproduce the error you are encountering?

Offline

#5 2024-08-08 13:32:07

archqt
Member
Registered: 2015-04-29
Posts: 200

Re: polars and fastexcel not installed ?

import polars as pl

data=pl.read_ods(source="test.ods",
                 schema_overrides={"dt":pl.String},
                 raise_if_empty=False,
                )

print(data.columns)

And i have this error

Traceback (most recent call last):

  File /usr/lib/python3.12/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File ~/Cours/Planning/test_polar.py:3
    data=pl.read_ods(source="test.ods",

  File /usr/lib/python3.12/site-packages/polars/io/spreadsheet/functions.py:439 in read_ods
    return _read_spreadsheet(

  File /usr/lib/python3.12/site-packages/polars/io/spreadsheet/functions.py:545 in _read_spreadsheet
    reader_fn, parser, worksheets = _initialise_spreadsheet_parser(

  File /usr/lib/python3.12/site-packages/polars/io/spreadsheet/functions.py:655 in _initialise_spreadsheet_parser
    fastexcel = import_optional("fastexcel", min_version="0.7.0")

  File /usr/lib/python3.12/site-packages/polars/dependencies.py:280 in import_optional
    raise ModuleNotFoundError(err_message) from None

ModuleNotFoundError: required package 'fastexcel' not found.
Please install using the command `pip install fastexcel`.

Offline

#6 2024-08-08 16:03:06

loqs
Member
Registered: 2014-03-06
Posts: 18,730

Re: polars and fastexcel not installed ?

The following is a very rough PKGBUILD for fastexcel:

_name=fastexcel
pkgname=python-$_name
pkgver=0.11.5
pkgrel=1
pkgdesc='A Python wrapper around calamine '
arch=('x86_64')
url="https://github.com/ToucanToco/fastexcel"
license=('MIT')
depends=('python')
makedepends=('cargo' 'maturin' 'python-installer' 'git')
checkdepends=('python')
#options=('!lto')
source=("git+$url.git#tag=v$pkgver")
sha256sums=('e991a046e5d19ce3e78d29531680821898fcd380d948d602d8ebf4b359a497dc')

prepare() {
  cd $_name
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd $_name
  maturin build --locked --release --all-features --target "$(rustc -vV | sed -n 's/host: //p')" --strip
}

package() {
  python -m installer --destdir="$pkgdir" $_name/target/wheels/*.whl
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" $_name/LICENSE
}

Offline

#7 2024-08-10 17:28:09

archqt
Member
Registered: 2015-04-29
Posts: 200

Re: polars and fastexcel not installed ?

Hi,
thanks.
I did the PKGBUILD file, did makepkg then it created a file python-fastexcel-0.11.5-1-x86_64.pkg

I then did

sudo pacman -U python-fastexcel-0.11.5-1-x86_64.pkg.tar.zst

I had to installed python-pyarrow and the error was removed.

As you did the PKGBUILD it would be nice to give access to the package to everyone. And add the python-pyarrow installed automaticaly too.
As it is your job (and good one), can you propose this package to AUR ? If you can't i will try to do it.
Thanks
Sincerely

Offline

#8 2024-08-10 18:56:38

loqs
Member
Registered: 2014-03-06
Posts: 18,730

Re: polars and fastexcel not installed ?

archqt wrote:

As it is your job (and good one), can you propose this package to AUR ? If you can't i will try to do it.
Thanks
Sincerely

I am glad the PKGBUILD worked for you. I do not intend to submit the PKGBUILD to AUR as I do not use the package which I feel would make me a poor maintainer for it.

Last edited by loqs (2024-08-10 18:56:47)

Offline

Board footer

Powered by FluxBB