Could not find vizInterface when import attempted. Be sure to build BSK with vizInterface support.

521 views
Skip to first unread message

Enrique Carlos Toomey

unread,
Jul 1, 2020, 1:14:19 PM7/1/20
to Basilisk Forum
Hi, I'm new to basilisk, and, while trying to get through the installation guide and the examples, I found out I could not connect the simulation with Vizard. When I run scenarioBasicOrbitStream.py example I get the following error message:

Could not find vizInterface when import attempted.  Be sure to build BSK with vizInterface support.

I compiled BSK usign the default setting: python conanfile.py; cd dist3; make, and it worked like charm, without any error message. I even try recompiling after specifying VzInterface option: python conanfile.py --vizInterface True, but after rebuilding I still got the error message when running the simulation.

On the other hand, I downloaded VIzard from https://hanspeterschaub.info/bskFiles/Vizard_Linux.zip link, unzip it and run it as it is. The software start without problems, but I'm not producing any .bin file to load to it, neither I get a port in in which the simulation is stream to.

Some extra information: I'm running BSK from a debian9 machine, using python3.7.2 inside a virtualenv. All installation requirements specified in the linux intallation page are satisfied. If you need any extra information regarding my setup in order to better advise me on my problem, please let me know.

Enrique Carlos Toomey

unread,
Jul 1, 2020, 1:17:00 PM7/1/20
to Basilisk Forum
I add some extra info: when I run pytest, I get the following error in  test_scenarioBasicOrbitStream.py :

$ pytest
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.7.2, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /home/henry/SATELLOGIC_REPOS/OTHERS/basilisk
plugins: xdist-1.32.0, metadata-1.10.0, html-2.1.1, forked-1.2.0
collecting ... /home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/src
collected 1372 items / 1 error / 1371 selected                                                                                                                                                                   

===================================================================================================== ERRORS ======================================================================================================
___________________________________________________________________________ ERROR collecting src/tests/test_scenarioBasicOrbitStream.py ___________________________________________________________________________
ImportError while importing test module '/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/src/tests/test_scenarioBasicOrbitStream.py'.
Hint: make sure your test modules/packages have valid Python names.                                                                                                                                               
Traceback:                                                                                                                                                                                                        
src/tests/test_scenarioBasicOrbitStream.py:40: in <module>                                                                                                                                                        
    import scenarioBasicOrbitStream                                                                                                                                                                               
src/examples/scenarioBasicOrbitStream.py:87: in <module>                                                                                                                                                          
    from Basilisk.utilities import (SimulationBaseClass, macros, orbitalMotion,                                                                                                                                   
E   ImportError: cannot import name 'vizInterface' from 'Basilisk.utilities' (/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/utilities/__init__.py)                                                  
================================================================================================ warnings summary ===============================================

Hanspeter Schaub

unread,
Jul 2, 2020, 8:55:17 AM7/2/20
to Basilisk Forum
It acts like it didn't built the vizInterface module.  This requires 0mq and protobuffers to be installed.  When you run `python conanfile.py` you can see if these are being included.  To see if vizInterface modules is built, you an look at `dist3/Basilisk/simulation` where you should see the `_vizInterface.xxxx` library and associated swig'd `vizInteface.xxxx` files.

If you don't see these, vizInterface is not built for your system.  

I wouldn't start with the scenarioBasicOrbitStream.py example, this one tries to live connect to Vizard.  It should work, I just tried it.  If you want to generate the simulation .bin file, you need to ensure the `saveFile` argument is used with `enableUnityVisualization()`.  You can see this in scenarioBasicOrbit.py.  This line is commented out by default to not auto-generate a lot of files.  You can un-comment saveFile in that script and it will create a *.bin simulation file in a local _VizFiles folder.

But, first I'd check the above configuration steps to ensure you are getting the required dependencies to build vizInterface.

kun wang

unread,
Jul 2, 2020, 9:38:19 AM7/2/20
to Basilisk Forum
I have the same problem with Enrique Carlos Toomey, but I can find the "_vizInterface.pyd" and "vizInterface.py" below the folder "dist3/Basilisk/simulation"
And I use python 3.7.7 and VS 16 2017

Alanna Koser

unread,
Jul 2, 2020, 2:00:53 PM7/2/20
to Basilisk Forum
I am also having this problem, but I my install was not error-free.

I see vizInterface.* files but NOT _vizInterface.* files.


Enrique Carlos Toomey

unread,
Jul 2, 2020, 3:24:03 PM7/2/20
to Basilisk Forum
Hi Mr Schaub. Thaks for the quick answer. I do have the "vizInterface" file:

```
basilisk/dist3/Basilisk/simulation (develop)$ ls | grep "vizInterface"
vizInterface.py
vizInterfacePYTHON_wrap.cxx
_vizInterface.so
```

I remove the try...except statement form vizInterface import to get the full exception message, and this is what I got:

```
$ python scenarioBasicOrbit.py
scenarioBasicOrbit
Traceback (most recent call last):
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/simulation/vizInterface.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/venv/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/simulation/_vizInterface.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/utilities/vizSupport.py", line 42, in <module>
    from Basilisk.simulation import vizInterface
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/simulation/vizInterface.py", line 21, in <module>
    _vizInterface = swig_import_helper()
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/dist3/Basilisk/simulation/vizInterface.py", line 20, in swig_import_helper
    return importlib.import_module('_vizInterface')
  File "/home/henry/SATELLOGIC_REPOS/OTHERS/basilisk/venv/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_vizInterface'
```

So I think that there might be a problem in _vizInterface.so object.

Enrique Carlos Toomey

unread,
Jul 2, 2020, 3:39:33 PM7/2/20
to Basilisk Forum
I tryied installing 0mq and probuf using debian9 available libraries:

$sudo apt-get -y install libzmq3-dev
$sudo apt install libprotobuf10

end clean and recompile basilik, but I still got the same problem. Maybe I did not installed the correct libraries. If someone with a little more experience compiling and linking c++ libraries can give me a hint, I'd really apreciate it.

Hanspeter Schaub

unread,
Jul 2, 2020, 3:42:29 PM7/2/20
to Basilisk Forum
I was able to build a virtual machine to run Linux 19.10 and configure/install Basilisk 1.8.1.  I'm seeing the same issue as you are in that after building the BSK script cannot import vizInterface as expected.  I did hear from another Linux user running BSK 1.7.x that it worked fine there.  This might be a work around for some of you until a fix is found.

Enrique Carlos Toomey

unread,
Jul 2, 2020, 6:06:44 PM7/2/20
to Basilisk Forum
Do you have the installation instructions for version 1.7.X ? I see that there is no connanfile, and I couldn't find the installation instructions online.

kun wang

unread,
Jul 3, 2020, 8:40:54 PM7/3/20
to Basilisk Forum
I also want version 1.7.x, where can I find it?

Hanspeter Schaub

unread,
Jul 3, 2020, 10:48:51 PM7/3/20
to Basilisk Forum
To download BSK 1.7.x tagged version, look on bitbucket for the master branch.  THere you can find the tagged release and download that code.  The build system there is different and requires running CMake from the dist3 directory.  

To find the install and setup instructions, you can look in the basilisk/docs folder for the RST documentation inside source folder.  You can also build the HTML documentation.  These instructions are the same for BSK 1.8.x instructions you find on the Basilisk instruction web page.

kun wang

unread,
Jul 4, 2020, 9:11:07 AM7/4/20
to Basilisk Forum
Another problem happened. When I download Basilisk (1.7.5) and run the command:
mkdir dist3
cd dist3
cmake -G "Visual Studio 15 2017 Win64" ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_PYTHON3=ON -DUSE_ZMQ=ON -DUSE_PROTOBUFFERS=ON
cmake --build . --target ALL_BUILD --config Release

the pycharm terminal shows some errors when it build libs for vizInterface:
  error lnk2038: mismatch detected for ...  
  warning lnk4098 : defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library".
  error lnk2001:  unresolved external symbol 

so has anyone else encountered such a problem? And how can I resolve it?

kun wang

unread,
Jul 4, 2020, 11:32:49 PM7/4/20
to Basilisk Forum
I tried the 1.7.5 version on Ubuntu, and it worked well.

Hanspeter Schaub

unread,
Jul 5, 2020, 8:58:01 AM7/5/20
to Basilisk Forum
you are specifying here a Debug build type and then looking for a Release configuration?  On Windows you have to make sure you use the Visual Studio specific cmake needs. 

Alanna Koser

unread,
Jul 6, 2020, 3:57:13 PM7/6/20
to Basilisk Forum
I'm getting these same errors with both 1.7.5 and 1.8.  My commands used were slightly different.

cmake -G "Visual Studio 15 2017 Win64" ../src -DCMAKE_BUILD_TYPE=Release

Alanna Koser

unread,
Jul 6, 2020, 4:00:22 PM7/6/20
to Basilisk Forum
Same errors as Kun Wang I mean.

Alanna Koser

unread,
Jul 6, 2020, 4:03:09 PM7/6/20
to Basilisk Forum
Same errors as Kun Wang I mean.

On Saturday, July 4, 2020 at 7:11:07 AM UTC-6, kun wang wrote:

Enrique Carlos Toomey

unread,
Jul 7, 2020, 12:02:18 AM7/7/20
to Basilisk Forum
Thank you for the answer Mr Schaub. I waas able to build the documentation and install 1.7.5 version, but I still got the error message when trying to import vizInterface, even though I made sure  that  I was including the required flags for the vizInterface. I even try going to previos 1.7.X versions, like 1.7.4 but then i run into some compilation errors. Maybe the problem is with debian... thought its very similar to Ubuntu. I'm using the following gcc and cmake versions:

$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

 

kun wang

unread,
Jul 7, 2020, 12:02:29 AM7/7/20
to Basilisk Forum
I also changed the commands to keep build_type and config type same. But it doesn't work. The error happened when the program began to deal with the lib Protobuffers. So I think it maybe the version problem.
And I installed the version 1.7.5 on Ubuntu OS, the result was good.

Hanspeter Schaub

unread,
Jul 7, 2020, 10:17:05 PM7/7/20
to Basilisk Forum
We haven't tried this on Debian, not sure if the older cmake 3.7.2 is an issue?  I'm sure you can upgrade that with a 

pip3 install --upgrade cmake

But, I'm not a regular Linux user.  You are on your own here.  We have been using BSK on Linux with the prior build system just fine.

When you down-graded, did you do a clean clean build by deleting your .conan folder in the home directory?  If not, this would cause issues between the build systems.

Hanspeter Schaub

unread,
Jul 8, 2020, 10:15:41 AM7/8/20
to Basilisk Forum
I just checked with colleagues who are running BSK 1.7.x on Windows and Linux, and both are able to load and use vizInterface there.  If this is not working for you, there are other issues with your setup.  

Regrading the issues with 1.8.x on Windows and Linux with vizInterface, we have tried several things but not found the cause yet.

Samuel Low

unread,
Jul 11, 2020, 6:05:45 AM7/11/20
to Basilisk Forum
Hi everyone, I'm running Windows 10 64-bit and also getting the same error as the original user. I had compiled in the Conda terminal explicitly with the argument "--vizInterface True", and have gotten the error output in Python console "Could not find vizInterface when import attempted.  Be sure to build BSK with vizInterface support.". I have download Vizard and it seems to open up fine although I have no message files to run in Vizard anyway.

Running the conanfile.py did not work for me (it outputs empty folders under "/(bskroot)/dist3/basilisk/simulation" somehow. I built the software framework using the following two lines.

conan install . -if dist3/conan --build=missing -o clean=True -o buildProject=True -o opNav=False -o vizInterface=True

And subsequently:

conan build . -if dist3/conan

In directory "dist3/Basilisk/simulation", I see 5 related files: ['_vizInterface.pyd', 'vizInterface.exp', 'vizInterface.lib','vizInterface.py', 'vizInterfacePYTHON_wrap.cxx'], all of which have a non-zero file size so they aren't just empty files... Besides the vizInterface problem, all other libraries in scenarioBasicOrbit.py seems to be working (although there in Line 427, there is a "plt.close("all")" which I had to delete or comment it out because otherwise it just deletes whatever plots show up in my Jupyter notebook or my Spyder IDE).

I'll try the older versions of Basilisk later on, the 1.7x and see if it throws up the same errors...

Hanspeter Schaub

unread,
Jul 15, 2020, 9:30:38 PM7/15/20
to Basilisk Forum
We have found out how to correct the issue on Linux at least.  I was able to run the latest develop BSK on Ubuntu and use vizInterface as well as opNav modules.  The fix is on the branch `feature/install_instructions`.  It has to do with how conan compiles with the c++ library and tries to maintain backwards compatibility.  If you upgrade from BSK 1.7.x to 1.8.x, remember to delete the `.conan` folder in the home-directory so it resets and builds a fresh folder.

We hope this fix would resolve the issues on Windows, but no luck.  We are still working on that.  I'll push the Linux to the develop branch later tomorrow unless I encounter further issues.  We'll keep picking on the Windows issue as we have time.

Samuel Low

unread,
Jul 16, 2020, 4:07:35 AM7/16/20
to Basilisk Forum
Alright! In the mean time, the rest of BSK works well (tried thrusters and RW modelling so far), so I'll make do without the beautiful Vizard graphics for now. Thank you for your work and efforts! Kudos to you and the team and cheers :)

Hanspeter Schaub

unread,
Jul 16, 2020, 10:36:40 PM7/16/20
to Basilisk Forum
I pushed the Linux fix to the latest develop today.  The attempts to fix Windows in a similar method didn't work, but I think we are on the right track.  The `vizInterface` module gets compiled, so the compiler can see the dependencies.  However, when running BSK it is not able to load the module.  Something is not compatible here on Windows.  On Linux the dependencies used to be compiled with a different cpp library then the rest of BSK, thus they couldn't be loaded after being compiled.  We'll keep looking.

Hanspeter Schaub

unread,
Sep 1, 2020, 12:02:14 PM9/1/20
to Basilisk Forum
Quick update.  I have a new computer science helper who was able to find the Windows related issue with the latest 1.8.x developer release.  Right now conan is not setting the PATH variable to point to the proper .conan sub-folder for the vizInterface custom dependencies.  After manually setting them he was able to use the vizInterface module just fine on Windows.  We are now working on figuring out why this is not being set properly on Windows to push a fix in the near future.

Samuel Low

unread,
Sep 1, 2020, 7:17:51 PM9/1/20
to Basilisk Forum
Thanks Professor, this is great news! Looking forward to the next update :)

Hanspeter Schaub

unread,
Sep 10, 2020, 9:22:06 AM9/10/20
to Basilisk Forum
Just pushed a fix to develop branch that now makes the vizInterface module load properly on Windows.  We are still working and testing on the opNav related modules on both Windows and Linux.  I'll be pushing Basilisk 1.8.4 to the master branch later today that contains this Windows build fix for vizInterface.

Bruce Barbour

unread,
Sep 23, 2021, 2:13:45 PM9/23/21
to Basilisk Forum
Hello,


Apologies for bringing up on what was a fixed issue, but I've ran into this same exact problem on brand new Windows 10 laptop. This is my third time installing Basilisk onto a Windows machine and had no issues with vizInterface until this third installation. I have the same exact situation as Sam, where I have the vizInterface files under C:\...\basilisk\dist3\Basilisk\simulation that are non-zero file size. This is the output I'm getting when trying to import vizInterface from the simulation module:

Capture.PNG

Capture.PNG

I did pull from the latest version of Basilisk and have compiled Basilisk a few additional times it to be sure there weren't any missing files. I'm hoping if there are any possible suggestions that may fix the issue -- hopefully it's only on my end since you were able to get it to work. The rest of Basilisk works fine, though!


Best,
Bruce

Hanspeter Schaub

unread,
Sep 24, 2021, 9:32:17 AM9/24/21
to Basilisk Forum
Mm, very curious.  I'm not aware of a recently introduced issue.  Just a quick sanity check.  On the new computer you were able to install the required support libraries (protobuffer, Eigen, 0mq)?  There have been some conan related issues over the summer as they are changing the repo server back-ends.  The latest develop now requires conan 1.40.1 or better.  You might also try to delete your `.conan` folder in your home directory and have it build it new.  

When it compiles, you are certain it actually compiles the `vizInterface` module?

Reply all
Reply to author
Forward
0 new messages