python - 如何使用 conda 启用 gl2ps 安装 vtk

标签 python compilation vtk anaconda conda

我正在使用 anaconda,我已经使用 conda 构建了 vtk

conda install vtk

vtk 的默认构建没有 gl2ps ,我想知道如何使用 conda 启用 gl2ps 来构建(或更确切地说是重建)vtk。

我实际上正在尝试执行这个示例代码:

 from mayavi import mlab
 mlab.test_plot3d()
 mlab.savefig(temp.eps)

但是报错

Saving as a vector PS/EPS/PDF/TeX file using GL2PS is either not supported by your version of VTK or you have not configured VTK to work with GL2PS -- read the documentation for the vtkGL2PSExporter class.

谢谢

编辑

我下载了 coda-recipes

git clone https://github.com/conda/conda-recipes.git

即使我不编辑文件以包含 gl2ps

BUILD START: vtk-5.10.1-py27_1
Fetching package metadata: ......
Solving package specifications: .
The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    setuptools-13.0.2          |           py27_0         435 KB

The following NEW packages will be INSTALLED:

    cmake:      3.0.1-0      
    openssl:    1.0.1k-0     
    pip:        6.0.8-py27_0 
    python:     2.7.9-1      
    readline:   6.2-2        
    setuptools: 13.0.2-py27_0
    sqlite:     3.8.4.1-0    
    system:     5.8-1        
    tk:         8.5.15-0     
    zlib:       1.2.8-0      

Fetching packages ...
setuptools-13. 100% |######################################################################################################################################################################################| Time: 0:00:00 463.16 kB/s
Extracting packages ...
[      COMPLETE      ] |########################################################################################################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ] |########################################################################################################################################################################################################| 100%
Source cache directory is: /home/users/user/anaconda/conda-bld/src_cache
Downloading source to cache: vtk-5.10.1.tar.gz
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
  File "/home/users/user/anaconda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 110, in main
    args_func(args, p)
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 308, in args_func
    args.func(args, p)
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 268, in execute
    build.build(m, verbose=not args.quiet, post=post)
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/build.py", line 304, in build
    source.provide(m.path, m.get_section('source'))
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 221, in provide
    unpack(meta)
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 60, in unpack
    src_path = download_to_cache(meta)
  File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 48, in download_to_cache
    download(meta['url'], path)
KeyError: 'url'

最佳答案

用于构建 vtk 的配方是 here .您应该修改它以包含该包并使用 conda build vtk/ 进行构建。

关于python - 如何使用 conda 启用 gl2ps 安装 vtk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28876706/

相关文章:

python - 如何使用 docker 容器和 geopy 来避免 nominatim 的超时问题?

php - 将 PHP 扩展编译为非线程安全的

c++ - 我正在努力理解预处理、编译和链接

python - Mayavi 中的 TVTK 错误(Python)

python - python 范围是否有 'anti-step' ? range(0, 100, n) 给出每个第 n 个数字,如果我想排除每个第 n 个数字怎么办?

python - 读取带有开始/结束标签的结构化数据

python - 无法在 Python 2.7 或 Python 3.3 中导入小数

gcc - 为什么空函数不只是返回

awk - 使用 AWK 将 MDF 转换为 VTK

python - 计算表面曲率的导数