error building python box

Post Reply
yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

error building python box

Post by yanli »

I am trying to use an ensemble classifier(e.g. lda+mlp) in the motor-imagery-CSP example. And I would like to use python scripting box to help me realize it, but I'v got some problem when using that box.

1. I just cannot find the python scripting box in the Scripting folder. And the scenario Python3-hello-world.xml is failed to run because the module is highlighted in color red.
1.png
1.png (27.06 KiB) Viewed 706 times
TO fix it, I tried to compile it according to the Tutorial : http://openvibe.inria.fr/tutorial-using ... -openvibe/ ,but it didn't work. When I launched the Designer, I got the following WARNING and still couldn't find the box.
2.png
2.png (83.9 KiB) Viewed 706 times

Also, I learnt about viewtopic.php?f=4&t=10195&p=16592&hilit=python#p16592 ,which seems similar to my problem. But I strictly followed the tutorial, using python3.7.8,openvibe3.0.0 and vs2013 Professional when compiling. SO the problem is still there.

What can I do to solve this problem ?

2. Or is there any other way to make an ensemble classifier in the openvibe ?

Thanks Zeya

Thomas
Posts: 68
Joined: Wed Mar 04, 2020 3:38 pm

Re: error building python box

Post by Thomas »

Hi,

It looks like you did all well. The issue might be that OpenViBE doesn't find your python installation.

Did you add the python 3 install to your Path ?

Cheers,
Thomas

yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

Re: error building python box

Post by yanli »

Hi,
Thanks for your answer!

I checked my work again and I was sure I had added the path but the problem still remained :cry: .

Then I thought it might because I had installed several python so that OpenViBE couldn’t find the right python installation.(my guess is according to lines in the tutorial ↓)
On Windows, if you ever uninstall or move Python manually (i.e. just by removing, renaming or moving the Python folder) some incorrect registry keys will be still available, and OpenViBE will find a ghost Python. This may cause the Designer to fail loading. If this case happens to you, please uninstall Python properly. You may also delete the python project DLL in the bin/ folder of OpenViBE (openvibe-plugins-python.dll) to solve the problem.

So I built a new win10 environment(using VMware) to try again.In the new environment, I only installed python3.7.8 and vs2013 Professional and downloaded the source code.However the result was desperate with the same problem and no python scripting box.
[WARNING] File [C:/openvibe-3.0.0-src/dist/extras-x64/Debug//bin/openvibe-plugins-contrib-pybox.dll] is not a plugin module (error:Ҳ
I don’t know what I can do




WHAT’S MORE, I found another problem which actually existed when I first asked——after I changed several code such as “sample frequency ”selection range in “OpenEEG-ModularEEG.ui” and rebuilt the project “openvibe-acquisition-sever.vcxproj” , I could not find any desired changes in openvibe when launching it .:cry:
Is it something wrong when I bulid openvibe from the source code?

When building, I got some error reports and this is how I solved them ↓:
C:\openvibe-3.0.0-src\sdk\unit-test-openvibe-module-xml\uoXMLWriterTest.cpp(162): error C2059: syntax error : ’<’
C:\openvibe-3.0.0-src\sdk\unit-test-openvibe-module-xml\uoXMLWriterTest.cpp(162): error C2001: newline in constant
C:\openvibe-3.0.0-src\sdk\unit-test-openvibe-module-xml\uoXMLWriterTest.cpp(164): error C2065: ’rootNode’ : undeclared identifier
Ninja: build stopped : subcommand failed.
An error occured during building process
“”
Error while building “Release SDK”

==> Solution: I changed the Japanese words into English mentioned in the error file. Similar problems also arose in uoFilesTestUTF.cpp, uoFilesTest.cpp, uoXMLReaderTest.cpp, urImportScenarioToFileTest.cpp and urImportScenarioFromFileTest.cpp files, so I changed them to English all.

Traceback (most recent call last):
File "C:\openvibe-3.0.0-src\\visual_gen\generateVS.py", line 71, in <module>
for line in f :
UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence
Error constructing the meta .sln file

==> Solution: I added encoding="UTF-8" on line 70:
with open(path_sln, 'r',encoding="UTF-8") as f:

Thanks,
Zeya

Thomas
Posts: 68
Joined: Wed Mar 04, 2020 3:38 pm

Re: error building python box

Post by Thomas »

Hi,

Thanks for your detailed answer.

It seems that your are compiling OpenViBE through visual studio.

I would recommend using the build script to compile OpenViBE. Sorry for not noticing it earlier.

Although you can generate a visual studio solution, building from VS doesn't seem to be working very well.

It should work better by compiling with the build scripts as follow:
- .\install-dependencies.cmd
- .\build.cmd

You will notice the slight change of tree structure as the script doesn't use multi-config tools.

Let us know how you get on.

Cheers,
Thomas

Thomas
Posts: 68
Joined: Wed Mar 04, 2020 3:38 pm

Re: error building python box

Post by Thomas »

Hi,

My mistake, I did a bit of testing and the problem is linked to the Debug build.

In Release, VS build or command line build are both fine.

Thanks for raising this issue, and for the investigation you have done.
I will create a ticket on our gitlab to look into it and find the best way to fix this.

Thanks,
Thomas

yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

Re: error building python box

Post by yanli »

Hi,
Thanks so much for your answer.

I really found the python scripting box in Release and looked forward to your reply about the remaing problem :D

By the way, I would like to know something about stimulation codes(http://openvibe.inria.fr/stimulation-codes/) as I tried to get desired stimulation. Are they changable or only these types ? Or is it possible to add a new stimulation code ?

Cheers,
Zeya

Thomas
Posts: 68
Joined: Wed Mar 04, 2020 3:38 pm

Re: error building python box

Post by Thomas »

Hi,

If you build OpenViBE yourself, you can modify/extend this list.

To do so you need to update the following file: sdk/toolkit/share/stimulation_list.txt. Then recompile OpenViBE and the new stimulations will appear.

Cheers,
Thomas

Post Reply