targetcli是一个iSCSI配置管理工具,该工具简单易用,可以直接替换scsi-target-utils。满心欢喜的装上它,正准备一睹为快,就杯具了。报错ImportError: cannot import name ALUATargetPortGroup。下面就这针对这个错误的解决方案。

一、故障现象

当前环境
[root@centos7-router ~]# more /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)安装targetcli工具包
# yum install targetcli故障现象
[root@centos7-router ~]# targetcli
Traceback (most recent call last):File "/usr/bin/targetcli", line 24, in <module>from targetcli import UIRoot   ### Author : LeshamiFile "/usr/lib/python2.7/site-packages/targetcli/__init__.py", line 18, in <module>from .ui_root import UIRoot   ### Blog : http://blog.csdn.net/leshamiFile "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 30, in <module>from .ui_backstore import complete_path, UIBackstoresFile "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 29, in <module>from rtslib_fb import ALUATargetPortGroup
ImportError: cannot import name ALUATargetPortGroup

二、解决方案

从上面的错误提示可知,python文件有问题。于是验证一下python是否已正确安装
[root@centos7-router ~]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> python可以正常工作,继续google,原来是缺少python-rtslib这个包。[root@centos7-router ~]# yum install python-rtslib -y再次执行成功
[root@centos7-router ~]# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'./> helpGENERALITIES
============
This is a shell in which you can create, delete and configure
configuration objects.The available commands depend on the current path or target
path you want to run a command in: different path have
different sets of available commands, i.e. a path pointing at
an iscsi target will not have the same availaible commands as,
say, a path pointing at a storage object.The prompt that starts each command line indicates your
current path. Alternatively (useful if the prompt displays
an abbreviated path to save space), you can run the
pwd command to display the complete current path.Navigating the tree is done using the cd command. Without
any argument, cd will present you wil the full objects
tree. Just use arrows to select the destination path, and
enter will get you there. Please try help cd for navigation
tips.COMMAND SYNTAX
==============
Commands are built using the following syntax:[TARGET_PATH] COMMAND_NAME [OPTIONS]The TARGET_PATH indicates the path to run the command from.
If ommited, the command will be run from your current path.The OPTIONS depend on the command. Please use help
COMMAND to get more information.AVAILABLE COMMANDS
==================
The following commands are available in the
current path:- bookmarks action [bookmark] - cd [path] - clearconfig [confirm] - exit - get [group] [parameter...] - help [topic] - ls [path] [depth] - pwd - refresh - restoreconfig [savefile] [clear_existing] - saveconfig [savefile] - sessions [action] [sid] - set [group] [parameter=value...] - status - version 

启动targetcli时遭遇ImportError: cannot import name ALUATargetPortGroup故障相关推荐

  1. 关于运行Python时出现ImportError: cannot import name 'InteractiveConsole'的解决方案,看似简单,实则致命!!

    目录 一.出现的问题 二.解决方法 三.注意事项 一.出现的问题 1.博主在运行Python代码时,发现报错,错误如下: ImportError: cannot import name 'Intera ...

  2. 执行编译的.EXE时提示ImportError: cannot import name ‘server‘ from ‘server‘ 解决方案

    包名和模块名如果同名的话,在编译后执行时混淆,找不到路径.需要更改,确保不同名,这样才能正确执行

  3. ImportError: cannot import name ‘image‘ from ‘PIL‘ (C:\ProgramData\Anaconda3\lib\site-packages\PIL\_

    错误提示 使用 Python 编译 PIL 包时提示 ImportError: cannot import name 'image' from 'PIL' (C:\ProgramData\Anacon ...

  4. 运行pyspider时出现 : ImportError: cannot import name ‘ContextVar‘

    运行pyspider常见的错误: ①ValueError: Invalid configuration: - Deprecated option 'domaincontroller': use 'ht ...

  5. import cv2时出现ImportError: DLL load fail:找不到指定模块

    一.问题描述: 运行代码提示"import cv2时出现ImportError: DLL load fail:找不到指定模块". 原因分析:找不到某个注册表. 二.解决方法: 1. ...

  6. ImportError: cannot import name ‘_gi‘ from partially initialized module ‘gi‘ ubuntu 终端无法启动

    Ubuntu系统安装多个Python版本后,如Python2.7.Python3.6.Python3.8,打开某些应用如gnome-terminal出现如下报错: Traceback (most re ...

  7. Python-PyCharm 报错解决:ImportError: cannot import name 'InteractiveConsole' from 'code'

    此文首发于我的个人博客:Python-PyCharm 报错解决:ImportError: cannot import name 'InteractiveConsole' from 'code' - z ...

  8. yolov5的3.0版本代码在训练的时候报错:ImportError: cannot import name ‘amp‘ from ‘torch.cuda‘ 以及yolov5的3.0环境安装

    欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 yolov5的3.0版本代码在训练的时候报错:ImportError: cannot import name 'amp' ...

  9. 在导入graphsurgeon时报错:ImportError: cannot import name ‘NodeDef‘ from ‘tensorflow‘

    欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 在导入graphsurgeon时报错:ImportError: cannot import name 'NodeDef' ...

最新文章

  1. CVPR 2021| 端到端场景无关视觉定位算法(SuperGlue一作出品)
  2. 从零开始入门 K8s | 可观测性:监控与日志
  3. 两个月学习Python的胡言乱语
  4. Win7——Win10系统如何安装Win7系统
  5. win7文件夹加密软件_神盾文件夹加密软件免费下载_电脑文件夹加密软件下载【文件管理】...
  6. java中常用的类——Math类
  7. 命令行 蓝牙_蓝牙键盘接入UOS系统的方法
  8. Leetcode Top100题目和答案(Java完整版 面试必备)
  9. excel如何随机抽样
  10. 【单片机】4.2 AT89S52中断系统结构
  11. 一般系统论的基本概念
  12. day15-医生的处方、道士的鬼符、程序员的正则表达式
  13. c语言中的加减乘除字母,C语言加减乘除运算
  14. php cnzz api demo,PHP curl抓取cnzz统计数据
  15. 服务器CPU和普通CPU的区别
  16. 在固定宽高内显示固定数量的最大正方形
  17. 如何旋转PDF的页面方向?教你2种方法
  18. vue 用key拿对象value_基于vue--key值的特殊用处详解
  19. 教学向|游戏低模角色建模教程,全是漂亮妹妹,GKD!
  20. 如何用本地连接共享无线网络连接

热门文章

  1. 《Oracle系列》:oracle job详解
  2. 云路由 vyatta 体验(六)防火墙
  3. Grails 1.2参考文档速读(15):验证
  4. sql安装错误解决办法
  5. EMC助力广东福彩中心容灾系统建设
  6. 快速提升UI设计感的7个版式小妙招
  7. Angularjs 中select回显后重复选项的解决
  8. 「珍藏」老司机为你推荐10个炫酷的开源库,看完的人都收藏了
  9. 《云安全原理与实践》——2.2 云计算面临的管理风险
  10. Android 快速选择联系人