Fail to open .py file..

General discussion about topics related to OpenMV.
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Fail to open .py file..

Postby jiapei100 » Sun Jun 17, 2018 11:03 pm

Two issues are shown in my case:


1. Fail to open any .py file

2. Firmware Version 2.8.0 [out of date - click here to upgrade]

Image

Any suggestions ?


Thank you
Pei
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: Fail to open .py file..

Postby kwagyeman » Mon Jun 18, 2018 12:54 pm

Hi, can you provide the file?
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Fail to open .py file..

Postby jiapei100 » Mon Jun 18, 2018 1:22 pm

It's ending with .py for sure...

The file is at http://longervision.com/questions/test.py .

Actually, none .py file can be loaded, no matter what contents it has....
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: Fail to open .py file..

Postby kwagyeman » Mon Jun 18, 2018 1:37 pm

Hi, I don't have that issue on windows with v1.9.0. What OS are you on?

I can load your demo file fine.
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Fail to open .py file..

Postby jiapei100 » Mon Jun 18, 2018 3:52 pm

I'm using Ubuntu 18.04, and I built openmvide from scratch, but using the most recent Qt 5.11.0 ...
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: Fail to open .py file..

Postby kwagyeman » Mon Jun 18, 2018 5:51 pm

So... not to be curt... but, if it's not a binary released by OpenMV how can I know what the problem is? Building the IDE yourself means you have to fix the issues yourself.

Just tested opening files in the IDE and everything works on Ubuntu.

Um, you may wish to search for the error string in the code and then to try to figure out what went wrong and then fix the error. I.e. do a global search through all files for "Could not open" and "Cannot open files of type". This will find the line of code that has an error. Then you have to fix it.
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Fail to open .py file..

Postby jiapei100 » Mon Jun 18, 2018 6:38 pm

Application Ouput from within qtcreator:

Code: Select all

Debugging starts
MimeDatabase: Error loading :/qt-project.org/qmime/freedesktop.org.xml
Cannot open :/qt-project.org/qmime/freedesktop.org.xml: No such file or directory
QFSFileEngine::open: No file name specified
Gtk-Message: 15:35:04.785: GtkDialog mapped without a transient parent. This is discouraged.
static Core::EditorManager::EditorFactoryList Core::Internal::EditorManagerPrivate::findFactories(Core::Id, const QString&) unable to determine mime type of /home/gv/Programs/Python/test2.py/. Falling back to text/plain
static Core::EditorManager::EditorFactoryList Core::Internal::EditorManagerPrivate::findFactories(Core::Id, const QString&): unable to find an editor factory for the file '/home/gv/Programs/Python/test2.py', editor Id ''.

Image
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: Fail to open .py file..

Postby kwagyeman » Mon Jun 18, 2018 7:33 pm

Hi, it looks like there's an error loading the mime-type database that's built-in to the IDE...

Not sure what to do to fix this. I've never had this error before.

>> MimeDatabase: Error loading :/qt-project.org/qmime/freedesktop.org.xml
>> Cannot open :/qt-project.org/qmime/freedesktop.org.xml: No such file or directory

You need to fix why this file cannot be found. Note that the file it's looking for gets built into the executable. ":/" on the front of a path means the application is looking for a file inside of a file system provided by qt that's inside of the executable.

You may wish to check the qt-resources that include the above "freedesktop.org.xml" file and determine why it's not getting built-in.
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Fail to open .py file..

Postby jiapei100 » Tue Jun 19, 2018 6:10 pm

1) Looks like it may have something to do with qt-creator itself?
Check this page https://github.com/qt-creator/qt-creato ... ovider.cpp

Code: Select all

//        if (!fdoXmlFound) {
//            // We could instead install the file as part of installing Qt?
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
              const char freedesktopOrgXml[] = ":/qt-project.org/qmime/packages/freedesktop.org.xml";
#else
              const char freedesktopOrgXml[] = ":/qt-project.org/qmime/freedesktop.org.xml";
#endif
            allFiles.prepend(QLatin1String(freedesktopOrgXml));
//        }

2) I found my own freedesktop.org.xml at
/opt/Qt/5.11.0/Src/qtbase/src/corelib/mimetypes/mime/packages/freedesktop.org.xml
3) Are you using the NEWEST qt-creator? Looks like you are still using qt-4.8 ?

4) Is it possible to install qt-creator independently, instead of using your qt-creator?




Cheers
Pei
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: Fail to open .py file..

Postby kwagyeman » Tue Jun 19, 2018 7:48 pm

Hi, I'm using Qt 5.8 to build OpenMV IDE. This may be the issue.
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Fail to open .py file..

Postby jiapei100 » Wed Jun 20, 2018 11:29 pm

Qt Version: 5.11.0
qt-creator: https://github.com/qt-creator/qt-creator/ git of June 20, 2018

By typing ./make.py directly, I still obtain the following error messages:

Code: Select all

g++ -c -pipe -O2 -std=gnu++11 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -D'RELATIVE_PLUGIN_PATH="../lib/qtcreator/plugins"' -D'RELATIVE_LIBEXEC_PATH="../libexec/qtcreator"' -D'RELATIVE_DATA_PATH="../share/qtcreator"' -D'RELATIVE_DOC_PATH="../share/doc/qtcreator"' -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DUTILS_LIBRARY -DQTC_REL_TOOLS_PATH='"../libexec/qtcreator"' -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../../src -I....../openmv-ide/qt-creator/src -I....../openmv-ide/qt-creator/src/libs -I....../openmv-ide/qt-creator/tools -I....../openmv-ide/qt-creator/src/plugins -I/opt/Qt/Current/gcc_64/include -I/opt/Qt/Current/gcc_64/include/QtWidgets -I/opt/Qt/Current/gcc_64/include/QtGui -I/opt/Qt/Current/gcc_64/include/QtConcurrent -I/opt/Qt/Current/gcc_64/include/QtQml -I/opt/Qt/Current/gcc_64/include/QtNetwork -I/opt/Qt/Current/gcc_64/include/QtCore -I.moc/release-shared -isystem /usr/include/libdrm -I.uic -I/opt/Qt/Current/gcc_64/mkspecs/linux-g++ -o .obj/release-shared/moc_theme.o .moc/release-shared/moc_theme.cpp
.moc/release-shared/moc_tips.cpp:57:6: error: ‘QTipLabel’ has not been declared
 void QTipLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:65:38: error: ‘QTipLabel’ has not been declared
 QT_INIT_METAOBJECT const QMetaObject QTipLabel::staticMetaObject = {
                                      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:71:20: error: ‘QTipLabel’ has not been declared
 const QMetaObject *QTipLabel::metaObject() const
                    ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:71:44: error: non-member function ‘const QMetaObject* metaObject()’ cannot have cv-qualifier
 const QMetaObject *QTipLabel::metaObject() const
                                            ^~~~~
.moc/release-shared/moc_tips.cpp: In function ‘const QMetaObject* metaObject()’:
.moc/release-shared/moc_tips.cpp:73:21: error: ‘QScopedPointer<QObjectData> QObject::d_ptr’ is protected within this context
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                     ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared protected here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:73:21: error: invalid use of non-static data member ‘QObject::d_ptr’
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                     ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:73:50: error: ‘QScopedPointer<QObjectData> QObject::d_ptr’ is protected within this context
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                                                  ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared protected here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:73:50: error: invalid use of non-static data member ‘QObject::d_ptr’
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                                                  ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:76:7: error: ‘QTipLabel’ has not been declared
 void *QTipLabel::qt_metacast(const char *_clname)
       ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: In function ‘void* qt_metacast(const char*)’:
.moc/release-shared/moc_tips.cpp:80:35: error: invalid use of ‘this’ in non-member function
         return static_cast<void*>(this);
                                   ^~~~
.moc/release-shared/moc_tips.cpp:81:39: error: cannot call member function ‘virtual void* QLabel::qt_metacast(const char*)’ without object
     return QLabel::qt_metacast(_clname);
                                       ^
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:84:5: error: ‘QTipLabel’ has not been declared
 int QTipLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
     ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: In function ‘int qt_metacall(QMetaObject::Call, int, void**)’:
.moc/release-shared/moc_tips.cpp:86:42: error: cannot call member function ‘virtual int QLabel::qt_metacall(QMetaObject::Call, int, void**)’ without object
     _id = QLabel::qt_metacall(_c, _id, _a);
                                          ^
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:123:6: error: ‘WidgetTip’ has not been declared
 void WidgetTip::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: In function ‘void qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’:
.moc/release-shared/moc_tips.cpp:123:6: error: redefinition of ‘void qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’
.moc/release-shared/moc_tips.cpp:57:6: note: ‘void qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’ previously defined here
 void QTipLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:131:38: error: ‘WidgetTip’ has not been declared
 QT_INIT_METAOBJECT const QMetaObject WidgetTip::staticMetaObject = {
                                      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:131:49: error: redefinition of ‘const QMetaObject staticMetaObject’
 QT_INIT_METAOBJECT const QMetaObject WidgetTip::staticMetaObject = {
                                                 ^~~~~~~~~~~~~~~~
.moc/release-shared/moc_tips.cpp:65:38: note: ‘const QMetaObject staticMetaObject’ previously defined here
 QT_INIT_METAOBJECT const QMetaObject QTipLabel::staticMetaObject = {
                                      ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:132:8: error: ‘QTipLabel’ has not been declared
     { &QTipLabel::staticMetaObject, qt_meta_stringdata_WidgetTip.data,
        ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:137:20: error: ‘WidgetTip’ has not been declared
 const QMetaObject *WidgetTip::metaObject() const
                    ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:137:44: error: non-member function ‘const QMetaObject* metaObject()’ cannot have cv-qualifier
 const QMetaObject *WidgetTip::metaObject() const
                                            ^~~~~
.moc/release-shared/moc_tips.cpp: In function ‘const QMetaObject* metaObject()’:
.moc/release-shared/moc_tips.cpp:137:20: error: redefinition of ‘const QMetaObject* metaObject()’
 const QMetaObject *WidgetTip::metaObject() const
                    ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:71:20: note: ‘const QMetaObject* metaObject()’ previously defined here
 const QMetaObject *QTipLabel::metaObject() const
                    ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:139:21: error: ‘QScopedPointer<QObjectData> QObject::d_ptr’ is protected within this context
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                     ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared protected here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:139:21: error: invalid use of non-static data member ‘QObject::d_ptr’
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                     ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:139:50: error: ‘QScopedPointer<QObjectData> QObject::d_ptr’ is protected within this context
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                                                  ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared protected here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp:139:50: error: invalid use of non-static data member ‘QObject::d_ptr’
     return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
                                                  ^~~~~
In file included from /opt/Qt/Current/gcc_64/include/QtWidgets/qwidget.h:45:0,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qframe.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/qlabel.h:44,
                 from /opt/Qt/Current/gcc_64/include/QtWidgets/QLabel:1,
                 from .moc/release-shared/../../../../../../qt-creator/src/libs/utils/tooltip/tips.h:30,
                 from .moc/release-shared/moc_tips.cpp:9:
/opt/Qt/Current/gcc_64/include/QtCore/qobject.h:433:33: note: declared here
     QScopedPointer<QObjectData> d_ptr;
                                 ^~~~~
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:142:7: error: ‘WidgetTip’ has not been declared
 void *WidgetTip::qt_metacast(const char *_clname)
       ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: In function ‘void* qt_metacast(const char*)’:
.moc/release-shared/moc_tips.cpp:142:7: error: redefinition of ‘void* qt_metacast(const char*)’
.moc/release-shared/moc_tips.cpp:76:7: note: ‘void* qt_metacast(const char*)’ previously defined here
 void *QTipLabel::qt_metacast(const char *_clname)
       ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:146:35: error: invalid use of ‘this’ in non-member function
         return static_cast<void*>(this);
                                   ^~~~
.moc/release-shared/moc_tips.cpp:147:12: error: ‘QTipLabel’ has not been declared
     return QTipLabel::qt_metacast(_clname);
            ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: At global scope:
.moc/release-shared/moc_tips.cpp:150:5: error: ‘WidgetTip’ has not been declared
 int WidgetTip::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
     ^~~~~~~~~
.moc/release-shared/moc_tips.cpp: In function ‘int qt_metacall(QMetaObject::Call, int, void**)’:
.moc/release-shared/moc_tips.cpp:150:5: error: redefinition of ‘int qt_metacall(QMetaObject::Call, int, void**)’
.moc/release-shared/moc_tips.cpp:84:5: note: ‘int qt_metacall(QMetaObject::Call, int, void**)’ previously defined here
 int QTipLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
     ^~~~~~~~~
.moc/release-shared/moc_tips.cpp:152:11: error: ‘QTipLabel’ has not been declared
     _id = QTipLabel::qt_metacall(_c, _id, _a);
           ^~~~~~~~~
Makefile:19933: recipe for target '.obj/release-shared/moc_tips.o' failed
make[3]: *** [.obj/release-shared/moc_tips.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '....../openmv-ide/build/src/libs/utils'
Makefile:110: recipe for target 'sub-utils-make_first' failed
make[2]: *** [sub-utils-make_first] Error 2
make[2]: *** Waiting for unfinished jobs....
rm -f libQtcSsh.so.4.2.82 libQtcSsh.so libQtcSsh.so.4 libQtcSsh.so.4.2

I'll try it from scratch again...


Cheers
Pei
Welcome to Longer Vision
http://www.longervision.ca

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 4 guests