gpt4 book ai didi

linux - "make"构建了错误的 python 版本

转载 作者:太空狗 更新时间:2023-10-29 12:29:34 25 4
gpt4 key购买 nike

系统 : SMEServer 8.1 (CentOS 5.10) 64bit, 系统python 2.4.3

在/usr/local/bin/python2.7 (2.7.3) 中有一个 alt python,它是前一段时间构建的。

目标:构建python2.7.10、mod_wsgi、django。第一步是用 python 2.7.10 替换(旧的和损坏的)2.7.3

会发生什么:

当我将最新的 2.7 python 构建为 shared 时,构建了错误的可执行文件。

cd /tmp && rm -vrf Python-2.7.10 && tar -xzvf Python-2.7.10.tgz && cd Python-2.7.10 && ./configure && make && ./python -V

2.7.10 <- as expected

...但这不适用于 mod_wsgi - 我们必须 --enable-shared。

cd /tmp && rm -vrf Python-2.7.10 && tar -xzvf Python-2.7.10.tgz && cd Python-2.7.10 && ./configure --enable-shared && make && ./python -V

2.7.3 <- Wrong version!

我每次都会删除整个构建目录以隔离内容并确保我不会在每次尝试时都污染文件夹。不知何故,2.7.3 的(多年)安装被配置“发现”,但仅当“--enable-shared”打开时。

cd /tmp && rm -vrf Python-2.7.10 && tar -xzvf Python-2.7.10.tgz && cd Python-2.7.10 && ./configure --prefix=/usr/local/ && make && ./python -V

2.7.10

cd /tmp && rm -vrf Python-2.7.10 && tar -xzvf Python-2.7.10.tgz && cd Python-2.7.10 && ./configure --enable-shared --prefix=/usr/local/ && make && ./python -V

2.7.3 <- ???

我在哪里可以找到 make 如何找到旧版本?

最佳答案

我将在此处将此记录为修复程序,同时希望 Graham 就可能需要此操作的原因发表评论;

改变

制作

LD_RUN_PATH=/usr/local/lib 制作

是答案,但我不得不使用它来构建 python2.7.10 和 mod_wsgi。没有在 mod_wsgi 上使用 LD_RUN_PATH,我仍然感到害怕;


[警告] mod_wsgi:为 Python/2.7.10 编译。
[警告] mod_wsgi:运行时使用 Python/2.7.3。

关于linux - "make"构建了错误的 python 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31931087/

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