Author Topic: Python loading error  (Read 55 times)

starmm11

  • Newbie
  • *
  • Posts: 8
Python loading error
« on: November 23, 2017, 09:24:36 AM »
I tried to configure python interpreter on Windows.
1) I tried to compiled python script by using ovitos. I get the following error:

C:\Users\home\Documents\Python\OvitoAnalysis>ovitos analysis.py
Error while loading OVITO submodule ovito.vis.gui: <class 'ImportError'>
Traceback (most recent call last):
  File "D:\Program Files\Ovito\plugins\python\ovito\__init__.py", line 41, in <module>
    importlib.import_module(_name)
  File "D:\Program Files\Ovito\lib\importlib\__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\Program Files\Ovito\plugins\python\ovito\vis\gui\__init__.py", line 6, in <module>
    import PyScriptGUI
ImportError: No module named 'PyScriptGUI'
ERROR: Failed to initialize Python interpreter.

2) I used Anaconda + PyCharm and added folder Ovito\plugins\python to PYTHONPATH variable.
However, when I compiled .py script with "import ovito" it outputs
Traceback (most recent call last):
  File "C:/Users/home/Documents/Python/OvitoAnalysis/analysis.py", line 1, in <module>
    from ovito.io import *
  File "D:\Program Files\Ovito\plugins\python\ovito\__init__.py", line 19, in <module>
    from .plugins.PyScript import (version, version_string, gui_mode, headless_mode, DataSet, dataset, task_manager)
ImportError: DLL load failed: The specified procedure could not be found.

What have I missed or done wrong?


Alexander Stukowski

  • Administrator
  • Full Member
  • *****
  • Posts: 221
Re: Python loading error
« Reply #1 on: November 23, 2017, 03:04:51 PM »
I tried to reproduce the error, but so far I did not succeed. I downloaded and ran the Ovito exe installer from the website, opened the Windows command prompt, put the Ovito installation folder into the PATH environment variable and finally executed "ovitos". This worked without a problem for both Ovito 2.9.0 and Ovito 3.0.0-dev62.

Please let us know which version of Ovito you did install.

Perhaps there is some sort of interference from the Anaconda installation on your system. I will try to install Anaconda on my system too to see if that makes a difference.

Note that the Ovito python modules have been compiled for the CPython interpreter that ships with the Ovito installation packages. It's likely that they are not compatible with the Anaconda Python interpreter. That's why your second approach fails.

starmm11

  • Newbie
  • *
  • Posts: 8
Re: Python loading error
« Reply #2 on: November 23, 2017, 04:23:14 PM »
The first problem has been solved. Perhaps, I did not properly install Ovito from .zip archive.
After reinstalling it I could compile the code using "ovitos".