【发布时间】: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 如何查找旧版本?
【问题讨论】:
-
这里讨论了这个问题的解决方案和好的参考资料:stackoverflow.com/questions/31362246/…
标签: linux python-2.7 build compilation mod-wsgi