继续上一篇:
https://blog.csdn.net/woshigaowei5146/article/details/128443892?spm=1001.2014.3001.5502
环境
虚拟机:VMware
Ubuntun:20.04LTS
Tango:9.3.5
安装
PyTango作为官方debian/ubuntu包在linux上可用:
for Python 3.X:以下最好统一用python3,否则容易混乱。
sudo apt-get install python3-tango
安装boost-python:
https://www.boost.org/
python3版本的boost.python安装
https://blog.csdn.net/weixin_41923935/article/details/106967144
using python : 3.8 : "/usr/bin/python3.8 : /usr/include/python3.8 : /usr/lib/python3.8" ;
检查boost版本:
dpkg -S /usr/include/boost/version.hpp
安装Numpy:
sudo apt-get install python3-numpy
从pip安装PyTango:
pip install PyTango
安装setuptools:
sudo apt-get install python-setuptools
编译
自PyTango 9以来,用于编译PyTango的构建系统是标准的python setuptools。
可以从PyPI或直接最新的SVN签出中获得最新的.tar.gz:如果网速过慢,可从电脑下载复制过去。
git clone https://gitlab.com/tango-controls/pytango.git
cd pytango
python setup.py build
sudo python setup.py install
把/usr/local/tango/include/tango文件夹复制到/home/gw2/pytango/ext
如果报错:找不到命令“python”,如果安装了python2和python3,可切换python版本:
https://blog.csdn.net/weixin_44774722/article/details/126311208
如果只安装了python3,可以把它重命名:
https://blog.csdn.net/qq_40608730/article/details/109550691
如果报错:Package tango was not found in the pkg-config search path,在bashrc添加:
export PKG_CONFIG_PATH=/usr/local/tango/lib/pkgconfig
如果报错:error in pytango setup command: ‘install_requires’ must be a string or list of strings containing valid project/version requirement specifiers;
升级setuptools,无效。
执行python setup.py build。报错:
编译还是比较混乱的,后面再整理一下。
若失败,直接运行:即可
python3 -m pip install pytango
验证:
import tango
print(tango.utils.info())
print(tango.Release.version)
参考
https://pytango.readthedocs.io/en/v9.3.5/start.html
https://gitlab.com/tango-controls/pytango