MITHaystack / srt-py

BSD 3-Clause "New" or "Revised" License
10 stars 14 forks source link

Conda building error #19

Closed AlexKurek closed 2 months ago

AlexKurek commented 7 months ago

conda build srt-py does not work due to dependency issues:

    conda.exceptions.PackagesNotFoundError: The following packages are not available from current channels:

      - yamale
      - soapysdr-module-rtlsdr
      - soapysdr
      - rtl-sdr
      - gnuradio-zeromq
      - gnuradio-osmosdr
      - gnuradio-core
      - digital_rf
      - dash-bootstrap-components

I also could not build it using: conda build srt-py --channel conda-forge --python 3.11.7 nor conda build srt-py --channel conda-forge --python 3.10.13

ryanvolz commented 6 months ago

This is happening because the recipe builds against the most recent version of Python (3.12) no matter what you might specify on the command line, and digital_rf doesn't yet have a release that is compatible with Python 3.12. I put together a fix that makes the conda package independent of the Python version, so it will work even without an update to digital_rf.

AlexKurek commented 6 months ago

@ryanvolz After installing like so:

conda install conda-build conda-verify
git clone -b update-conda-recipe https://github.com/ryanvolz/srt-py
conda create -y --name srtpy
conda activate srtpy
conda build srt-py --channel conda-forge --no-test
conda build purge
mkdir srtpy-config/
cp /home/kurek/srt-py/config/* ~/srtpy-config/
rm -rf ~/srt-py/
conda deactivate

Im trying to run it:

conda activate srtpy
python ./miniconda3/pkgs/srt-py-1.1.1-py_0/python-scripts/srt_runner.py --config_dir=~/srtpy-config/

and getting:

  File "./miniconda3/pkgs/srt-py-1.1.1-py_0/python-scripts/srt_runner.py", line 12, in <module>
    from waitress import serve
ImportError: No module named waitress

Doing: conda list srtpy returns empty list.

When I do both

conda activate base
conda activate srtpy

Im getting:

  File "/home/kurek/./miniconda3/pkgs/srt-py-1.1.1-py_0/python-scripts/srt_runner.py", line 13, in <module>
    from srt import config_loader
ImportError: cannot import name 'config_loader' from 'srt' (/home/kurek/miniconda3/envs/srtpy/lib/python3.12/site-packages/srt.py)
ryanvolz commented 6 months ago

There's nothing in your srtpy environment because you're missing the step of installing the package that you built:

conda install --use-local srt-py

I should update the README too once we have a list of steps that work.

AlexKurek commented 6 months ago

Ok, thank you. So now it is:

conda update -y --all
conda install -y conda-build conda-verify
git clone -b update-conda-recipe https://github.com/ryanvolz/srt-py
conda create -y --name srtpy
conda activate srtpy
conda build srt-py --channel conda-forge --no-test
conda install --use-local srt-py

and Im getting:

Channels:
 - local
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides dash-bootstrap-components needed by srt-py-1.1.1-py_0

Could not solve for environment specs
The following package could not be installed
└─ srt-py is not installable because it requires
   └─ dash-bootstrap-components, which does not exist (perhaps a missing channel).
ryanvolz commented 6 months ago

Not having the conda-forge channel by default is what's causing this error now. How about this sequence:

(navigate to srt-py directory)
conda install conda-build conda-verify
conda build -c conda-forge recipe
conda create -n srtpy
conda activate srtpy
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install --use-local srt-py
AlexKurek commented 6 months ago

This sequence is working.

In summary, this is what I have to do on Ubuntu 22 to start SRT-Py:

# conda update -y --all
conda install -y conda-build conda-verify
git clone -b update-conda-recipe https://github.com/ryanvolz/srt-py # https://github.com/MITHaystack/srt-py/issues/19#issuecomment-1930609080
conda build -c conda-forge srt-py # --no-test
conda create -y -n srtpy
conda activate srtpy
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install -y --use-local srt-py
mkdir srtpy-config/
cp -r ~/srt-py/config/{config.yaml,schema.yaml,sky_coords.csv} ~/srtpy-config/
cp -r ~/srt-py/examples/example_cmd_file.txt ~/
rm -rf ~/srt-py/
sudo ln -s ~/miniconda3/envs/srtpy/lib/udev/rules.d/rtl-sdr.rules /etc/udev/rules.d/ # enable udev device setup of rtl-sdr hardware
sudo udevadm control --reload && sudo udevadm trigger # reload your udev rules
conda deactivate
conda build purge
sudo apt purge brltty # https://askubuntu.com/questions/1403705/dev-ttyusb0-not-present-in-ubuntu-22-04
sudo rm -rv /var/lib/BrlAPI/
sudo usermod -a -G tty,dialout $USER # https://github.com/esp8266/source-code-examples/issues/26#issuecomment-320999460 proper logout required after this
AlexKurek commented 4 months ago

I have updated the installation instructions in my fork: https://github.com/AlexKurek/srt-py/blob/master/README.md#building-the-conda-package-locally