Menu

ImportError: No module named vtk

2017-08-26
2021-01-13
  • Richard Beaudry

    Richard Beaudry - 2017-08-26

    I just installed MaxFEM on Windows 10. I follow the tutorial and when I try any option in Visualization, I get this error message in the black screen: "ImportError: No module named vtk". I then installed VTK-8.0.0, and it did not change anything.
    I cannot see any of the following windows:
    4. Visualization bar
    5. Visualization menu
    6. Scale
    7. Visualization window
    8. Scale bar
    9. Time bar

    What should I do?

    Thanks

     
    • Fran Pena

      Fran Pena - 2017-08-29

      Dear Mr. Beaudry,

      Please, be aware of the following warning showed in the MaxFEM download
      page:

      If you are using a version of VTK greater than or equal to 6.0, please try
      with the version 5. The latest version of Python(x,y) including VTK version
      5 seems to be 2.7.9.0. You can find it in some external mirrors in the
      Python(x,y) download page https://python-xy.github.io/downloads.html.

      Best regards,
      Francisco Pena

       

      Last edit: Fran Pena 2018-04-03
  • Frode Jenset

    Frode Jenset - 2018-04-01

    Hello. I have the same problem. Versions of vtk and other are confirmed correct. message :

    File "C:\Program Files (x86)\MaxFEM\code\PanelVisual.py", line 423, in add
    from v_vtk import Plot as Plot #### arriba manda tempo !!!
    File "C:\Program Files (x86)\MaxFEM\code\v_vtk\Plot.py", line 8, in <module>
    import vtk
    ImportError: No module named vtk

    Python seems to try to import a module named vtk instead of doing what it is supposed to do. Any tips?

     

    Last edit: Frode Jenset 2018-04-01
  • Frode Jenset

    Frode Jenset - 2018-04-02

    I could guess something is not installed in the correct directory, but I only installed two top-level software packages : MaxFem and PythonXY, vtk etc. should be part of the Python package. Since texts are echoed, the two work together. Is the solver getting x/0 from the project example file and the only error message is the vtk-text?

     
  • Fran Pena

    Fran Pena - 2018-04-03

    Dear Frode,

    In order to check that the Python version and VTK version are correct, please open a Command prompt and type:

    python --version
    python -c "import vtk; print vtk.vtkVersion.GetVTKVersion()"
    

    Best,
    Francisco

     
  • Frode Jenset

    Frode Jenset - 2018-04-03

    Dear Francisco

    Thanks for looking into this.
    Echo from the suggested commands follow :

    C:\Users\Frode>python --version
    Python 2.7.6
    C:\Users\Frode>python -c "import vtk; print vtk.vtkVersion.GetVTKVersion()"
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ImportError: No module named vtk
    C:\Users\Frode>

    First Python version I tried was 2.7.9, same result. My system is persistently telling me there is actually no module named vtk, seems it is actually not included in Python 2.7.6 or 2.7.9. I use a Win10 64 bit system. There are Python folders both on Program files (x86) level and on C: top level. MaxFem folder is on Program files (x86) level. Should I be looking for a vtk.exe file or similar?

     
    • Fran Pena

      Fran Pena - 2018-04-04

      Dear Frode,

      It seems that you have installed Python(x,y) without the "Full" option, as it is recommended in the MaxFEM download page, so the VTK package was not installed.

      Please, reinstall Python(x,y) selecting the "Full" option. You do not have to reinstall MaxFEM.

       
  • Frode Jenset

    Frode Jenset - 2018-04-05

    Dear Francisco

    Thanks a lot, this did solve the problem. I do not get a "full" option however, but I need to expand and click on each package in turn. And since MaxFem relies fully on Python for all text, the links to help page and installation tips are actually not available before Python is again installed.

     
  • vijayachandrika thulasi

    Hi,
    Recently i installed MaxFem and tried to run the module. Upto mesh selection it is not showing any error. But when i try to select properties , it is showing some module is missing. I tired checking the location for that module. That module is available. But still some error is shown which is not allowing me to run the code. Can you please tell the solution.
    Please find the attachment.

     
    • Fran Pena

      Fran Pena - 2021-01-13

      Dear Mr. Thulasi,

      The subject of your mail suggests that the error is "ImportError: No module
      named vtk" but the attached image shows that the error is
      "ModuleNotFoundError: not module named 'auxSave' ". In the first case, the
      problem is that the Python module vtk was not installed. In the latter, the
      problem is that the relative path is not working properly in your Python
      installation. Please, execute MaxFEM.py in a Command Window (CMD) and copy
      the whole output in order to give you a better answer.

      Best regards,
      Francisco Pena

      El mié, 13 ene 2021 a las 8:21, vijayachandrika thulasi ( vijayachandrika@users.sourceforge.net) escribió:

      Hi,
      Recently i installed MaxFem and tried to run the module. Upto mesh
      selection it is not showing any error. But when i try to select properties
      , it is showing some module is missing. I tired checking the location for
      that module. That module is available. But still some error is shown which
      is not allowing me to run the code. Can you please tell the solution.
      Please find the attachment.

      Attachments:


      ImportError: No module named vtk
      https://sourceforge.net/p/maxfem/discussion/general/thread/af61335c/?limit=25#0c80


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/maxfem/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --

      Francisco José Pena Brage
      Departamento de Matemática Aplicada
      Facultade de Matemáticas. Campus Vida
      15782 Santiago de Compostela - Spain
      Tel.: +34 8818 13194
      Fax: +34 8818 13197
      Email: fran(dot)pena(at)usc(dot)es
      http://www.usc.es/ingmat http://www.usc.es/ingmat
      fran.pena@usc.es

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.