在raspberry pi3中运行python时,导入错误没有名为tos的模块

2024-09-29 19:27:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我成功地将tinyos安装到raspberry pi3上,但遇到了许多问题: 1-当制作除Blink等tinyos应用程序以外的任何应用程序时,我有以下错误:

/root/tinyos-main/support/make/Makerules:56:  Old TinyOS environment variables detected.

在眨眼时它运行成功 2-当运行一个python程序时

^{pr2}$

我犯了个错误 回溯(最近一次呼叫):

File "ali.py", line 1, in <module>
    import tos
ImportError: No module named tos

我想我对道路的设置有问题


Tags: 应用程序supportmakemain错误rootraspberryold
3条回答

旧环境警告并不重要。在

对于您的问题,请将python SDK路径添加到~/.bashrc,然后尝试从tinyos import tos而不是import tos。在

您需要下载包tinyos

使用tar提取包

tar-xzvf包名

cd到解压目录,然后:

水蟒设置.py安装

你能确认一下,你收到警告还是错误?我查看了TinyOS makerules,它说你引用的消息只是关于不推荐变量的警告,可以通过设置TinyOS_NO_deprecision_warning环境变量来删除它。摘自下面的makerules

ifndef TINYOS_NO_DEPRECATION_WARNING
define MAKE_VERSION_TWO_WARNING
$(WARN_STRING) Old TinyOS environment variables detected.

    This version of the TinyOS make system has deprecated the TOSDIR, TOSROOT,
    and MAKERULES environment variables. Generally, you shouldnt need
    environment variables with this version of the TinyOS make system, and if
    you are not using any older versions of TinyOS on your system you should
    delete these environment variables. If you wish to leave these variables
    but hide this warning, set the TINYOS_NO_DEPRECATION_WARNING environment
    variable. If you are looking to compile against a different TinyOS tree,
    configure the makefiles used when compiling, or setup an external TinyOS
    tree with additional source files, please visit
    https://github.com/tinyos/tinyos-main/blob/master/support/make/README.md
    for more information about the TinyOS make system.

endef

相关问题 更多 >

    热门问题