【问题标题】:"make" builds wrong python version“make”构建错误的python版本
【发布时间】:2015-11-03 01:09:12
【问题描述】:

系统: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 如何查找旧版本?

【问题讨论】:

标签: linux python-2.7 build compilation mod-wsgi


【解决方案1】:

我将在此处记录此作为修复程序,也希望从 Graham 那里得到关于为什么需要这样做的评论;

变化

make

LD_RUN_PATH=/usr/local/lib make

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

[warn] mod_wsgi: Compiled for Python/2.7.10. [warn] mod_wsgi: Runtime using Python/2.7.3.

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-31
  • 1970-01-01
  • 2011-02-18
  • 1970-01-01
  • 2011-08-22
  • 1970-01-01
  • 2019-04-03
相关资源
最近更新 更多