Skip to content

macOS issue -- ImportError: No module named 'serial' #20

@sinewalker

Description

@sinewalker

The install instructions which are in readthedocs (and also on CodeBug's Activities) are missing a crucial library that doesn't come installed in vanilla python (at least not on the Mac)

pyserial

Here's what happens on a brand new python virtualenv:

(hax) mjl@milo:codebug$ python
Python 3.5.2 (default, Jul 28 2016, 21:28:00)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import codebug_tether
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mjl/lib/hax/lib/python3.5/site-packages/codebug_tether/__init__.py", line 1, in <module>
    from codebug_tether.core import (CodeBug,
  File "/Users/mjl/lib/hax/lib/python3.5/site-packages/codebug_tether/core.py", line 3, in <module>
    import serial
ImportError: No module named 'serial'
>>>

If the instructions are updated to add pyserial as well as codebug_tether (or set it as a dependency for the package) then it will solve for other kids playing along:

pip install codebug_tether pyserial

Then it works.

Let's try:

(hax) mjl@milo:codebug$ pip install pyserial
Collecting pyserial
  Downloading pyserial-3.2.1-py2.py3-none-any.whl (189kB)
    100% |████████████████████████████████| 194kB 967kB/s
Installing collected packages: pyserial
Successfully installed pyserial-3.2.1

Now import the module:

(hax) mjl@milo:codebug$ python
Python 3.5.2 (default, Jul 28 2016, 21:28:00)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import codebug_tether
>>>

Happy Hacking!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions