Closed sttng closed 4 years ago
Out of curiousity - if you add the following lines before from attributeValueEditorUI import QtCore
:
import attributeValueEditorUI
print attributeValueEditorUI.__file__
What output do you see?
Filed as internal issue #USD-5847
Out of curiousity - if you add the following lines before
from attributeValueEditorUI import QtCore
:import attributeValueEditorUI print attributeValueEditorUI.__file__
What output do you see?
Thats the output (in fact no output from those lines as far as I can see):
Tors-MBP:Pixar tor$ usdview
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Library/Python/2.7/site-packages/PySide2/Qt/lib/QtQml.framework/Versions/5/QtQml being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Library/Python/2.7/site-packages/PySide2/Qt/lib/QtNetwork.framework/Versions/5/QtNetwork being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Library/Python/2.7/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Library/Python/2.7/site-packages/PySide2/Qt/lib/QtGui.framework/Versions/5/QtGui being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Library/Python/2.7/site-packages/PySide2/Qt/lib/QtWidgets.framework/Versions/5/QtWidgets being ignored in restricted program because of @executable_path
/opt/local/USD/lib/python/pxr/Usdviewq/attributeValueEditorUI.pyc
Traceback (most recent call last):
File "/opt/local/USD/bin/usdview", line 28, in <module>
import pxr.Usdviewq as Usdviewq
File "/opt/local/USD/lib/python/pxr/Usdviewq/__init__.py", line 26, in <module>
from qt import QtWidgets
File "/opt/local/USD/lib/python/pxr/Usdviewq/qt.py", line 28, in <module>
from attributeValueEditorUI import QtCore
ImportError: cannot import name QtCore
Tors-MBP:Pixar tor$
I'm hitting this same issue.
It seems that .../lib/python/pxr/Usdviewq/attributeValueEditorUI.py
(generated by uic) does not import QtCore directly into it's global scope. The imports are as below:
from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
QRect, QSize, QUrl, Qt)
from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
QRadialGradient)
from PySide2.QtWidgets import *
Perhaps imports are being generated differently by uic in newer versions of PySide2?
Using: Fedora 31 (kernel 5.4.17-200.fc31.x86_64) USD-20.02 PySide2-5.14.1
Can provide more info upon request.
I am getting the same issue here...
Hi all, thanks for the reports, we're observed this issue on our side as well and are looking into a fix. For the folks who are running into this, are you using PySide2 5.14.1? The test environment where we're hitting this is using 5.14.1, and I see @seymour88 is as well.
Yes I am using pyside2 5.14.1.
I can confirm from multiple sources that 5.13.2 is the latest that works on macOS, later than that, it's broken.
cool thank you for the information!!
I can confirm from multiple sources that 5.13.2 is the latest that works on macOS, later than that, it's broken.
They (Qt) switched from a bespoke pyside2-uic to uic (with python support) in 5.14
https://bugreports.qt.io/browse/PYSIDE-1098 https://github.com/qt/qtbase/blob/dev/src/tools/uic/python/pythonwriteimports.cpp#L41
Yeah also using PySide2 5.14.1 (https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.14.1-5.14.1-cp27-cp27m-macosx_10_13_intel.whl) here. That seems to be the culprit.
I'm hitting the same issue on macOS 10.15, but I was successfully built the usd-core on win10 with flags like this
python build_usd.py C:\USD --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem"
but I faild on macos with
python USD/build_scripts/build_usd.py /opt/local/USD
they are the same branch from GitHub......
USD-20.02 PySide2-5.14.1 macOS-10.15 catalina
I'm hitting the same issue on macOS 10.15, but I was successfully built the usd-core on win10 with flags like this
python build_usd.py C:\USD --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem"
but I faild on macos withpython USD/build_scripts/build_usd.py /opt/local/USD
they are the same branch from GitHub......USD-20.02 PySide2-5.14.1 macOS-10.15 catalina
I guess if your build fails this is a Python 2 vs Python 3 issue. Catalina comes with Python 3 standard, and USD still relies on Python 2. Anyhow the issue dicsussion here is not a issue of failed building (actually the build is successful), but an issue in running usdview - after successful build. I suggest to create a new issue and add the output of errors you receive from building.
Hi, @sttng I'm running python 2.7.16, the same running usdview error after successful build on macos
downgrade your pyside2 to 5.13.2 and rebuild the whole USD and it should work.
downgrade your pyside2 to 5.13.2 and rebuild the whole USD and it should work.
Thank you @danlee-lils, Bingo!, it's done, I pip uninstall the 5.14.1, and pip install the pyside2==5.13.2, usdview became alive and works.
We have a fix for this issue checked in internally and will be pushing out to GitHub in the next few days.
downgrade your pyside2 to 5.13.2 and rebuild the whole USD and it should work.
Works like a charm. Thank you.
Will wait for the fix as well @sunyab 👍
This is a failure in the code to detect whether PySide or PySide2 is in use that does not work for PySide2 after 5.13. Removing the test will make it unable to work with one of these. My proposed patch to qt.py:
@@ -23,9 +23,13 @@
#
# Import a UI file generated by the build to detect which version of PySide to use.
-from attributeValueEditorUI import QtCore
+try:
+ from attributeValueEditorUI import QtCore
+ pyside1 = QtCore.__name__.startswith('PySide.')
+except:
+ pyside1 = False
-if QtCore.__name__.startswith('PySide.'):
+if pyside1:
from PySide import QtGui, QtOpenGL
from PySide import QtGui as QtWidgets
@@ -53,13 +57,11 @@
if not hasattr(QtCore, 'QStringListModel'):
QtCore.QStringListModel = QtGui.QStringListModel
-elif QtCore.__name__.startswith('PySide2.'):
- from PySide2 import QtGui, QtWidgets, QtOpenGL
+else:
+ from PySide2 import QtCore, QtGui, QtWidgets, QtOpenGL
# Older versions still have QtGui.QStringListModel - this
# is apparently a bug:
# https://bugreports.qt.io/browse/PYSIDE-614
if not hasattr(QtCore, 'QStringListModel'):
QtCore.QStringListModel = QtGui.QStringListModel
-else:
- raise ImportError()
I got this error again, any solutions ??
usdview -h
Traceback (most recent call last):
File "/usr/local/USD/bin/usdview", line 28, in
not working with the pyside2 version change as well.
Description of Issue
Starting usdview will fail with ImportError:
Fix (for me)
Replacing the line below:
https://github.com/PixarAnimationStudios/USD/blob/be1a80f8cb91133ac75e1fc2a2e1832cd10d91c8/pxr/usdImaging/usdviewq/qt.py#L26
with
from PySide2 import QtCore
fixed the issue and usdview starts on macOS for me.
Steps to Reproduce
Install USD on macOS by following the instructions Test the installation by running: usdview extras/usd/tutorials/convertingLayerFormats/Sphere.usda
System Information (OS, Hardware)
macOS 10.14.6 (fresh install)
Package Versions
Not sure about the version, cloned the master branch from Github on 10th Feb 2020
Build Flags
python USD/build_scripts/build_usd.py /opt/local/USD