简体   繁体   English

在Python 2.7下安装Brightway2时出现UnicodeEncodeError

[英]UnicodeEncodeError when installing Brightway2 under Python 2.7

Anaconda Python2.7 Anaconda Python2.7

Ubuntu16.04 LTS Ubuntu16.04 LTS

I have UnicodeEncodeError when installing Brightway2 by: 通过以下方式安装Brightway2时出现UnicodeEncodeError:

pip install brightway2

The UnicodeEncondeError: 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/

It only happens under Python2.7. 它仅在Python2.7下发生。 When I switch to Python3.5 the error disappears and brightway2 works fine. 当我切换到Python3.5时,错误消失并且Brightway2正常工作。

I have installed ftfy and eight to translate code between Python2.7 and Python3. 我已经安装了ftfy8来在Python2.7和Python3之间翻译代码。

This is a bug in setuptools . 这是setuptools中错误 In the meantime, I have released a new version of bw2calc that should fix this problem . 同时,我发布了bw2calc新版本应该可以解决此问题

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

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