我在虚拟环境和mod_wsgi配置方面遇到了问题。
我的apache配置中包含以下内容:
WSGIDaemonProcess myapp python-path=/mnt/myapp/current:/mnt/env/lib/python3.4/site-packages它清楚地表明我使用的是python3.4。
但是如果我在我的虚拟环境中,如果我执行以下操作,我得到的信息是Python版本是3.4.3:
(env)root@Python:/mnt/env/bin# python
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 但是如果我列出了bin文件夹中的所有文件,我可以看到python3.4已经安装。
lrwxrwxrwx 1 root root 9 Mar 24 10:50 python -> python3.4
lrwxrwxrwx 1 root root 9 Mar 24 10:50 python3 -> python3.4
-rwxr-xr-x 1 root root 3709944 Mar 24 10:50 python3.4在我的apache日志中,我收到了这样的警告:
[Fri Jul 08 10:32:52.394080 2016] [:warn] [pid 29613] mod_wsgi: Compiled for Python/3.4.0.
[Fri Jul 08 10:32:52.394119 2016] [:warn] [pid 29613] mod_wsgi: Runtime using Python/3.4.3.这也来自我的apache日志:
Fri Jul 08 10:53:01.266961 2016] [:error] [pid 29619] Traceback (most recent call last):
[Fri Jul 08 10:53:01.267014 2016] [:error] [pid 29619] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
[Fri Jul 08 10:53:01.268311 2016] [:error] [pid 29619] assert tlock is not None
[Fri Jul 08 10:53:01.268356 2016] [:error] [pid 29619] AssertionError:
[Fri Jul 08 10:53:01.259885 2016] [:error] [pid 29621] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>我不确定日志中的最后一条消息是否连接到前一条消息,但我认为是。
有人能建议我如何在我的虚拟环境中安装python版本的3.4.3吗?在此之后,我将更改mod_wsgi配置。
谢谢!
发布于 2016-07-10 00:23:12
看起来您使用的是mod_wsgi的编译版本,当您第一次构建它时,它是用Python语言编译的,可能已经是Python3.4.0。看起来这次你想要做的是在Python3.4.3上重新编译mod_wsgi,使用类似这样的代码:
wget -q "https://github.com/GrahamDumpleton/mod_wsgi/archive/4.4.21.tar.gz"
tar -xzf '4.4.21.tar.gz'
cd ./mod_wsgi-4.4.21
./configure --with-python=/path/to/your/python343/install
make
make install祝好运!
https://stackoverflow.com/questions/38269830
复制相似问题