jpbarraca / pynrf24

Python port of the RF24 library for NRF24L01+ radios.
GNU General Public License v2.0
152 stars 84 forks source link

Import Error: Cannot import name NRF24 #31

Closed bwy-dev closed 7 years ago

bwy-dev commented 7 years ago

hello, I have installed this library using sudo pip install -e git+https://github.com/jpbarraca/pynrf24.git#egg=nrf24

but when I run a simple bit of code (as per the example code here on git) to receive signal from my Arduino I get:

Traceback (most recent call last):
  File "./rpinrf24.py", line 4, in <module>
    from nrf24 import NRF24
  File "/home/pi/nrf24.py", line 4, in <module>
    from nrf24 import NRF24
ImportError: cannot import name NRF24

so I assume it hasn't installed correctly, but I can't for the life of me see what I can do to get it to work. I have a shebang directing it to python2 not python3 so that isn't the problem either. I am using a Raspberry Pi 3 Model B.

bwy-dev commented 7 years ago

Ok so somehow nrf24.py and nrf24.pyc managed to be both in /home/pi AND in /usr/local/lib/python2.7/dist-packages/ and the ones in /home/pi were causing conflict. they have been removed and it works fine now.