no module named vtk

Aron Wahlberg aron at
Wed Mar 10 06:04:05 PST 2010

Thank you for your answers!

You were right Brandon, I had two port versions of python. I uninstalled the older and inactive version. I made sure I was running the remaining python from macports, not the MacOSX one by "which python", which points at /opt/local/bin/python. Then I reinstalled vtk:

>  sudo port uninstall vtk-devel
>  sudo port clean --all vtk-devel
>  sudo port -v install vtk-devel +py26

However, I still get no module named vtk-devel. Other ideas?



On 4 Mar, 2010, at 22:51, Brandon Allbery wrote:

> Hash: SHA1
> On Mar 3, 2010, at 07:07 , Aron Wahlberg wrote:
>> I get the following error when I try to import vtk
>> Aron-Wahlbergs-MacBook-Pro:vtk-5.4 aron$ python -c 'import vtk'
>> Traceback (most recent call last):
>> File "<string>", line 1, in <module>
>> ImportError: No module named vtk
>> I have installed vtk via macports and have the following version:
>> port installed vtk-devel
>> The following ports are currently installed:
>> vtk-devel @5.4.2_1+cocoa+data+doc+examples+shared+testing (active)
> You have multiple versions of python installed.  At minimum, MacPorts will only install Python packages into its own copy of Python, because messing with the Apple-supplied one risks both compatibility issues and breakage due to system updates; you may also have multiple Python versions installed by MacPorts.
> Use "port contents vtk-devel" to find out where the vtk files got installed, then make sure you run that python.
> - --
> brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at
> system administrator [openafs,heimdal,too many hats] allbery at
> electrical and computer engineering, carnegie mellon university    KF8NH
> Version: GnuPG v2.0.10 (Darwin)
> iEYEARECAAYFAkuQK3AACgkQIn7hlCsL25VtCwCgwOUxCALvtBy1roghGb56Ii26
> fBMAoJ+vcLZf8And8SHgNcm//pMeVs9P
> =jq7r

More information about the macports-users mailing list