-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
RNS python package does not recognize dependencies #336766
Comments
Digging a bit deeper it seems like the program is generating some python script in my config folder |
It seems to download its own version of esptool. We should patch the code to use the esptool package from Nixpkgs. |
I think this is what's happening: https://github.com/markqvist/Reticulum/blob/a1be97bd69e54ac10bdd90f82af1b50649b35b88/RNS/Utilities/rnodeconf.py#L3689 It's literally writing a script to file and then calling it. I thought about changing the shebang to use the Nixpkgs python3 version via |
You could probably replace it with something like this? (taken from wiki) #! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3Packages.pyserial Not sure if there are other dependencies that are needed or how to patch the code (I am so far only user of NixOS) |
OK this are the imports from the file that gets decoded: import argparse,base64,binascii,copy,hashlib,inspect,io,itertools,os,shlex,string,struct,sys,time,zlib
try:
import serial
except ImportError:
print('Pyserial is not installed for %s. Check the README for installation instructions.'%sys.executable)
raise
try:
if 'serialization' in serial.__doc__ and 'deserialization' in serial.__doc__:
raise ImportError("\nesptool.py depends on pyserial, but there is a conflict with a currently installed package named 'serial'.\n\nYou may be able to work around this by 'pip uninstall serial; pip install pyserial' but this may break other installed Python software that depends on 'serial'.\n\nThere is no good fix for this right now, apart from configuring virtualenvs. See https://github.com/espressif/esptool/issues/269#issuecomment-385298196 for discussion of the underlying issue(s).")
except TypeError:
pass
try:
import serial.tools.list_ports as list_ports
except ImportError:
print('The installed version (%s) of pyserial appears to be too old for esptool.py (Python interpreter %s). Check the README for installation instructions.'%(sys.VERSION,sys.executable))
raise
except Exception:
if sys.platform == 'darwin':
list_ports = _A
else:
raise no other imports in the rest of the file. So it seems like only the |
I sent a PR here: #337285 do you wanna test it out? You can build it locally by pulling down this PR and running this in the root of nixpkgs directory:
|
Closes NixOS#336766 Fixes the generated script's shebang to use Python environment from nix.
Look what I have found: markqvist/Reticulum#60 (comment) Could this be the whole reason behind this? |
Describe the bug
I want to use binaries from RNS package. I am able to install it and run it but once I get to the part of the program that requires
serial
(pyserial package ) it fails with this error:But I can see
pyserial
listed as dependency, so I am not sure what is going on.Steps To Reproduce
Steps to reproduce the behavior:
pkgs.python312Packages.rns
to your packagesrnodeconf --autoinstall
and select correct values for your deviceExpected behavior
pyserial
is recognized as installed dependencyNotify maintainers
@fabaff
Metadata
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: