在raspberry pi3中运行python时,导入错误没有名为tos的模块
我已成功在raspberry pi3上安装tinyos,但遇到了许多问题: 1-当制作tinyos应用程序以外的任何应用程序(如Blink)时,我出现以下错误:在raspberry pi3中运行python时,导入错误没有名为tos的模块,python,ubuntu,module,raspberry-pi3,tinyos,Python,Ubuntu,Module,Raspberry Pi3,Tinyos,我已成功在raspberry pi3上安装tinyos,但遇到了许多问题: 1-当制作tinyos应用程序以外的任何应用程序(如Blink)时,我出现以下错误: /root/tinyos-main/support/make/Makerules:56: Old TinyOS environment variables detected. 在闪烁状态下,它成功运行 2-当运行带有“导入tos”的python程序时,如 我犯了一个像这样的错误 回溯(最近一次呼叫最后一次): 文件“ali.py”,
/root/tinyos-main/support/make/Makerules:56: Old TinyOS environment variables detected.
在闪烁状态下,它成功运行
2-当运行带有“导入tos”的python程序时,如
我犯了一个像这样的错误
回溯(最近一次呼叫最后一次):
文件“ali.py”,第1行,在
导入tos
ImportError:没有名为tos的模块
我想我在设置路径时遇到了问题您需要下载该软件包 使用
tar
tar-xzvf包名称
将cd放入提取的目录中,然后:
sudo python setup.py安装OP您能否确认,您收到的是警告还是错误?我查看了TinyOS makerules,它说您引用的消息只是关于不推荐使用的变量的警告,可以通过设置TinyOS\u NO\u DEPRECATION\u warning环境变量来删除。摘自下面的文章
对旧环境的警告并不重要
对于您的问题,请将python SDK路径添加到~/.bashrc,然后尝试从tinyos导入到而不是从导入到谢谢,我这样做了,但仍然是相同的问题。以下路径是否正确:export-TOSROOT=“~/tinyos-main”export-TOSDIR=“$TOSROOT/tos”export-CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:。export-MAKERULES=“$toroot/support/make/MAKERULES”export-PYTHONPATH=$PYTHONPATH:$toroot/support/sdk/python
import tos
a=1
b=2
c=a+b
File "ali.py", line 1, in <module>
import tos
ImportError: No module named tos
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