[英]Can not install VTK with Anaconda
I can not install VTK by anaconda in Mac OS X. I use 我无法在Mac OS X中安装Anaconda的VTK。我使用
conda install -c anaconda vtk=6.3.0
Python 2.7 but get the following error: Python 2.7,但出现以下错误:
UnsatisfiableError: The following specifications were found to be in conflict: - python 3.6* - vtk 6.3.0* -> python 2.7* -> openssl 1.0.1* Use "conda info " to see the dependencies for each package. UnsatisfiableError:发现以下规范存在冲突:-python 3.6 *-vtk 6.3.0 *-> python 2.7 *-> openssl 1.0.1 *使用“ conda info”查看每个软件包的依赖关系。
But I've updated Python to 3.6, and the same error. 但是我已经将Python更新为3.6,并且出现了相同的错误。
$ conda search vtk
Fetching package metadata ...........
vtk 5.10.1 py27_0 defaults
5.10.1 py27_1 defaults
6.3.0 py27_0 defaults
6.3.0 py27_1 defaults
$ conda create -n vtk python=2.7 vtk=6.3.0
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /home/sidon/opt/anaconda3/envs/vtk:
The following NEW packages will be INSTALLED:
openssl: 1.0.2k-1
pip: 9.0.1-py27_1
python: 2.7.13-0
readline: 6.2-2
setuptools: 27.2.0-py27_0
sqlite: 3.13.0-0
tk: 8.5.18-0
vtk: 6.3.0-py27_1
wheel: 0.29.0-py27_0
zlib: 1.2.8-3
Proceed ([y]/n)? y
vtk-6.3.0-py27 100% |#############################################################################################| Time: 0:00:15 1.97 MB/s
#
# To activate this environment, use:
# > source activate vtk
#
# To deactivate this environment, use:
# > source deactivate vtk
#
$ source activate vtk
$ python -c "import vtk; print vtk.vtkSphereSource()"
vtkSphereSource (0xcfdcc0)
Debug: Off
Modified Time: 39
Reference Count: 2
Registered Events: (none)
Executive: 0xae5e00
ErrorCode: Success
Information: 0xf6e210
AbortExecute: Off
Progress: 0
Progress Text: (None)
Theta Resolution: 8
Phi Resolution: 8
Theta Start: 0
Phi Start: 0
Theta End: 360
Phi End: 180
Radius: 0.5
Center: (0, 0, 0)
LatLong Tessellation: 0
Output Points Precision: 0
I would suggest installing directly from the wheel file. 我建议直接从wheel文件安装。 You can get the VTK wheel file from here ( wheel file directory site ). 您可以从此处( 车轮文件目录站点 )获取VTK车轮文件。 This site has pretty much every wheel file so it is your friend! 这个站点几乎每个车轮文件,因此是您的朋友! just search for it and you will see a bunch of .whl
VTK files. 只需搜索它,您会看到一堆.whl
VTK文件。
just download the wheel file that matches your anaconda python root version (either 3.5, 3.6, 2.7 etc.) and either 32 or 64 bit (depending on your python version). 只需下载与您的anaconda python根版本(3.5、3.6、2.7等)和32或64位(取决于您的python版本)相匹配的wheel文件。
To install from a wheel file, open a terminal in the directory the wheel is in and type 要从车轮文件安装,请在车轮所在目录中打开一个终端,然后键入
pip install "your_wheel_file_name"
If you want to install it for a conda environment, just activate the environment first ( activate "env_name"
) and then install from the wheel file. 如果要在conda环境中安装它,只需先激活环境( activate "env_name"
),然后从wheel文件安装即可。
Try this out for me: 为我尝试一下:
conda create --name vtk_test python=2.7 vtk
This will create a new environment with VTK, Python and their dependencies inside. 这将创建一个包含VTK,Python及其依赖项的新环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.