【问题标题】:How to install pip for installing external packages in NAO robot如何在 NAO 机器人中安装 pip 以安装外部包
【发布时间】:2019-07-11 07:00:03
【问题描述】:

我已经编写了一些代码并想在 NAO 机器人上运行它,但不幸的是,我在代码中使用了一些包,如 pygame 和 boto3,所以现在要在 NAO 上运行此代码,我必须在 NAO 机器人上安装这些包,有人可以解释一下这个过程吗?

我尝试使用 ssh nao@ip 在 NAO 上运行 get-pip.py 文件,但无法安装 我一直在尝试将包文件复制到 NAO,但它也没有解决问题。 我关注了https://community.ald.softbankrobotics.com/ja/node/1506论坛,也没有解决

下面是我运行 get-pip.py 文件时的控制台输出

PS C:\Users\hp> ssh nao@169.254.252.60 Password: nao [0] ~ $ su Password: root@nao [0] nao # ls Ashim DigiCertHighAssuranceEVRootCA.pem classes.bin diagnosis naoqi recordings DigiCertHighAssuranceEVRootCA.crt angles.bin couples.bin expo.bin rayons.bin remotes root@nao [0] nao # cd Ashim root@nao [0] Ashim # ls boto3 client_secret.json example.py jmespath pip python-engineio six botocore custom-env get-pip.py mpolly.py pygame python-socketio urllib3 root@nao [0] Ashim # python get-pip.py 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 pip will drop support for Python 2.7. Collecting pip /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping ERROR: Could not find a version that satisfies the requirement pip (from versions: none) ERROR: No matching distribution found for pip root@nao [err 1] Ashim #

另外,我尝试更新系统时间,但这也没有解决问题。输出和以前一样:

root@nao [err 127] nao # ntpdate                                                                                        
17 Sep 02:55:02 ntpdate[8986]: no servers can be used, exiting
root@nao [err 1] nao # ntpdate -s 0.de.pool.ntp.org
root@nao [0] nao # ntpdate
11 Jul 10:51:42 ntpdate[9024]: no servers can be used, exiting
root@nao [err 1] nao # cd Ashim

我还尝试使用sudo python setup.py install 安装没有 pip 的软件包 但在这种情况下,它会显示以下错误:

error: could not create '/usr/lib/python2.7/site-packages/awscli-1.16.196-py2.7.egg': No space left on device

【问题讨论】:

  • 不是已经在 nao 上安装了 pip 吗?我想它可能与胡椒类似:查看:stackoverflow.com/questions/48387823/install-things-on-pepper
  • 如果你运行 get-pip.py 会发生什么?
  • 它没有安装 pip 而是显示像这样的错误ERROR: Could not find a version that satisfies the requirement pip (from versions: none) ERROR: No matching distribution found for pip
  • @TVK 我不认为 N​​AO 机器人有 Naoqi 2.5
  • 请将整个控制台输出添加到您的问题中。您是否支持代理?

标签: python-2.7 pip pygame boto3 nao-robot


【解决方案1】:

你有一个:

SystemTimeWarning:系统时间已过时(2017-06-30 之前)。这 可能会导致 SSL 验证错误

修复您的系统时间,否则 ssl 验证将失败。

它可能与胡椒类似,按照说明here

你也得到了

SNIMissingWarning:已发出 HTTPS 请求,但 SNI(服务器 Name Indication) 对 TLS 的扩展在此平台上不可用。 这可能会导致服务器提供不正确的 TLS 证书, 这可能导致验证失败。您可以升级到更新的 版本的 Python 来解决这个问题。有关详细信息,请参阅 https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

要修复它,您需要安装 requests[security]

您也可以按照here 的描述安装没有 pip 的软件包

【讨论】:

  • 我已经使用 NTP 更改了我的 NAO 机器人的时间,但仍然得到相同的响应。 root@nao [err 127] nao # ntpdate 17 Sep 02:55:02 ntpdate[8986]: no servers can be used, exiting root@nao [err 1] nao # ntpdate -s 0.de.pool.ntp.org root@nao [0] nao # ntpdate 11 Jul 10:51:42 ntpdate[9024]: no servers can be used, exiting
  • 请习惯于使用您尝试过的内容和输出来更新您的问题。仍然收到 SystemTimeWarning?
  • 我试过安装没有 pip 的包,但它显示:设备上没有剩余空间
猜你喜欢
  • 1970-01-01
  • 2014-04-19
  • 1970-01-01
  • 1970-01-01
  • 2022-01-20
  • 2020-08-23
  • 1970-01-01
  • 1970-01-01
  • 2021-01-15
相关资源
最近更新 更多