0
$\begingroup$

I need to use the VTK module in a python script inside Blender. It seems that there is no Python 3.7 version of VTK for Intel chips (and B2.8 comes with P3.7) and so I'm now trying to figure out if I need to downgrade blender, python, both, or if some other (better) solution exists.

Running Windows 10 (sadly...certainly not by choice)

$\endgroup$
  • $\begingroup$ PyPI has a package for Windows 64 Bit and Python 3.7 pypi.org/project/vtk/#files $\endgroup$ – Robert Gützkow Nov 5 '19 at 17:20
  • $\begingroup$ Ah, yes, but how to install on an Intel based machine... $\endgroup$ – jb4earth Nov 5 '19 at 17:30
  • $\begingroup$ Through pip install? If your question was regarding amd64, it's called like that for historic reasons. It's the right package for 64 bit independent of the CPU manufacturer. $\endgroup$ – Robert Gützkow Nov 5 '19 at 17:35
  • $\begingroup$ pip install --upgrade pip + pip install vtk = ERROR: Could not find a version that satisfies the requirement vtk (from versions: none) ERROR: No matching distribution found for vtk Also, python -m ensurepip + python -m install vtk1 results in the same. I thought it might be an architecture problem but it seems to be something else... Trying from wheel: python -m pip install 'wheellocal.whl' = ERROR: vtk-8.1.2-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform. $\endgroup$ – jb4earth Nov 5 '19 at 17:47
  • $\begingroup$ I just tested this in a venv and it works fine. Please check that you're actually running Python 3.7. (python --version) and ensure that it's a 64 bit install of Python. $\endgroup$ – Robert Gützkow Nov 5 '19 at 19:33
1
$\begingroup$

I'm not sure if the reinstall and admin rights are necessary for all cases but the following solved my problem:

  1. Uninstall Blender and reinstall as Admin
  2. In Blender Python shell run

    import sys
    sys.exec_prefix
    
  3. Open Powershell as Admin
  4. Go to directory listed by Blender Python shell
  5. Ensure pip

    .\bin\python.exe -m ensurepip
    
  6. Install modules

    .\Scripts\pip3.exe install vtk
    

Thanks to @rgj for troubleshooting and this blog for Blender/pip instructions

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.