Keeper-Security / Commander

Keeper Commander is a python-based CLI and SDK interface to the Keeper Security platform. Provides administrative controls, reporting, import/export and vault management.
https://www.keepersecurity.com/commander.html
MIT License
182 stars 74 forks source link

google-crc32c C extension could not be imported #1245

Closed msxdan closed 1 month ago

msxdan commented 1 month ago

Hi, I installed keepercommander using pipx and python 3.12 and I'm getting a warning about google-crc32c C extensión not being loaded.

/home/user/.local/share/pipx/venvs/keepercommander/lib/python3.12/site-packages/google_crc32c/__init__.py:29: RuntimeWarning: As the c extension couldn't be imported, `google-crc32c` is using a pure python implementation that is significantly slower. If possible, please configure a c build environment and compile the extension
  warnings.warn(_SLOW_CRC32C_WARNING, RuntimeWarning)

Steps to reproduce:

OS: Ubuntu 24.04 WSL Python: 3.12 Python env: pipx Command: pipx install keepercommander

Any idea how I could install the extension?

aaunario-keeper commented 1 month ago

According to the PyPi page for the dependency in question ("google-crc32c"), only Python versions <= 11 are supported. That said, you can either 1) install the previous version of python instead (3.11 or earlier) or 2) compile the C extension referred to in your error message (this is what the PyPi page above suggests, but requires a dev setup of sorts)

It's probably much easier to do the former than the latter, and without much of a downside.

msxdan commented 1 month ago

According to the PyPi page for the dependency in question ("google-crc32c"), only Python versions <= 11 are supported. That said, you can either

  1. install the previous version of python instead (3.11 or earlier) or
  2. compile the C extension referred to in your error message (this is what the PyPi page above suggests, but requires a dev setup of sorts)

It's probably much easier to do the former than the latter, and without much of a downside.

I installed python 3.11 and installed google-crc32c 1.5.0 but still showing the same warning

image

image

image

msxdan commented 1 month ago

Could be something related to pipx, I'll try to install it without it

image

msxdan commented 1 month ago

Even when installing keepercommander using python 3.11.9 without pipx shows the warning

image

Algo using python 3.9.5

image

sk-keeper commented 1 month ago

The Commander does not use this library directly. It is a dependency of the aiortc package. This warning means that there is no native package build for your system. The list of all builds can be checked here https://pypi.org/project/google-crc32c/#files

There is no build for Python3.12 (cp311 means Python3.11) Ubuntu 24 WSL uses Python 3.12. It was suggested to install older versions of Python from add-apt-repository ppa:deadsnakes/ppa

Python3.11 from that repo works fine

(test) username@hostname:~$ python
Python 3.11.9 (main, Apr 27 2024, 21:16:11) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google_crc32c
>>>`

Google provides a valid build for Python3.12 eventually.

Anyway it is just a warning. It does not affect the Commander's core functionality.

msxdan commented 1 month ago

The warning is a bit anoying because I use it with chezmoi but I can live with it.

Thank you both!

jometzner commented 1 week ago

Here is how I mitigated that warning in my Fedora 40 (Python 3.12.3) installation:

  1. Installed python3-google-crc32c using sudo dnf install python3-google-crc32c
  2. Uninstalled the wheel google-crc32c that was previously installed by pip3 in my $HOME/.local/lib/python3.12

No warning anymore