SigMF icon indicating copy to clipboard operation
SigMF copied to clipboard

Python code in full, please, then I can run without erros

Open mibangah opened this issue 3 years ago • 6 comments

I am kind of not familiar with Python. What exactly do I need to type in at the line: "pip install ." And, the same question on the line:"pytest" I also have error message at the line "handle = sigmf.sigmffile.fromfile('example.sigmf') as follows. AttributeError: module 'sigmf.sigmffile' has no attribute 'fromfile'

What do I need to do to make it run nicely?

Thank you.

mibangah avatar Jan 13 '22 00:01 mibangah

Hello @mibangah -- Please do review the explanation of what pip is to make sure you generally understand what the purpose of that line is, at https://pypi.org/project/pip/

Some basic prerequisites are to have pip installed for the version of python you're targeting. So, if you're running ubuntu linux, you would get it by running something like sudo apt install python3-pip. Here's what I get when I run the line you referenced:

root@b23bef708631:/Users/glenm/src/SigMF# pip3 install .
Processing /Users/glenm/src/SigMF
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from SigMF===1.0.1-glenm) (1.17.4)
Building wheels for collected packages: SigMF
  Building wheel for SigMF (setup.py) ... done
  Created wheel for SigMF: filename=SigMF-1.0.1_glenm-py2.py3-none-any.whl size=37229 sha256=d66633f89678b61048bdeebc142ae5e089e0b8ffbfe296401a55f0dbc633f5fa
  Stored in directory: /tmp/pip-ephem-wheel-cache-0_r3qlbb/wheels/63/4b/fb/bd9315901fd1fc30aa084b23157594f7c46c9e3db28041cb30
Successfully built SigMF
Installing collected packages: SigMF
Successfully installed SigMF-1.0.1-glenm

For the pytest line I do:

root@b23bef708631:/Users/glenm/src/SigMF# apt install python3-pytest
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:

<snip>

0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 475 kB of archives.
After this operation, 2322 kB of additional disk space will be used.
Do you want to continue? [Y/n] 

<snip>

root@b23bef708631:/Users/glenm/src/SigMF# pytest-3 
=========================================================================================== test session starts ============================================================================================
platform linux -- Python 3.8.10, pytest-4.6.9, py-1.8.1, pluggy-0.13.0
rootdir: /Users/glenm/src/SigMF
collected 28 items                                                                                                                                                                                         

tests/test_archive.py .............                                                                                                                                                                  [ 46%]
tests/test_sigmffile.py ...........                                                                                                                                                                  [ 85%]
tests/test_validation.py ....                                                                                                                                                                        [100%]

======================================================================================== 28 passed in 0.89 seconds =========================================================================================
root@b23bef708631:/Users/glenm/src/SigMF# 

If you can get through those steps, then you're on the right track. Please reply back if you can get that far and still have trouble with sigmf.sigmffile, sound good?

gmabey avatar Jan 13 '22 16:01 gmabey

Thanks @gmabey , I use google colab and I tried some based on the page you guided.

At the first line, I inserted: pip install git+https://github.com/gnuradio/SigMF.git At the second line: pip install pytest

So far so good.

Now I have a different error message at the line: "handle = sigmf.sigmffile.fromfile('example.sigmf') as follows. FileNotFoundError: [Errno 2] No such file or directory: 'example.sigmf-meta' Is this because I don't have "example.sigmf-meta" file in the folder? Where can I get any example files? I appreciate it. Thanks!

mibangah avatar Jan 13 '22 17:01 mibangah

@mibangah One of the examples I often refer to is in the logo/ directory: sigmf_logo.sigmf-{data,meta}

gmabey avatar Jan 17 '22 21:01 gmabey

Hello @mibangah ! Any luck? If so, then please do go ahead and close this issue, just to reduce the total number of issues that are open.

gmabey avatar Jan 22 '22 00:01 gmabey

Thanks, @gmabey I will try soon, please do not close it.

mibangah avatar Jan 22 '22 00:01 mibangah

Will leave this one open for a bit longer, let us know if you have questions, @mibangah

bhilburn avatar Jan 27 '22 15:01 bhilburn