簡體   English   中英

Python 2.7.2安裝困難

[英]Python 2.7.2 installation difficulties

我正在嘗試從Linux計算機中的源文件安裝Python 2.7.2 但是我遇到了下面已經討論的以下問題。

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

我遵循了答案中提供的鏈接 ,並嘗試了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變量來解決

% 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM