Форум сайта python.su
0
Исходные данные:
xubuntu 14.04
В среде virtualenv устанавливаю django-cms 3. В конце выходит ошибка:
INFO: Starting new HTTPS connection (1): pypi.python.org Command /home/developer/mycode/env/bin/python -c "import setuptools, tokenize;__file__='/home/developer/mycode/env/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KV9h_K-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/developer/mycode/env/include/site/python2.7 failed with error code 1 in /home/developer/mycode/env/build/Pillow Traceback (most recent call last): File "/home/developer/mycode/env/bin/djangocms", line 11, in <module> sys.exit(execute()) File "/home/developer/mycode/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 25, in execute install.requirements(config_data.requirements) File "/home/developer/mycode/env/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 62, in requirements exit_status = pip.main(args) File "/home/developer/mycode/env/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main return command.main(cmd_args) File "/home/developer/mycode/env/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 45: ordinal not in range(128)
Офлайн
0
Вообщем столкнулся с тойже проблемой, то что он ругается при записи в логи решается следующем образом:
В файле env/local/lib/python2.7/site-packages/pip/ basecommand.py надо изменить,
1) добавить строки перед классом Command:
# converts unicode objects to UTF-8, leaves bytestrings untouched def to_utf8(s): if isinstance(s, unicode): return s.encode('utf-8') else: return s
text = '\n'.join(complete_log) ------> text = '\n'.join(to_utf8(l) for l in complete_log)
Отредактировано totaki (Июль 9, 2014 08:13:28)
Офлайн