anastas / gr-cdma

a cdma physical layer for Gnuradio
84 stars 39 forks source link

Attribute error: packet_header2 #22

Closed Tilenk closed 7 years ago

Tilenk commented 7 years ago

I'm having trouble installing your OOP package. When I try to import cdma in Python I get the following error

>>> import cdma CDMA PARAMETERS : for adaptive coded modulation Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/cdma/__init__.py", line 34, in <module> import cdma_parameters File "/usr/local/lib/python2.7/dist-packages/cdma/cdma_parameters.py", line 110, in <module> local_header_obj = cdma.packet_header2(bits_per_header,length_tag_name,num_tag_name, header_mod.bits_per_symbol(),tcm_type_selector_default, "tcm_type") AttributeError: 'module' object has no attribute 'packet_header2' I followed your guide for installing.

Part of the cdma_parameters.py that I changed prefix="/home/ubuntu/Dropbox/Faks/ISRM/prvi_letnik/Ponavljanje/ARP2/Project/Code/gr-cdma/"

My directory: drwxrwxr-x 2 ubuntu ubuntu 4096 may 21 16:06 build_cdma drwxrwxr-x 12 ubuntu ubuntu 4096 may 21 16:19 gr-cdma

I'm running Ubuntu 16.04 and using the current version of the gr-cdma.

anastas commented 7 years ago

This is strange: Your python knows where the "cdma" package is located according to your output. Maybe the make command was not succesful and did not build the "packet_header2"...

can you send me the output of your "cmake", "make", and "sudo make install" commands.

Tilenk commented 7 years ago

Here's the requested file output_cdma.txt

anastas commented 7 years ago

Your system does not have the proper SWIG look at cmake output:

-- Checking for module SWIG -- Disabling SWIG because version check failed.

that's why it is not building the appropriate modules... You have to upgrade your SWIG and run again making sure that all is reported found in cmake. (I suppose you have not installed gnuradion from source, otherwise you would have had this problem with gnuradio as well...)

Tilenk commented 7 years ago

This solved my problem! Thank you!

Solution: $ sudo apt-get install swig