Python Forum
pyserial/serial "has no attribute 'Serial' "
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyserial/serial "has no attribute 'Serial' "
#11
(Aug-24-2023, 07:56 AM)gowb0w Wrote:
(Aug-24-2023, 07:18 AM)DeaD_EyE Wrote: Maybe there was a file named serial.py next to your script. In this case, Python imports this instead from site-packages.

ah yes, i thought of it. but i checked and it was not the case.
Reply
#12
Hi All,

I'm new to forums so bear with me please.

I may have a solution to this. I am using PyCharm as my IDE on a Windows10 PC.

Initially I accidently installed "serial" rather than pyserial for a new project.

I then tried installing pyserial and uninstalling (deleting) serial. This still gave me the error even after rebooting my PC.

However, I then uninstalled (deleted) pyserial, ran the code which now correctly identified that there was no serial library. I then re-installed pyserial and it now works.

I guess the environment was still finding or remembering remnants of the original serial library. By removing pyserial and forcing the IDE to recognise that there was no serial library before re-installing pyserial cleared that issue.

I hope this helps someone as it has caught me out several times now and I haven’t found anyone on forums that has this solution.

Take care and press on... N.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing to two different serial ports independent of each other Aggie64 6 1,386 Dec-11-2024, 10:51 PM
Last Post: deanhystad
  sending strings to arduino over serial/accessing DLLs HeWhoHas 0 733 Nov-09-2024, 06:01 PM
Last Post: HeWhoHas
  PC why serial code = converting to ascii ? trix 11 2,200 Oct-12-2024, 11:10 PM
Last Post: deanhystad
  PyQt5 - issue of delay in overall performance & user interface while using serial COM thiru 0 739 Jun-18-2024, 08:34 AM
Last Post: thiru
  Waiting for input from serial port, then move on KenHorse 3 4,036 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 1,605 Mar-19-2024, 09:02 AM
Last Post: zazas321
  importing serial Fklein23 2 3,643 Jul-05-2023, 01:32 PM
Last Post: deanhystad
  Serial Port As Global Prasanjith 2 2,875 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  Python Serial: How to read the complete line to insert to MySQL? sylar 1 1,536 Mar-21-2023, 10:06 PM
Last Post: deanhystad
Star Pyserial not reading serial.readline fast enough while using AccelStepper on Arduino MartyTinker 4 8,310 Mar-13-2023, 04:02 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020