安装Mayavi:UnicodeEncodeError:' charmap'编解码器无法对字符进行编码

时间:2017-11-06 16:16:10

标签: python windows unicode anaconda mayavi

我正在尝试使用Anaconda 3.6在Windows计算机上安装Mayavi。

不幸的是,我收到了一个我不明白的错误。我仍然在发现Python。

我已经在互联网上看过其他类似的问题,但找不到任何有用的东西。

你能帮我吗?

(C:\Anaconda) C:\Windows\system32>pip install mayavi --upgrade
Collecting mayavi
  Using cached mayavi-4.5.0.tar.bz2
Requirement already up-to-date: apptools in c:\anaconda\lib\site-packages (from
mayavi)
Requirement already up-to-date: traits in c:\anaconda\lib\site-packages (from ma
yavi)
Requirement already up-to-date: traitsui in c:\anaconda\lib\site-packages (from
mayavi)
Requirement already up-to-date: configobj in c:\anaconda\lib\site-packages (from
 apptools->mayavi)
Requirement already up-to-date: pyface in c:\anaconda\lib\site-packages (from tr
aitsui->mayavi)
Requirement already up-to-date: six in c:\anaconda\lib\site-packages (from confi
gobj->apptools->mayavi)
Requirement already up-to-date: pygments in c:\anaconda\lib\site-packages (from
pyface->traitsui->mayavi)
Building wheels for collected packages: mayavi
  Running setup.py bdist_wheel for mayavi ... error
  Complete output from command C:\Anaconda\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Fuentes\\AppData\\Local\\Temp\\pip-build-ybqsb6ne\
\mayavi\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().rep
lace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel
-d C:\Users\Fuentes\AppData\Local\Temp\tmpielgp53opip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  ----------------------------------------------------------------------
  Building TVTK classes... vtkContextDevice2D: Ignoring method: Get/SetViewportR
ect 

[...]

    File "C:\Users\Fuentes\AppData\Local\Temp\pip-build-ybqsb6ne\mayavi\tvtk\wra
pper_gen.py", line 243, in generate_code
      self._gen_class_init(node, out)
    File "C:\Users\Fuentes\AppData\Local\Temp\pip-build-ybqsb6ne\mayavi\tvtk\wra
pper_gen.py", line 315, in _gen_class_init
      self.dm.write_class_doc(klass.__doc__, out, indent)
    File "C:\Users\Fuentes\AppData\Local\Temp\pip-build-ybqsb6ne\mayavi\tvtk\ind
enter.py", line 169, in write_class_doc
      out.write(indent.format('\n' + ret))
    File "C:\Anaconda\lib\encodings\cp1252.py", line 19, in encode
      return codecs.charmap_encode(input,self.errors,encoding_table)[0]
  **UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in positio
n 3665: character maps to <undefined>**

  ----------------------------------------
  **Failed building wheel for mayavi**
  Running setup.py clean for mayavi
**Failed to build mayavi**
Installing collected packages: mayavi
  Running setup.py install for mayavi ... error

[...]

      File "C:\Anaconda\lib\encodings\cp1252.py", line 19, in encode
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]
    **UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in posit
ion 3665: character maps to <undefined>**

    ----------------------------------------
Command "C:\Anaconda\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\Fuentes\\AppData\\Local\\Temp\\pip-build-ybqsb6ne\\mayavi\\setup.py';f=g
etattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.c
lose();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Fuentes\
AppData\Local\Temp\pip-vjpz5i0u-record\install-record.txt --single-version-exter
nally-managed --compile" failed with error code 1 in C:\Users\Fuentes\AppData\Lo
cal\Temp\pip-build-ybqsb6ne\mayavi\

3 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。我的解决方案是下载&#39; mayavi-4.5.0 + vtk81-cp36-cp36m-win_amd64.whl&#39;来自https://www.lfd.uci.edu/~gohlke/pythonlibs/和pip install mayavi-4.5.0 + vtk81-cp36-cp36m-win_amd64.whl。

答案 1 :(得分:0)

最终,我管理了安装 mayavi ,但我没有解决问题:我刚刚卸载了Anaconda 3.6并安装了Anaconda 2.7。然后我可以安装我需要的所有东西。

答案 2 :(得分:0)

我遇到了同样的问题并设法通过在https://pypi.python.org/pypi/mayavi下载mayavi-4.5.0.zip文件并将“mayavi”文件夹直接复制到Anaconda3 \ Lib

来覆盖它