Bootstrap

linux7有关python的一些报错

目录

安装时遇到安装包需要公钥验证时:

对python进行编译配置的一些报错:

make: *** 没有规则可以创建“Programs/python.o”需要的目标“Python/stdlib_module_names.h”。 停止:

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

-bash: /usr/bin/yum: /usr/bin/python: 坏的解释器: 没有那个文件或目录:

安装ipython时的报错:

运行python3.10时:


安装时遇到安装包需要公钥验证时:

#在安装命令后加 --nogpgcheck
yum install abcd -y --nogpgcheck

对python进行编译配置的一些报错:

make:

make install:

解决:

#因执行./configure命令时加了--enable-optimizations
#清空配置重新执行./configure

make clean

./configure --prefix=/安装路径

make: *** 没有规则可以创建“Programs/python.o”需要的目标“Python/stdlib_module_names.h”。 停止:

解决:

(直接忽略这部分吧,看最底下的重装就好了)

#可能是我更改了make的路径导致的问题
#查找一下.h文件

locate stdlib_module_names.h
#查找不到,或许依赖缺失了,我使用过make clean命令

#在Python/下创建一个stdlib_module_names.h
vim stdlib_module_names.h

#添加以下内容
// Auto-generated by Tools/scripts/generate_stdlib_module_names.py.
// List used to create sys.stdlib_module_names.
static const char* _Py_stdlib_module_names[] = {
"__future__",
"_abc",
"_aix_support",
"_ast",
"_asyncio",
"_bisect",
"_blake2",
"_bootsubprocess",
"_bz2",
"_codecs",
"_codecs_cn",
"_codecs_hk",
"_codecs_iso2022",
"_codecs_jp",
"_codecs_kr",
"_codecs_tw",
"_collections",
"_collections_abc",
"_compat_pickle",
"_compression",
"_contextvars",
"_crypt",
"_csv",
"_ctypes",
"_curses",
"_curses_panel",
"_datetime",
"_dbm",
"_decimal",
"_elementtree",
"_frozen_importlib",
"_frozen_importlib_external",
"_functools",
"_gdbm",
"_hashlib",
"_heapq",
"_imp",
"_io",
"_json",
"_locale",
"_lsprof",
"_lzma",
"_markupbase",
"_md5",
"_msi",
"_multibytecodec",
"_multiprocessing",
"_opcode",
"_operator",
"_osx_support",
"_overlapped",
"_pickle",
"_posixshmem",
"_posixsubprocess",
"_py_abc",
"_pydecimal",
"_pyio",
"_queue",
"_random",
"_scproxy",
"_sha1",
"_sha256",
"_sha3",
"_sha512",
"_signal",
"_sitebuiltins",
"_socket",
"_sqlite3",
"_sre",
"_ssl",
"_stat",
"_statistics",
"_string",
"_strptime",
"_struct",
"_symtable",
"_thread",
"_threading_local",
"_tkinter",
"_tracemalloc",
"_uuid",
"_warnings",
"_weakref",
"_weakrefset",
"_winapi",
"_zoneinfo",
"abc",
"aifc",
"antigravity",
"argparse",
"array",
"ast",
"asynchat",
"asyncio",
"asyncore",
"atexit",
"audioop",
"base64",
"bdb",
"binascii",
"binhex",
"bisect",
"builtins",
"bz2",
"cProfile",
"calendar",
"cgi",
"cgitb",
"chunk",
"cmath",
"cmd",
"code",
"codecs",
"codeop",
"collections",
"colorsys",
"compileall",
"concurrent",
"configparser",
"contextlib",
"contextvars",
"copy",
"copyreg",
"crypt"
;