I have a Windows 10 with Python 3.7.4 and I use Jupyter Notebook. I'm trying to use pySerial to connect to my Arduino by Serial attribute. I tried installing pySerial simply by pip install pyserial and eventually I tried conda install -c conda-forge pyserial too, but when I try to run my code:
import serial
ser = serial.Serial('COM4', 9600)
I get an error message like:
AttributeError Traceback (most recent call last)
<ipython-input-7-413d0d9dabe7> in <module>
2 import serial
3 import time
----> 4 ser = serial.Serial('COM4', 9600)
5
6 # Your Account Sid and Auth Token from twilio.com/console
AttributeError: module 'serial' has no attribute 'Serial'
Also, I tried
import serial
serial.__file__
And I got 'C:\Users\lippe\Anaconda3\lib\site-packages\serial\__init__.py' as output.
I also tried dir(serial) and I can't see the Serial attribute in the output, so I think it's basically not installed and I don't know why. I tried digging the internet but I still can't find a solution.