如何在带有 Python 3.5 的 Windows 10 系统上安装 mbed CLI?
How to install mbed CLI on a Windows 10 system with Python 3.5?
我想在我的电脑上安装 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-bit)
而不是。
下一个先决条件是安装 Git 和 Mercurial。教程提到:
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.* 尚不支持。
我想在我的电脑上安装 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-bit)
而不是。
下一个先决条件是安装 Git 和 Mercurial。教程提到:
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.* 尚不支持。