一 安装readline包之后python3.6导入模块异常退出

Type "help", "copyright", "credits" or "license" for more information.
>>> import time
*** Error in `python3.6': munmap_chunk(): invalid pointer: 0x00007f4fddde30b0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7ada4)[0x7f4fdcfb6da4]
python3.6(PyOS_Readline+0xec)[0x5cc11c]
python3.6[0x4471d0]
python3.6[0x448b18]
python3.6(PyTokenizer_Get+0x9)[0x449959]
python3.6[0x44575d]
python3.6(PyParser_ASTFromFileObject+0x89)[0x427979]
python3.6[0x427b8b]
python3.6(PyRun_InteractiveLoopFlags+0x76)[0x427eb6]
python3.6(PyRun_AnyFileExFlags+0x3c)[0x42803c]
python3.6(Py_Main+0xc44)[0x43b894]
python3.6(main+0x162)[0x41d922]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f4fdcf5db35]
python3.6[0x41d9e0]
======= Memory map: ========
00400000-00670000 r-xp 00000000 fd:00 54564860 /usr/local/python3.6/bin/python3.6
0086f000-00870000 r--p 0026f000 fd:00 54564860 /usr/local/python3.6/bin/python3.6870000-008d4000 rw-p 00270000 fd:00 54564860 /usr/local/python3.6/bin/python3.6
008d4000-00905000 rw-p 00000000 00:00 0
027e9000-028a9000 rw-p 00000000 00:00 0 [heap]
7f4fd6166000-7f4fd617b000 r-xp 00000000 fd:00 472101 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f4fd617b000-7f4fd637a000 ---p 00015000 fd:00 472101 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f4fd637a000-7f4fd637b000 r--p 00014000 fd:00 472101 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f4fd637b000-7f4fd637c000 rw-p 00015000 fd:00 472101 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f4fd637c000-7f4fd63a1000 r-xp 00000000 fd:00 58903 /usr/lib64/libtinfo.so.5.9
7f4fd63a1000-7f4fd65a1000 ---p 00025000 fd:00 58903 /usr/lib64/libtinfo.so.5.9
7f4fd65a1000-7f4fd65a5000 r--p 00025000 fd:00 58903 /usr/lib64/libtinfo.so.5.9
7f4fd65a5000-7f4fd65a6000 rw-p 00029000 fd:00 58903 /usr/lib64/libtinfo.so.5.9
7f4fd65a6000-7f4fd65cc000 r-xp 00000000 fd:00 54964 /usr/lib64/libncurses.so.5.9
7f4fd65cc000-7f4fd67cb000 ---p 00026000 fd:00 54964 /usr/lib64/libncurses.so.5.9
7f4fd67cb000-7f4fd67cc000 r--p 00025000 fd:00 54964 /usr/lib64/libncurses.so.5.9
7f4fd67cc000-7f4fd67cd000 rw-p 00026000 fd:00 54964 /usr/lib64/libncurses.so.5.9
7f4fd67cd000-7f4fd6808000 r-xp 00000000 fd:00 35350018 /usr/local/python3.6/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7f4fd6808000-7f4fd6a08000 ---p 0003b000 fd:00 35350018 /usr/local/python3.6/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7f4fd6a08000-7f4fd6a0a000 r--p 0003b000 fd:00 35350018 /usr/local/python3.6/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7f4fd6a0a000-7f4fd6a11000 rw-p 0003d000 fd:00 35350018 /usr/local/python3.6/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7f4fd6a11000-7f4fd6a13000 rw-p 00000000 00:00 0
7f4fd6a13000-7f4fdcf3c000 r--p 00000000 fd:00 262397 /usr/lib/locale/locale-archive
7f4fdcf3c000-7f4fdd0f2000 r-xp 00000000 fd:00 262350 /usr/lib64/libc-2.17.so
7f4fdd0f2000-7f4fdd2f2000 ---p 001b6000 fd:00 262350 /usr/lib64/libc-2.17.so
7f4fdd2f2000-7f4fdd2f6000 r--p 001b6000 fd:00 262350 /usr/lib64/libc-2.17.so
7f4fdd2f6000-7f4fdd2f8000 rw-p 001ba000 fd:00 262350 /usr/lib64/libc-2.17.so
7f4fdd2f8000-7f4fdd2fd000 rw-p 00000000 00:00 0
7f4fdd2fd000-7f4fdd3fd000 r-xp 00000000 fd:00 262358 /usr/lib64/libm-2.17.so
7f4fdd3fd000-7f4fdd5fd000 ---p 00100000 fd:00 262358 /usr/lib64/libm-2.17.so
7f4fdd5fd000-7f4fdd5fe000 r--p 00100000 fd:00 262358 /usr/lib64/libm-2.17.so
7f4fdd5fe000-7f4fdd5ff000 rw-p 00101000 fd:00 262358 /usr/lib64/libm-2.17.so
7f4fdd5ff000-7f4fdd601000 r-xp 00000000 fd:00 262384 /usr/lib64/libutil-2.17.so
7f4fdd601000-7f4fdd800000 ---p 00002000 fd:00 262384 /usr/lib64/libutil-2.17.so
7f4fdd800000-7f4fdd801000 r--p 00001000 fd:00 262384 /usr/lib64/libutil-2.17.so
7f4fdd801000-7f4fdd802000 rw-p 00002000 fd:00 262384 /usr/lib64/libutil-2.17.so
7f4fdd802000-7f4fdd804000 r-xp 00000000 fd:00 262356 /usr/lib64/libdl-2.17.so
7f4fdd804000-7f4fdda04000 ---p 00002000 fd:00 262356 /usr/lib64/libdl-2.17.so
7f4fdda04000-7f4fdda05000 r--p 00002000 fd:00 262356 /usr/lib64/libdl-2.17.so
7f4fdda05000-7f4fdda06000 rw-p 00003000 fd:00 262356 /usr/lib64/libdl-2.17.so
7f4fdda06000-7f4fdda1d000 r-xp 00000000 fd:00 262376 /usr/lib64/libpthread-2.17.so
7f4fdda1d000-7f4fddc1c000 ---p 00017000 fd:00 262376 /usr/lib64/libpthread-2.17.so
7f4fddc1c000-7f4fddc1d000 r--p 00016000 fd:00 262376 /usr/lib64/libpthread-2.17.so
7f4fddc1d000-7f4fddc1e000 rw-p 00017000 fd:00 262376 /usr/lib64/libpthread-2.17.so
7f4fddc1e000-7f4fddc22000 rw-p 00000000 00:00 0
7f4fddc22000-7f4fddc42000 r-xp 00000000 fd:00 262343 /usr/lib64/ld-2.17.so
7f4fddc83000-7f4fdde2c000 rw-p 00000000 00:00 0
7f4fdde3e000-7f4fdde41000 rw-p 00000000 00:00 0
7f4fdde41000-7f4fdde42000 r--p 0001f000 fd:00 262343 /usr/lib64/ld-2.17.so
7f4fdde42000-7f4fdde43000 rw-p 00020000 fd:00 262343 /usr/lib64/ld-2.17.so
7f4fdde43000-7f4fdde44000 rw-p 00000000 00:00 0
7fffdde49000-7fffdde6a000 rw-p 00000000 00:00 0 [stack]
7fffddfa1000-7fffddfa3000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
已放弃(吐核

报错信息

经过一翻百度然后自己看包有两处信息是重要的,主要看红色部分

Stand-alone GNU readline module

Some platforms, such as macOS, do not ship with GNU readline installed. The readline extension module in the standard library of Mac "system" Python uses NetBSD's editline (libedit) library instead, which is a readline replacement with a less restrictive software license.

As the alternatives to GNU readline do not have fully equivalent functionality, it is useful to add proper readline support to these platforms. This module achieves this by bundling the standard Python readline module with the GNU readline source code, which is compiled and statically linked to it. The end result is a package which is simple to install and requires no extra shared libraries.

The module is called gnureadline so as not to clash with the readline module in the standard library. This keeps polite installers such as pip happy and is sufficient for shells such as IPython. Please take note that IPython does not depend on gnureadline anymore since version 5.0 as it now uses prompt_toolkit instead.

In order to use this module in the standard Python shell it has to be installed with the more impolite easy_install from setuptools. It is recommended that you use pip >= 8.0 together with setuptools >= 0.8 to install gnureadline. This will download a binary wheel from PyPI if available, thereby bypassing the need for compilation and its slew of potential problems (especially on macOS).

The module can be used with both Python 2.x and 3.x, and has been tested with Python versions 2.6, 2.7, 3.2, 3.3, 3.4, 3.5 and 3.6. The first three numbers of the module version reflect the version of the underlying GNU readline library (major, minor and patch level), while any additional fourth number distinguishes different module updates based on the same readline library.

This module is usually unnecessary on Linux and other Unix systems with default readline support. An exception is if you have a Python distribution that does not include GNU readline due to licensing restrictions (such as ActiveState's ActivePython). If you are using Windows, which also ships without GNU readline, you might want to consider using the pyreadline module instead, which is a readline replacement written in pure Python that interacts with the Windows clipboard.

信息二

[root@centos7 python3.6]# ./bin/pip3 search readline
readline (6.2.4.1) - The standard Python readline extension statically linked
against the GNU readline library.
micropython-readline (0.0.0) - Dummy readline module for MicroPython
urwid-readline (0.7) - A textbox edit widget for urwid that supports readline
shortcuts
pygnurl (1.0.1) - Dynamic GNU Readline interface
pyreadline (2.1) - A python implmementation of GNU readline.
gnureadline (6.3.8) - The standard Python readline extension statically linked
against the GNU readline library.

解决方法:

./bin/pip3 install gnureadline   最后导入模块不会报错了

二 pip 安装模块包的时候报错

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

问题:缺少openssl-devel包

解决:

yum -y install openssl-devel
vim /usr/local/python3.6.6/Python-3.6.6/Modules/Setup
找到下面的命令,去掉注释
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto 重新编译
make && make install

linux中使用pip命令遇到的一些问题的更多相关文章

  1. Linux中的历史命令

    Linux中的历史命令一般保存在用户    /root/.bash_history history 选项 历史命令保存文件夹 选项     -c:清空历史命令     -w :把缓存中的历史命令写入历 ...

  2. 关于XShell的常见使用和设置以及Linux中的常见命令.

    本文部分转自:http://sundful.iteye.com/blog/704079 和 http://www.vckai.com/p/5 有时候在XShell中操作的一些命令傻傻的分不清这个命令到 ...

  3. linux中的strings命令简介2

    摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 之前我们聊过linux strings的用法和用 ...

  4. linux中的strings命令简介

    摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 在linux下搞软件开发的朋友, 几乎没有不知道 ...

  5. linux中的ps命令用法。

    在linux中使用ps命令可以查看有哪些进程在运行和运行的状态.进程是否结束.进程有没有僵尸.哪些进程占用了过多的资源等等. ps命令最常用的是用于监控后台进程的工作情况. 名称:ps 使用权限:所有 ...

  6. linux中的 tar命令的 -C 参数,以及其它一些参数(转)

    linux中的 tar命令的 -C 参数,以及其它一些参数 复制源:http://www.cnblogs.com/li-hao/archive/2011/10/03/2198480.htmltar命令 ...

  7. Linux故障:linux中使用ifconfig命令查看网卡信息时显示为eth1,但是在network-scripts中只有ifcfg-eth0的配置文件,并且里面的NAME="eth0"。

    linux中使用ifconfig命令查看网卡信息时显示为eth1,但是在network-scripts中只有ifcfg-eth0的配置文件,并且里面的NAME="eth0".   ...

  8. Linux 中的 Install命令

    Linux 中的 Install命令 更新时间:2017年09月25日 16:51:45   投稿:mrr   我要评论 install命令的作用是安装或升级软件或备份数据,它的使用权限是所有用户. ...

  9. Linux 中常用的命令

    Linux中的常用命令: 终端快捷键: Ctrl + a/Home 切换到命令行开始 Ctrl + e/End 切换到命令行末尾 Ctrl + l 清除屏幕内容,效果等同于clear Ctrl + u ...

随机推荐

  1. mysql 删除数据库中所有的表中的数据,只删database下面所有的表。

    select concat('drop table ',table_name,';') from TABLES where table_schema='数据库名称'; select concat('t ...

  2. 使用 Kafka 在生产环境构建大规模机器学习

    智能实时应用为所有行业带来了革命性变化.机器学习及其分支深度学习正蓬勃发展,因为机器学习让计算机能够在无人指引的情况下挖掘深藏的洞见.这种能力正是多种领域所需要的,如非结构化数据分析.图像识别.语音识 ...

  3. 阅读 RAM-Based Shift Register(ALTSHIFT_TAPS) IP Core User Guide

    阅读 RAM-Based Shift Register(ALTSHIFT_TAPS) IP Core User Guide 说明:本文档自带测试工程: DE_ALTSHIFT_TAPS.zip 1.支 ...

  4. 回看《例说FPGA》---DDR2控制器集成与读写测试

    回看<例说FPGA> ---DDR2控制器集成与读写测试 1.DDR2 IP核的配置 需要弄清楚的选项主要有: PLL reference clock frequency Memory c ...

  5. 如何写出健壮的Java代码

    近来在公司写代码,写出的代码发现BUG很多,为了实现一个功能,代码改了又改,影响了工单的效率,也影响个人绩效,因此从网上找了些关于写健壮代码的文章看了看,再加上自己的一些经验总结. 所谓健壮的代码是指 ...

  6. IDEA创建一个Mybatis逆向工程

    Mybatis逆向工程简介: MyBatis Generator (MBG) 是一个Mybatis的代码生成器 MyBatis 和 iBATIS. 他可以生成Mybatis各个版本的代码,和iBATI ...

  7. 【Docker】docker常用指令

    开启docker,并设置开机自启动 老式写法: service docker start chkconfig docker on 新式写法: systemctl start docker.servic ...

  8. Android开发之内部类篇

    内部类: 1.内部类的第一个好处,隐藏你不想让别人知道的操作,也即封装性. 2.非静态内部类对象有着指向其外部类对象的引用 等等. 创建项目: 1.File---->New----->ja ...

  9. java设计模式-责任链

    背景:要把<script>等<>html标签替换掉:把敏感词屏蔽或者替换等: 1.刚开始可能这么写: public class Main { public static voi ...

  10. dubbo项目部署遇到的问题

    部署的项目结构如下: [图片] 1 Socket >>>相关的报错 检查下zookeeper的服务端cmd和客户端cmd是否起来了 2 jdbc.DataSourceProperti ...