linuxmint / warpinator

Share files across the LAN
GNU General Public License v3.0
1.17k stars 80 forks source link

No module named 'cryptography' #128

Closed coreybruce closed 2 years ago

coreybruce commented 2 years ago

Hey I just wanted to report a issue I am having with Warpinator, I am using Arch32 and I have tried both the package on the repo and the warpinator-git package on the AUR and run into the same error message No module named 'cryptography'

xenopeek commented 2 years ago

Is the python-cryptography package from the Arch32 repository installed?

coreybruce commented 2 years ago

Yes and it will still say No module named 'cryptography'

xenopeek commented 2 years ago

You'll have to investigate what's wrong with your Python install. I don't know Arch32. You might instead take help with troubleshooting this from their forum. At least get a confirmation from another Arch32 user they can reproduce this issue.

Maybe you installed Python modules outside of pacman, without using virtualenv?

Try a short test from the terminal:

  1. Confirm that which python3 replies /usr/bin/python3.
  2. Check the version with python3 --version. Unless Arch32 is holding back packages it should be 3.10.4.
  3. Start the interactive Python console with python3 and paste these commands in to it and press Enter to run:
    from cryptography import x509
    from cryptography.hazmat.primitives import serialization as crypto_serialization
    from cryptography.hazmat.primitives.asymmetric import rsa
    from cryptography.hazmat.primitives import hashes
    from cryptography.hazmat.backends import default_backend as crypto_default_backend
    from cryptography.x509.oid import NameOID

    That's the bit that is in Warpinator auth.py for importing from the cryptography module. See if this gives any errors in the output. It will output nothing if it went okay and you're back on the >>> prompt. Ctrl+D to leave the Python console.

coreybruce commented 2 years ago

my python version is 3.10.4-1.0

I reinstalled python3 and now when I run Warpinator I get this message suggesting it cant find the lib file it needs

libabsl_time_zone.so.2111.0.0: cannot open shared object file: No such file or directory

Looking into my system it looks like it's looking for libabsl_time_zone.so.2111.0.0 but I have a newer version of the libabsl libs, a workaround is to symlink new shortcuts for what it's looking for since it's looking for static versioned libs so I will give you a update on how it goes.

coreybruce commented 2 years ago

Waprinator should be looking for the lib files it needs that aren't statically versioned,these are the libs I had to symlink as a work around and the commands I did

sudo ln -s /usr/lib/libabsl_time_zone.so /usr/lib/libabsl_time_zone.so.2111.0.0

sudo ln -s /usr/lib/libabsl_status.so /usr/lib/libabsl_status.so.2111.0.0

sudo ln -s /usr/lib/libabsl_spinlock_wait.so /usr/lib/libabsl_spinlock_wait.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cordz_info.so /usr/lib/libabsl_cordz_info.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cordz_info.so.2111.0.0

sudo ln -s /usr/lib/libabsl_statusor.so /usr/lib/libabsl_statusor.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cord.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cord.so.2111.0.0

sudo ln -s /usr/lib/libabsl_time.so /usr/lib/libabsl_time.so.2111.0.0

sudo ln -s /usr/lib/libabsl_hash.so /usr/lib/libabsl_hash.so.2111.0.0

sudo ln -s /usr/lib/libabsl_str_format_internal.so /usr/lib/libabsl_str_format_internal.so.2111.0.0

After doing that I ran into this next issue with python 3.10

[corey@Corey-Fujitsu ~]$ warpinator
/usr/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-i386-linux-gnu.so: undefined symbol: _ZN4absl12lts_2021110213time_internal12IDivDurationEbNS0_8DurationES2_PS2_

Found a similar issue to do with grpc

https://github.com/grpc/grpc/issues/25235

but I got around that by doing

sudo mv /usr/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-i386-linux-gnu.so /usr/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-i386-linux-gnu.so.old

Than

sudo ln -s /usr/lib/libgrpc.so.21 /usr/lib/python3.10/site-packages/grpc/_cython/libgrpc.so

sigh more symlinking now..

sudo ln -s /usr/lib/libabsl_city.so /usr/lib/libabsl_city.so.2111.0.0

sudo ln -s /usr/lib/libabsl_hash.so /usr/lib/libabsl_low_level_hash.so.2111.0.0

sudo ln -s /usr/lib/libabsl_raw_hash_set.so /usr/lib/libabsl_raw_hash_set.so.2111.0.0

sudo ln -s /usr/lib/libabsl_hashtablez_sampler.so /usr/lib/libabsl_hashtablez_sampler.so.2111.0.0

sudo ln -s /usr/lib/libabsl_bad_variant_access.so /usr/lib/libabsl_bad_variant_access.so.2111.0.0

sudo ln -s /usr/lib/libabsl_bad_optional_access.so /usr/lib/libabsl_bad_optional_access.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cord_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cordz_functions.so.2111.0.0

sudo ln -s /usr/lib/libabsl_exponential_biased.so /usr/lib/libabsl_exponential_biased.so.2111.0.0

sudo ln -s /usr/lib/libabsl_cord.so /usr/lib/libabsl_cordz_handle.so.2111.0.0

sudo ln -s /usr/lib/libabsl_stacktrace.so /usr/lib/libabsl_stacktrace.so.2111.0.0

sudo ln -s /usr/lib/libabsl_symbolize.so /usr/lib/libabsl_symbolize.so.2111.0.0

sudo ln -s /usr/lib/libabsl_debugging_internal.so /usr/lib/libabsl_debugging_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_demangle_internal.so /usr/lib/libabsl_demangle_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_malloc_internal.so /usr/lib/libabsl_malloc_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_graphcycles_internal.so /usr/lib/libabsl_graphcycles_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_malloc_internal.so /usr/lib/libabsl_malloc_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_throw_delegate.so /usr/lib/libabsl_throw_delegate.so.2111.0.0

sudo ln -s /usr/lib/libabsl_int128.so /usr/lib/libabsl_int128.so.2111.0.0

sudo ln -s /usr/lib/libabsl_strings_internal.so /usr/lib/libabsl_strings_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_base.so /usr/lib/libabsl_base.so.2111.0.0

sudo ln -s /usr/lib/libabsl_raw_logging_internal.so /usr/lib/libabsl_raw_logging_internal.so.2111.0.0

sudo ln -s /usr/lib/libabsl_log_severity.so /usr/lib/libabsl_log_severity.so.2111.0.0

sudo ln -s /usr/lib/libabsl_civil_time.so /usr/lib/libabsl_civil_time.so.2111.0.0

Sigh another issue with libgpr..

[corey@Corey-Fujitsu ~]$ warpinator
/usr/lib/libgpr.so.21: undefined symbol: _ZN4absl12lts_202111025MutexD1Ev
coreybruce commented 2 years ago

Any feedback at all about this?

mtwebster commented 2 years ago

Warpinator is a python program that imports python modules. If these modules are broken or missing it's an issue with those packages on your distro or perhaps the system itself.

coreybruce commented 2 years ago

Warpinator is a python program that imports python modules. If these modules are broken or missing it's an issue with those packages on your distro or perhaps the system itself. They aren't broken or missing, you can clearly see I am having issues with it looking for old dependencies when there is a newer version available

it's using 2111.0.0 when there is a newer version available also it shouldn't be looking for a static version, this has not been resolved so please don't close it.

mtwebster commented 2 years ago

Warpinator is not looking for specific versions. It's trying to load a module, and python decides the rest. This is your python setup or some sort of packaging problem. Maybe try this from a new user account? Have you tried to get any support from your distro's forums/support channels?

How did you install all the modules? Using pacman or pip? I don't recommend this at all but you could try installing the pip version of grpcio.

We're not trying to avoid helping. There's nothing we can do except offer suggestions which is what we're doing. You'd be better off asking them some place where people know your distro.

coreybruce commented 2 years ago

No not yet, I came to the devs first to report the issue but I will also report it to the Arch32 devs and link this to them to read through

andreasbaumann commented 2 years ago

Arch32 dev chiming in here :-) libabsl_time_zone.so.2111.0.0: cannot open shared object file: No such file or directory

abseil-cpp version mismatch.

I'm pretty sure, this is a pure Arch32 problem. :-)