Python Forum
install pyserial - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: install pyserial (/thread-19750.html)



install pyserial - neeheng - Jul-13-2019

hi all,

I able to install Pyserial in CMD but still unable to use it. i not sure where i'm go wrong . hope someone can help and share with me.

import time
import serial
 
ser = serial.Serial('COM6', 115200)
  
while True:
 value = ser.readline()
 print(value)
 time.sleep(0.5)
Error:
ModuleNotFoundError Traceback (most recent call last) <ipython-input-3-c45aee60da5c> in <module>() 1 import time ----> 2 import serial 3 4 ser = serial.Serial('COM6', 115200) 5 ModuleNotFoundError: No module named 'serial'



RE: install pyserial - micseydel - Jul-13-2019

How did you install it? What OS are you using? Do you have multiple versions of Python installed?

My first guess is that the answer to the last question is yes, and that you installed it for a different version than the one you're trying to use it from.


RE: install pyserial - neeheng - Jul-14-2019

(Jul-13-2019, 05:18 PM)micseydel Wrote: How did you install it? What OS are you using? Do you have multiple versions of Python installed?

My first guess is that the answer to the last question is yes, and that you installed it for a different version than the one you're trying to use it from.

Hi micseydel,
i using window 10 and my python version is Python 3.6.5. no multiple version python installed.


RE: install pyserial - snippsat - Jul-14-2019

In cmd:
C:\>python -V
Python 3.7.3

C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe

C:\>pip -V
pip 19.1.1 from c:\python37\lib\site-packages\pip (python 3.7)
See that pip -V is pointing to python 3.7.
This men that doing pip install pyserial will only install to python 3.7.
C:\>pip install pyserial
Collecting pyserial
  Downloading https://files.pythonhosted.org/packages........
Installing collected packages: pyserial
Successfully installed pyserial-3.4

# Test that it work
C:\>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>>
>>> serial.__version__
'3.4'
>>> exit()

C:\>