jopohl / urh

Universal Radio Hacker: Investigate Wireless Protocols Like A Boss
GNU General Public License v3.0
10.86k stars 864 forks source link

Error installing with pip3 #671

Closed unrealex closed 5 years ago

unrealex commented 5 years ago

Hi,

I am runing xubuntu 18.04.2. Folllowed the guide https://github.com/jopohl/urh#generic-installation-with-pip-ubuntudebian

sudo pip3 install urh

Collecting urh Downloading https://files.pythonhosted.org/packages/26/e2/d634287457bf308a7ce51393a669717c5d0e08f0cf00ddd2dab1486dbf60/urh-2.7.2.tar.gz (2.9MB) 100% |████████████████████████████████| 2.9MB 427kB/s Complete output from command python setup.py egg_info:

Error compiling Cython file:
------------------------------------------------------------
...

from libcpp cimport bool
from libc.stdint cimport uint8_t, uint32_t, int32_t, int64_t

from urh.cythonext.util import crc
from urh.cythonext.util cimport bit_array_to_number
^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:13:0: 'urh/cythonext/util.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...

from libcpp cimport bool
from libc.stdint cimport uint8_t, uint32_t, int32_t, int64_t

from urh.cythonext.util import crc
from urh.cythonext.util cimport bit_array_to_number
^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:13:0: 'urh/cythonext/util/bit_array_to_number.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...

        M = <size_t>ceil(len_bitvector / 4)
        hexvector = np.zeros(M, dtype=np.uint8, order="C")

        for j in range(0, M):
            hexvector[j] = bit_array_to_number(bitvector, min(len_bitvector, 4*j+4), 4*j)
                          ^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:86:27: 'bit_array_to_number' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
...
        len_bv2 = len(bv2)
        k = min(len_bv1, len_bv2)
        for j in range(0, k, n_gram_length):
            index = j / n_gram_length
            if index < M:
                diff = bit_array_to_number(bv2, min(len_bv2, j + n_gram_length), j) -\
                      ^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:333:23: 'bit_array_to_number' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
...
        k = min(len_bv1, len_bv2)
        for j in range(0, k, n_gram_length):
            index = j / n_gram_length
            if index < M:
                diff = bit_array_to_number(bv2, min(len_bv2, j + n_gram_length), j) -\
                       bit_array_to_number(bv1, min(len_bv1, j+n_gram_length), j)
                      ^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:334:23: 'bit_array_to_number' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
...
    for j in range(0, end):
        index = message_indices[j]
        bits = bitvectors[index]
        crc_input = bits[data_start:data_stop]
        #check = int("".join(map(str, bits[crc_start:crc_stop])), 2)
        check = bit_array_to_number(bits[crc_start:crc_stop], crc_stop - crc_start)
               ^
------------------------------------------------------------

src/urh/cythonext/awre_util.pyx:363:16: 'bit_array_to_number' is not a constant, variable or function identifier
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-9tilztdn/urh/setup.py", line 145, in <module>
    ext_modules=get_extensions(),
  File "/tmp/pip-build-9tilztdn/urh/setup.py", line 104, in get_extensions
    extensions = cythonize(extensions, compiler_directives=COMPILER_DIRECTIVES, quiet=True, compile_time_env=device_extras)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Build/Dependencies.py", line 1097, in cythonize
    cythonize_one(*args)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Build/Dependencies.py", line 1220, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: src/urh/cythonext/awre_util.pyx
Found airspy lib. Will compile with native airspy support
Skipping native support for bladerf
Found hackrf lib. Will compile with native hackrf support
Skipping native support for limesdr
Skipping native support for plutosdr
Found rtlsdr lib. Will compile with native rtlsdr support
Found uhd lib. Will compile with native usrp support
Found mirsdrapi-rsp lib. Will compile with native sdrplay support
    Detected SDRPLAY_API_VERSION v2.13

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9tilztdn/urh/

jopohl commented 5 years ago

Fixed with v2.7.3.

unrealex commented 5 years ago

Thanks!