Open snarflakes opened 1 year ago
Problem solved. Needed to install various dev tools and precursors and it was able to finish building the wheel.
openssl
Rust
Setup-rust
I was able to install this non-sudo. But I'm having a lot of difficulty installing it as sudo. I think it is the cryptography module that is holding up the install. I was able to sudo install cryptography via cryptography apt-install instead of PIP. Can you add "requirement already satisfied" for cryptography so it skips it when building pywalletconnect, that will hopefully allow me to move forward with the install as sudo? thanks!
More detail: looks like my system is having difficulty upgrading cryptography to the required version. Maybe I can sort this out. non-sudo version oddly appears to be 38?? while stuck sudo version is 2.6.1 "cryptography>=3.3", "wsproto==1.0.0",
On Linux, many Python packages with heavy C bindings are usually much easier to installed using the system package manager. This provides already compiled binary packages. The issue with this method is that the version is quite old. Even on an not so old Debian 10 you get v2.6.1 for cryptography for example.
I think we can downgrade the version requirement here, but that could downgrade the security. We setup to 3.3 because this is the version on Debian Bulleye 11. One method to solve this would be for you to use a more recent Linux system (Debian 11, Ubuntu 22.04, ...). As this is a crypto wallet usage, that would beef up the security.
Since pyWalletConnect has very little dependencies, and that's in the DNA of all our Python code, you can just install the other packages manually. Why using the setup file just for one remaining dependency? And pyWalletConnect doesn't need any build or compilation (it is pure-Python, so does wsproto)
You can do that :
sudo apt update
sudo apt install python3-cryptography
python3 -m pip install --upgrade pip
python3 -m pip install wsproto==1.0.0
And then you provide pyWalletConnect in its directory in your project, it should work.
Alternatively, you can downgrade the requirement yourself, and change setup.py L17 to "cryptography>=2.6",
That will install pyWalletConnect system-wide, if you need it for multiple software projects.
Like usual, you all make things super clear. I'm really grateful I was able to get this working as a "non-sudo" user. I now need pywalletconnect as root, unfortunately i didn't write down all the previous steps! I'm either going to try your above alternative recommendations, or I will figure out how i can recreate the steps I did previously, I will post them here when i figure it out. For future pi users here is a link to the discussion about problems with cryptography module on pi devices. cryptography module issues
I already updated pip. Thanks.
Note: sudo pip install cryptography says requirement already satisfied
Can't roll back cryptography; was not uninstalled Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-hlenyg9p/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-51ogsqmr/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-hlenyg9p/cryptography/
New errors:
Building wheel for cryptography (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for cryptography (pyproject.toml) did not run successfully. │ exit code: 1 note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cryptography Failed to build cryptography ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects