Sublime Forum

importError: serial

#1

I am building my own plugin, please I need help: how to import “serial” to python into sublime, or how to change the path in python of sublime that reload plugin of user.

reloading plugin User.miPlugin
Traceback (most recent call last):
File “C:\Program Files\Sublime Text 3\sublime_plugin.py”, line 107, in reload_plugin
m = imp.reload(m)
File “./python3.3/imp.py”, line 276, in reload
File “”, line 584, in _check_name_wrapper
File “”, line 1022, in load_module
File “”, line 1003, in load_module
File “”, line 560, in module_for_loader_wrapper
File “”, line 868, in _load_module
File “”, line 313, in _call_with_frames_removed
File “C:\Users\dzapata\AppData\Roaming\Sublime Text 3\Packages\User\miPlugin.py”, line 6, in
import serial
ImportError: No module named ‘serial’

0 Likes

#2

The plugin_host has it’s own Python 3.3 environment. Unfortunately there are no tools like pip or easy_install available for it. If you want to install a third-party module like pyserial you’ll have to manually copy the source files into your package and do a relative import.

0 Likes

#3

Thanks, I will try do it, I hope this solve my problem.

0 Likes