繁体   English   中英

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

[英]python pip install mod_wsgi fails with possible unicode error

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

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

在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

该错误正在查看我的主要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)

那个人正在看我的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')

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

从头开始重新安装Python,这次在构建Python时使用--enable-shared到Python的configure脚本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM