首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在raspberry pi3中运行python时,导入错误没有名为tos的模块

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

Stack Overflow用户
提问于 2017-04-21 18:53:03
回答 3查看 176关注 0票数 0

我已经成功地在覆盆子pi3上安装了tinyos,但有很多问题:1-当制作任何应用程序时,除了像Blink这样的tinyos应用程序之外,我有以下错误:

代码语言:javascript
复制
/root/tinyos-main/support/make/Makerules:56:  Old TinyOS environment variables detected.

在Blink模式下,它成功运行2-当运行python程序时使用"import tos“,比如

代码语言:javascript
复制
import tos
 a=1
 b=2
 c=a+b

我遇到了一个错误,比如Traceback (最近一次调用):

代码语言:javascript
复制
File "ali.py", line 1, in <module>
    import tos
ImportError: No module named tos

我想我在设置路径时遇到了问题

EN

回答 3

Stack Overflow用户

发布于 2017-04-21 18:57:24

您需要下载tinyos

使用tar解压缩包

tar -xzvf package_name

cd进入解压缩目录,然后:

sudo python setup.py安装

票数 0
EN

Stack Overflow用户

发布于 2017-05-15 18:14:48

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

代码语言:javascript
复制
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
票数 0
EN

Stack Overflow用户

发布于 2017-08-30 19:00:36

对旧环境的警告并不严重。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43540843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档