ZYNQ 导入hdf文件报错
petalinux-config --get-hw-description=…/
INFO: Getting hardware description…
INFO: Rename nv1951_top.hdf to system.hdf
[INFO] generating Kconfig for project
[INFO] menuconfig project
*** End of the configuration.
*** Execute ‘make’ to start the build or try ‘make help’.
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to config project.
ERROR: Get hw description Failed!.
查看build/config.log文件:
[INFO] sourcing bitbake
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
OpenEmbedded requires ‘python’ to be python v2 (>= 2.7.3), not python v3.
Please set up python v2 as your default ‘python’ interpreter.
ERROR: Failed to source bitbake
错误信息提示python版本不对,需要使用python2
-
查看系统安装python版本
ls /usr/bin/python*
-
查看python替换版本信息
update-alternatives --list python
如果出现 update-alternatives:error:no alternatives for python
则表示Python 的替换版本尚未被update-alternatives 命令识别。想解决这个问题,我们需要更新一下替换版本,将Python2.7和python3.5放入其中。执行以下命令:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 3 -
切换python版本
update-alternatives --config python
输入“1”,就切换到2.7版本了,相反如果之前默认版本为2.7的输入“2”则切换到3.6版本了,输入0切换到3.5版本。
-
查看默认python版本
python --version
重新执行导入hdf命令,正常执行。