python pip install mod_wsgi失败,可能出现unicode错误

Bri*_*ach 3 python apache mod-wsgi

我正在尝试使用Flask托管一个Web应用程序.我有运行CentOS的VPS.我安装了Apache 2.2.26.

当我pip install mod_wsgi在虚拟环境中运行或在我的主Python安装上运行时,我会收到以下错误

在Python跟踪之前打印第一个错误...

/usr/bin/ld: /home5/arguably/python27/lib/python2.7/config/libpython2.7.a(abstra     ct.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when maki     ng a shared object; recompile with -fPIC

/home5/arguably/python27/lib/python2.7/config/libpython2.7.a: could not read sym     bols: Bad value

collect2: ld returned 1 exit status

error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

该错误正在查看我的主要Python安装.这不是virtualenv所在的位置

Python错误......

Traceback (most recent call last):
  File "/home/arguably/webapps/ers_2/ers2venv/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/arguably/webapps/ers_2/ers2venv/lib/python2.7/site-packages/pip/__     init__.py", line 185, in main
    return command.main(cmd_args)
  File "/home/arguably/webapps/ers_2/ers2venv/lib/python2.7/site-packages/pip/ba     secommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 43: ordinal not in range(128)
Run Code Online (Sandbox Code Playgroud)

那个人正在看我的virtualenv

Python跟踪文件中的行text = '\n'.join(complete_log)..

if store_log:
            log_file_fn = options.log_file
            text = '\n'.join(complete_log)
            try:
                log_file_fp = open_logfile(log_file_fn, 'w')
            except IOError:
                temp = tempfile.NamedTemporaryFile(delete=False)
                log_file_fn = temp.name
                log_file_fp = open_logfile(log_file_fn, 'w')
Run Code Online (Sandbox Code Playgroud)

Gra*_*ton 5

您的Python安装尚未安装共享库.这是mod_wsgi所必需的.请参阅mod_wsgi文档.

从头开始重新安装Python和这次使用--enable-sharedconfigure建筑物时,脚本的Python.