UnicodeEncodeError при установке Brightway2 под Python 2.7
Анаконда Python2.7
Ubuntu16.04 LTS
У меня UnicodeEncodeError при установке Brightway2 по:
pip install brightway2
UnicodeEncondeError:
Collecting brightway2
Using cached brightway2-2.0.2.tar.gz
Collecting appdirs (from brightway2)
Downloading appdirs-1.4.1-py2.py3-none-any.whl
Collecting asteval (from brightway2)
Using cached asteval-0.9.8.tar.gz
Collecting bw2analyzer>=0.9 (from brightway2)
Using cached bw2analyzer-0.9.1.tar.gz
Collecting bw2calc>=1.2.1 (from brightway2)
Using cached bw2calc-1.5.3.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/bw2calc.egg-info
writing requirements to pip-egg-info/bw2calc.egg-info/requires.txt
writing pip-egg-info/bw2calc.egg-info/PKG-INFO
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ikaXlZ/bw2calc/setup.py", line 33, in <module>
'Topic :: Scientific/Engineering :: Visualization',
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 272, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 600, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/distutils/dist.py", line 1106, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/home/runsheng/anaconda2/envs/tensorflow/lib/python2.7/site-packages/setuptools/dist.py", line 51, in write_pkg_file
file.write('License: %s\n' % self.get_license())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 50: ordinal not in range(128)
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ikaXlZ/bw2calc/
Это происходит только под Python2.7. Когда я переключаюсь на Python3.5, ошибка исчезает и brightway2 работает нормально.
Я установил ftfy и восемь для перевода кода между Python2.7 и Python3.
1 ответ
Это ошибка в setuptools. Тем временем я выпустил новую версию bw2calc, которая должна решить эту проблему.