0

I am working with psychopy and using the pyserial module. I have recently moved from using my laptop to a desktop. On the desktop I have successfully been able to implement the following when using a test script in idle:

ser = serial.Serial()

However when I ran some code using the psychopy coder I kept getting an attribute error saying that module serial has no attribute Serial. This code has previously been run successfully on my laptop.

Hello from the pygame community. https://www.pygame.org/contribute.html
0.8191     WARNING     We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
Traceback (most recent call last):
  File "C:\Users\uqakriti_local\Desktop\MSI Face Motor Project\MSI Face Motor Project\MSIthreadcodeinstructions.py", line 35, in <module>
    ser = serial.Serial()
AttributeError: module 'serial' has no attribute 'Serial'

I have attempted to uninstall and reinstall the serial module but I still see the same attribute error. Does anyone have any possible solutions to this?

1 Answers1

0

You can try with below command to import module

from serial import Serial

also go through this post credits

Bhavya Parikh
  • 3,304
  • 2
  • 9
  • 19