2

当我尝试运行 samples/robotbenchmark/squar_path 示例时,我首先收到消息:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of Webots will drop support for Python 2.7.
[square_path_supervisor] DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of Webots will drop support for Python 2.7.

而 Python 3.7 版本

python --version
Python 3.7.4

可通过我的 Macports 环境使用

port version
Version: 2.5.4

所以我认为 Webots 不使用我的 macports 配置文件中的设置 - 我怎么能做到这一点?我尝试将python路径设置为

/opt/local/bin/python

在首选项/一般情况下,但后来我收到了投诉:

ImportError: dlopen(/Applications/Webots.app/lib/python37/_controller.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.7/Python

而且我还没有看到指定库路径的选项...

4

2 回答 2

2

您可以轻松地在全局范围内指定 Webots 应该在 Webots 首选项中使用的 python 版本。您可以从“工具/首选项”菜单中打开首选项:

在此处输入图像描述

然后您只需更改“Python 命令”首选项:

https://cyberbotics.com/doc/guide/preferences#general

于 2019-08-22T06:26:06.087 回答
1

库路径无法识别 /Library/Frameworks/Python.framework/Versions/3.7/Python 不存在,但 /opt/local//Library/Frameworks/Python.framework/Versions/3.7/Python 一个存在..

因此,作为 /Library/Frameworks 中的一种解决方法,我做了一个

sudo ln -s /opt/local/Library/Frameworks/Python.framework . 

现在机器人开始...

于 2019-08-21T16:32:02.243 回答