Civlo85 / gsmHat

Using the Waveshare GSM/GPRS/GNSS Hat for Raspberry Pi with Python
MIT License
61 stars 26 forks source link

ImportError: cannot import name 'Serial' from 'serial' #7

Open ramteid opened 3 years ago

ramteid commented 3 years ago

I am trying to get this to work on my Raspberry Pi Zero W (Raspberry Pi OS Lite, 5.10.17+). To resolve this error, I had to do:

sudo pip3 uninstall serial
sudo pip3 install --upgrade --force-reinstall pyserial
Deon-Louw commented 2 years ago

This worked best for me: Get pyserial from here: https://github.com/pyserial/pyserial/tree/master/serial and replace it with the content in: /home/pi/.local/lib/python3.7/site-packages/serial Remember to back up 1st

adrianlzt commented 2 years ago

Just install https://pypi.org/project/pyserial/ instead of "serial". There is an error in the setup.py file @Civlo85

Lib RPi.GPIO is also needed

Deon-Louw commented 2 years ago

Just install https://pypi.org/project/pyserial/ instead of "serial". There is an error in the setup.py file @Civlo85

Lib RPi.GPIO is also needed

Hi Adrian. Thanks for the response. I'm not 100% sure about what you are saying. Should I install the https://pypi.org/project/pyserial file in the place f what? I for one did install the https://pypi.org/project/pyserial as a prerequisite of dependencies and it did not work. At the end the only remedy was to copy it over manually. I'm sure that might work for some.