Author Topic: "No module named serial" error when trying to flash firmware w serial connection  (Read 13906 times)

jcverive

  • Newbie
  • *
  • Posts: 9
I've been trying to follow the instructions for flashing the Oak firmware in Windows (http://digistump.com/wiki/oak/tutorials/serialupdate), but the esptool gives me the error

No module named serial

Peeking into esptool.py, I see that an attempt is being made to import serial, but it obviously isn't being found. How do I install the necessary file in Windows? Or is there a different version of esptool that I should be using? Or is there a third option? The WiFi on my Oak isn't working, so I have to re-flash the firmware using a serial connection

defragster

  • Sr. Member
  • ****
  • Posts: 467
I posted this on another thread - I had that problem and I thought I wrote my solution down in the WiKi but didn't find it - I searched the web and found this - let me know if it works from the command line:

Quote
C:\Users\defragster>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pip install pyserial
>>>

<edited> See following post if you don't have "pip" installed.
« Last Edit: April 08, 2016, 11:43:48 am by defragster »

jcverive

  • Newbie
  • *
  • Posts: 9
Nope - no luck:

Quote
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Windows\system32>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named serial
>>>

Any other ideas?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Here it is in an email I sent ERIK - I thought I dropped it in Wiki or github:

Quote
So I have the python 2.7.11 installed for ESP on Arduino – and as we noted before SERIAL is a pain to get.  Well I needed it again and got this link – that made it TRIVIAL:
 
Turns out with this later 2.7.11 python PIP is preinstalled (so I didn’t need to install that) – though it told me to UPDATE PIP { python -m pip install --upgrade pip } after I used it:
 
http://stackoverflow.com/questions/8491111/pyserial-for-python-2-7-2
You could try it with pip. (Here a question/answer about installing it)
Then type in your shell:

pip install pyserial
Solution:
The installation of pip on Windows 7 64 is a little tricky: I added my Python and Python/Scripts path to the PATH env.
Then I opened PythonWin as Administrator, ran ez_setup.py from http://pypi.python.org/pypi/setuptools#downloads with PythonWin. And then I downloaded pip unpacked it and as Administrator I ran python setup.py install on the windows shell and after that pip install pyserial.

PeterF

  • Hero Member
  • *****
  • Posts: 881
@jcverie

Two that can trip you up in particular 1) you need to make sure that your python install path is in the system path, otherwise you can't access python - but this doesn't seem to be an issue in your case, as you were able to access it without changing to the python install directory.  2) You need to install PySerial - as is documented on the wiki page. Since you're running Windows 10, you can use the windows installer linked on that page. Make sure you right click on the installer and choose 'Run as Administrator', as you will get error messages from the installer otherwise. That should be all you need to do get it working. That was all I needed on a Windows 10 system without any prior python / ESP related install.

Pete

defragster

  • Sr. Member
  • ****
  • Posts: 467
pfeerick - my 2.7 python was properly installed - the "pip install pyserial" worked easy from the command line python shell.  I'd recommend that over manual download efforts - those failed for me.