gpt4 book ai didi

python - 如何使用 Python 3.5 在 Windows 10 系统上安装 mbed CLI?

转载 作者:行者123 更新时间:2023-11-30 22:47:41 24 4
gpt4 key购买 nike

我想在我的 PC 上安装 ARM mbed CLI。我按照官方网站上的教程进行操作:
https://docs.mbed.com/docs/mbed-os-handbook/en/5.1/dev_tools/cli/
先决条件之一是系统上安装了 Python。教程提到:

Python - mbed CLI is a Python script, so you’ll need Python in order to use it. mbed CLI was tested with version 2.7.9 of Python. You can download that or a newer version here.

我确实安装了Python,但没有安装2.7版本。我有 Python 3.5.2::Anaconda 4.2.0(64 位)
下一个先决条件是安装 GitMercurial。教程提到:

Git and Mercurial - mbed CLI supports both Git and Mercurial repositories, so you’ll need to install both. Note: The directories of Git and Mercurial executables (git and hg) need to be in your system’s PATH.

我安装了两个:

> git --version
git version 2.10.2.windows.1

> hg --version
Mercurial Distributed SCM (version 4.0)

我像这样安装 mbed CLI:

> pip install mbed-cli
Collecting mbed-cli
Installing collected packages: mbed-cli
Successfully installed mbed-cli-0.9.10

但事实证明安装不好。 Windows 命令行无法识别 mbed 命令:

> mbed --help
Traceback (most recent call last):
File "c:\anaconda3\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "c:\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\Scripts\mbed.exe\__main__.py", line 5, in <module>
File "c:\anaconda3\lib\site-packages\mbed\mbed.py", line 989
sorted_scms = sorted(sorted_scms, key=lambda (m, _): not m)
^
SyntaxError: invalid syntax

我怀疑 Python 3.5 版本是罪魁祸首(也许它可以与 Python 2.7 一起使用,我不知道)。有没有办法让它与Python 3.5一起工作? PS:我不喜欢将 Python 2.7 与现有的 Python 3.5 并行安装。太麻烦了。

最佳答案

mbed CLI 需要 python 2.7.* 。尚不支持 Python 3.*。

关于python - 如何使用 Python 3.5 在 Windows 10 系统上安装 mbed CLI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40452296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com