gpt4 book ai didi

Python 2.7.2 安装困难

转载 作者:太空宇宙 更新时间:2023-11-04 11:34:05 25 4
gpt4 key购买 nike

我正在尝试从我的 Linux 机器中的源文件安装 Python 2.7.2。但我遇到了以下已讨论的问题 earlier .

Traceback (most recent call last):
File "/a/b/python2.7.2/linux26_x86_64/lib/python2.7/compileall.py", line 16, in <module>
import struct
File "/a/b/python3.7.2/linux26_x86_64/lib/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: No module named _struct
gmake: *** [libinstall] Error 1

我关注了 link在答案中提供并尝试了 Hans Lellelid (hozn) 的建议来修改 site.py 但仍然没有运气。

我的系统详细信息是:

% cat /etc/*-release
CentOS release 4.6 (Final)

% uname -av
Linux scdbuild04 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:49:06 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

% gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)

最佳答案

我用了Activestate Python用于安装 Python 2.7。我在安装中也遇到了一个问题,通过正确设置 PYTHONHOME env 变量解决了这个问题,如 answer 中所述。 .

% setenv PYTHONHOME /a/b/python2.7.2/linux26_x86_64
% tar -xzf ActivePython-2.7.2.5-linux-x86_64.tar.gz
% cd ActivePython-2.7.2.5-linux-x86_64
% ./install.sh -I /a/b/python2.7.2/linux26_x86_64

关于Python 2.7.2 安装困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9303301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com