在Ubuntu中,使用pip安装python库,可能报错'module' object has no attribute '_main'。

原因是由于 pip10.0 没有main(),我们需要对 pip 进行降级,降为原版本。

// 可查看当前python版本
$ python -V

// 修改“/usr/bin/pip2”文件,把文件中第一行的“#!/usr/bin/python”改为“#!/usr/bin/python2” 即可
$ sudo vim /usr/bin/pip2

// 使用pip2下载
$ pip2 install xxxxx

Ubuntu pip AttributeError: 'module' object has no attribute '_main'相关推荐

  1. Python 报错解决:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    早上升级完pip,后报错如下: -> # pip install --upgrade pwntools /usr/local/lib/python2.7/dist-packages/pip/_v ...

  2. AttributeError: 'module' object has no attribute 'text_format'

    最近在学习 faster rcnn ,本来环境已经配置好,已经跑完自己的程序,运行良好,后来安装了tensorflow,然后重新使用 faster rcnn 进行训练的时候居然出错了,我很纳闷,期间没 ...

  3. AttributeError: 'module' object has no attribute '_base'

    较为完整的错误信息是: class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):   AttributeError: ...

  4. AttributeError: ‘module‘ object has no attribute ‘CALIB_HAND_EYE_PARK‘

    ubuntu18.04 ROS:melodic python2.7的环境 File "/home/bionic/yuxiangROS_handeye/catkin_ws/src/handey ...

  5. tensorflow报错:AttributeError: 'module' object has no attribute 'get_or_create_global_step'

    Tensorflow 1.0训练官方教程中CIFAR10例子 官方教程 执行   python cifar10_train.py时 报错: AttributeError: 'module' objec ...

  6. Tensorflow报错:AttributeError: 'module' object has no attribute 'scalar_summary'

    报错: tf.scalar_summary(l.op.name + ' (raw)', l) AttributeError: 'module' object has no attribute 'sca ...

  7. Python AttributeError: 'module' object has no attribute 'posseg'

    AttributeError: 'module' object has no attribute 'posseg' 遇到问题: 如果 a 是个目录, b 是个 b.py 文件, func 是 b.py ...

  8. pytorch版本问题:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'

    用pytorch加载训练好的模型的时候遇到了如下的问题: AttributeError: 'module' object has no attribute '_rebuild_tensor_v2' 到 ...

  9. tensorflow出现如下错误:AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’

    tensorflow版本问题,导致函数的变化,summary使用如下变化机制: AttributeError: 'module' object has no attribute 'merge_all_ ...

  10. AttributeError: 'module' object has no attribute 'get_frontal_face_detector'

    AttributeError: 'module' object has no attribute 'get_frontal_face_detector' 报错原因: 命名为的文件将遮盖dlib具有所需 ...

最新文章

  1. 这些SpringBoot天生自带Buff工具类你都用过哪些?
  2. 报名 | 2019年社会计算机国际会议
  3. redis的观察者模式----------发布订阅功能
  4. 全球最大AI巨量模型,参数2457亿炼丹16天专注中文,打造者绝对让你意外
  5. 译C#使用设计模式和软件设计原则构建应用程序 PartIII
  6. 用键盘全局钩子[Hook]监视多进程键盘操作
  7. esp32外部中断_玩转 ESP32 + Arduino (四) 电容按键 霍尔传感器 外部中断 延时 脉冲检测...
  8. 2002: [Hnoi2010]Bounce 弹飞绵羊
  9. POJ 2533 Longest Ordered Subsequence
  10. 解决Ubuntu16.04 fatal error: json/json.h: No such file or directory
  11. 老司机整理对Nginx性能优化
  12. Openstack api 使用方法
  13. python3 annotations
  14. 《JSjQuery 交互式web前端开发》(四)判断和循环
  15. 万年历c语言程序微博,简易的万年历程序C语言
  16. 紫猫插件-网络共享数据(1-6)
  17. ios 旋转屏幕试图切换_iOS播放器横竖屏切换的实现
  18. cartographer探秘第三章之对比实验
  19. Matlab中imag函数用法
  20. 在线教育项目【老师服务】

热门文章

  1. 如何克服枯燥工作带来的单调感和厌烦感
  2. LVS (Linux虚拟服务器)模型及算法
  3. (第一周)2018091-2 博客作业
  4. springboot输出日志到文件配置
  5. 利用GDAL进行工具开源化改造
  6. 关于 javadoc
  7. 继承中的盲点,成员或者析构函数,成员函数中为什么有时候需要定义,有时候不需要呢,(已解决)...
  8. 孙鑫VC学习笔记:第九讲 界面修改,工具栏,状态栏,启动画面的制作
  9. 拓端tecdat|R语言逻辑回归(Logistic Regression)、回归决策树、随机森林信用卡违约分析信贷数据集
  10. 拓端tecdat|R语言对HullWhite短期利率模型仿真