In addition to the answer from Sumit Jha, I had to do the following for Linux. On both Windows and Linux, I had to remove with pip remove pyserial and reinstall with pip3 install pyserial.
Step by step guide to install Python 3.6 and pip3 in Ubuntu
Download Python-3.6.1.tar.xz (or current version) from https://www.python.org/
Unzip the file and keep the folder in the home directory.
Open a terminal in that directory and perform the following commands:
- ./configure
- make
- make test
- sudo make install
This will install Python 3.6 but pip3 may not be working.Install necessary modules using:
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Now write the following to re-run the installation:
- sudo make
- sudo make install
Now you can install packages with Python 3.6 using pip3 command. For example:
sudo pip3 install numpy