Author Topic: Problem in executing OVITOS  (Read 1429 times)

ad

  • Newbie
  • *
  • Posts: 22
Problem in executing OVITOS
« on: October 04, 2018, 06:03:29 PM »
Recently I built a Ovito on MacOS by following instructions on the portal. It installed successfully. But while running the example scripts I was getting the following error message:

from ovito.io import *
ModuleNotFoundError: No module named 'ovito'

How to get rid out of it?

Thanks

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 121
Re: Problem in executing OVITOS
« Reply #1 on: October 04, 2018, 07:26:43 PM »
Hi,
just to confirm, you followed these instructions?
Could you tell me how you ran the example script?

-Constanze

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #2 on: October 04, 2018, 08:29:54 PM »
Yeah I did.

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #3 on: October 08, 2018, 09:09:37 PM »
I got this error while executing ovitos

executing subprocess: /usr/home/ad/ovito/Ovito.app/Contents/MacOS/./Ovito.app/Contents/MacOS/ovitos
execve failed: No such file or directory


Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 516
Re: Problem in executing OVITOS
« Reply #4 on: October 09, 2018, 12:17:36 AM »
Dear ad,

Which version of Ovito did you install? And what is your current macOS version?

-alex

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #5 on: October 09, 2018, 03:41:14 PM »
Hello,

I installed Ovito 3.0.0-dev241 and my Mac OS is 10.12.6 (Sierra).

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 121
Re: Problem in executing OVITOS
« Reply #6 on: October 09, 2018, 04:02:08 PM »
Dear ad,

I don't really understand whats going on with the path you gave us. Do you really have another set of subfolders Ovito.app/Contents/MacOS/ in your folder  /usr/home/ad/ovito/Ovito.app/Contents/MacOS/ ?
Shouldn't it rather be:
Code: [Select]
/usr/home/ad/ovito/Ovito.app/Contents/MacOS/ovitos <name-of-your-script.py>
-Constanze

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #7 on: October 09, 2018, 04:12:32 PM »
I did the same ./<path-ovitos> <path-of -script> , still have the same problem.
 It gives same

executing subprocess: /usr/home/ad/ovito/Ovito.app/Contents/MacOS/./Ovito.app/Contents/MacOS/ovitos
execve failed: No such file or directory

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 121
Re: Problem in executing OVITOS
« Reply #8 on: October 09, 2018, 05:26:45 PM »
Could you please upload your script for me, so I can try and reproduce what the problem is.
-Constanze

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #9 on: October 09, 2018, 10:51:37 PM »
I didn't think this problem is due to script. May be some installation issue.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 516
Re: Problem in executing OVITOS
« Reply #10 on: October 10, 2018, 12:26:54 AM »
Under macOS, the "ovitos" executable may not be fully functional or not even present in the Ovito.app/Contents/MacOS/ subdirectory under the build directory where you ran "cmake" and "make". Instead, you should find an executable named "ovitos.exe" in that location, which should work. The final "ovitos" executable gets created in the installation directory only when you run the "make install" step.

In any case, before you try running "ovitos", please confirm that the "ovito" graphical program is working normally and that the embedded Python interpreter operates as expected.

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #11 on: October 23, 2018, 03:53:22 AM »
Graphical program working good

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #12 on: October 23, 2018, 03:56:08 AM »
I got this error if I try to open ovitos.exe

objc[18402]: Class QMacAutoReleasePoolTracker is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x1096a83d8) and /Users/3sd/Qt/5.11.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x11264c3f8). One of the two will be used. Which one is undefined.
objc[18402]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x1096a8450) and /Users/3sd/Qt/5.11.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x11264c470). One of the two will be used. Which one is undefined.
objc[18402]: Class RunLoopModeTracker is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x1096a8478) and /Users/3sd/Qt/5.11.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x11264c498). One of the two will be used. Which one is undefined.
objc[18402]: Class QCocoaPageLayoutDelegate is implemented in both /usr/local/Cellar/qt/5.11.1/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x109b10f40) and /Users/3sd/Qt/5.11.1/clang_64/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x11168af40). One of the two will be used. Which one is undefined.
objc[18402]: Class QCocoaPrintPanelDelegate is implemented in both /usr/local/Cellar/qt/5.11.1/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x109b10f90) and /Users/3sd/Qt/5.11.1/clang_64/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (0x11168af90). One of the two will be used. Which one is undefined.
Traceback (most recent call last):
  File "/Users/3sd/ovito/Ovito.app/Contents/MacOS/../Resources/python/ovito/__init__.py", line 22, in <module>
    import ovito.vis
  File "/Users/3sd/ovito/Ovito.app/Contents/MacOS/../Resources/python/ovito/vis/__init__.py", line 36, in <module>
    import PyQt5.QtGui
ValueError: PyCapsule_GetPointer called with incorrect name
ERROR: Failed to initialize Python interpreter.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 516
Re: Problem in executing OVITOS
« Reply #13 on: October 23, 2018, 12:14:54 PM »
The first set of error messages suggest that you have two installation of the Qt libraries on your computer, one in the directory  /usr/local/opt/qt/lib/Qt*, the other in /Users/3sd/Qt/5.11.1/clang_64/lib/Qt*. Both libraries version are being pulled in during compilation of OVITO leading to a version conflict.

It's important to make sure that one and the same Qt version is being used during compilation of OVITO and during execution. You can control which Qt installation is being used during compilation by setting the CMAKE_PREFIX_PATH variable in CMake, e.g.

  cmake -DCMAKE_PREFIX_PATH=/Users/3sd/Qt/5.11.1/clang_64/ ...

The Python interface of Ovito uses the PyQt5 module, which provides the Python bindings for the Qt library functions. At runtime, the statement "import PyQt5.QtGui", which appears in the error message, will load the PyQt5 module and with it the native Qt libraries. My guess is that at this point the libraries from the second Qt installation directory get loaded, leading to a version conflict with the Qt libraries that are needed by the Ovito core, i.e. the ones from the first Qt installation that was specified at build time.

Probably the resolution to this problem is to build the PyQt5 module form source instead of using a precompiled or prepackaged version. When building the PyQt5 python module, you need to specify the path to the same Qt library installation that is also used to build Ovito. At least this is what I do to build the official binaries for Ovito for Mac. I download the PyQt5 sources, build them against the same Qt version as Ovito and install them in the Python interpreter (see here).

May I ask why intend to build Ovito/ovitos from source on macOS in the first place instead of using the prepackages binaries?

ad

  • Newbie
  • *
  • Posts: 22
Re: Problem in executing OVITOS
« Reply #14 on: October 23, 2018, 03:52:15 PM »
I want to compute the displacement (travel distance) of single type of atoms from binary alloy only in z-direction over the period of time. That's why I was thinking to build Ovito will be useful. Is it possible to do this calculation in the precompiled OVITO package? If so can you please help me?

-ad

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 121
Re: Problem in executing OVITOS
« Reply #15 on: October 23, 2018, 04:07:59 PM »
Dear ad,

in that case you don't have to build it from source. The python scripting interface comes with the OVITO package.
That means, on your Mac you can simply drag and drop the OVITO package into your Applications folder (like how you usually install programs). Then you can call ovitos like this:

Code: [Select]
/Applications/Ovito.app/Contents/MacOS/ovitos <your-script.py>
Further, you can make your life easier by adding the following line to your "~/.bash_profile" file:
Code: [Select]
export PATH=/Applications/Ovito.app/Contents/MacOS/:$PATH so you won't have to type the whole path every time.

-Constanze
« Last Edit: October 23, 2018, 04:11:01 PM by Constanze Kalcher »