PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.99k stars 1.18k forks source link

bad files being created on OSX after successful build #1285

Open dtlindsey opened 4 years ago

dtlindsey commented 4 years ago

Description of Issue

USD/lib/python/pxr/Usdviewq/attributeValueEditorUI.py is not being produced as a python file when building on OSX 10.14.6 and XCode Version 11.3.1 (11C504). This is happening on both v20.05 and v20.08 versions

Steps to Reproduce

  1. python build_scripts/build_usd.py --materialx --alembic --openimageio --opencolorio --no-docs --openvdb --build-args=boost,"--with-thread --with-system --with-filesystem --with-date_time" ../install/USD

System Information (OS, Hardware)

OSX 10.14.6 macbook pro

Package Versions

v20.05 and v20.08

Build Flags

--materialx --alembic --openimageio --opencolorio --no-docs --openvdb --build-args=boost,"--with-thread --with-system --with-filesystem --with-date_time" ../install/USD

sunyab commented 4 years ago

Hi @dtlindsey, what version of PySide are you using? Also, do you see any errors in your build log or does this problem only show up when you run usdview? If you could post your build log from ../install/USD/build/USD/build_log.txt that might help us narrow things down.

spiffmon commented 4 years ago

Note also that attributeValueEditorUI.py and the entire attributeValueEditor are vestigial, not consumed by the usdview runtime at all.

--spiff

On Fri, Aug 7, 2020 at 9:50 AM Sunya Boonyatera notifications@github.com wrote:

Hi @dtlindsey https://github.com/dtlindsey, what version of PySide are you using? Also, do you see any errors in your build log or does this problem only show up when you run usdview? If you could post your build log from ../install/USD/build/USD/build_log.txt that might help us narrow things down.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/1285#issuecomment-670609745, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOU2FEASWUU4CHEH6XITTR7QWDTANCNFSM4PXKL32A .

dtlindsey commented 4 years ago

This is the error when I try to run usdview in a terminal window (I have the pythonpath and path expanded to what's needed for OSX) usdview -h Traceback (most recent call last): File "/usr/local/USD-20.05/bin/usdview", line 28, in <module> import pxr.Usdviewq as Usdviewq File "/usr/local/USD-20.05/lib/python/pxr/Usdviewq/__init__.py", line 29, in <module> from .qt import QtWidgets File "/usr/local/USD-20.05/lib/python/pxr/Usdviewq/qt.py", line 42, in <module> PySideModule = GetPySideModule() File "/usr/local/USD-20.05/lib/python/pxr/Usdviewq/qt.py", line 31, in GetPySideModule from . import attributeValueEditorUI File "/usr/local/USD-20.05/lib/python/pxr/Usdviewq/attributeValueEditorUI.py", line 1 /******************************************************************************** ^ Looking at the build log.txt, it looks like there are actually a number of errors that weren't reported when building. I'm attaching it here. log.txt

jtran56 commented 4 years ago

Filed as internal issue #USD-6274

spiffmon commented 4 years ago

Thanks, @dtlindsey . Line 1101 of your log indicates that attributeValueEditorUI.py is being generated. Does the file /usr/local/USD-20.05/lib/python/pxr/Usdviewq/attributeValueEditorUI.py not exist? If not, I wonder whats going wrong between build and install...

sunyab commented 4 years ago

Additionally, line 7111 indicates that attributeValueEditorUI.py is being installed:

-- Installing: /usr/local/USD-20.05/lib/python/pxr/Usdviewq/attributeValueEditor.py
-- Installing: /usr/local/USD-20.05/lib/python/pxr/Usdviewq/attributeValueEditor.pyc

Can you post what version of PySide you're using? Also, if you open the file indicated above there should be a line that says what version of uic was used, that would be good to know as well.

adlarkin commented 2 years ago

I am also having the same issue, but on Ubuntu 20.04.

Here are the steps I've taken:

  1. install dependencies:
    sudo apt-get install cmake build-essential python3-pip glew-utils qt5-default
    pip3 install pyside2 pyopengl
  2. Clone the USD repo:
    git clone git@github.com:PixarAnimationStudios/USD.git
  3. Create a directory for the installation, and run the build script with this installation directory:
    mkdir ../installation
    python3 USD/build_scripts/build_usd.py ../installation/
  4. The script appears to run successfully. I see the following output:
    Build script output
Building with settings:
  USD source directory          /usd_install/src/USD
  USD install directory         /usd_install/installation
  3rd-party source directory    /usd_install/installation/src
  3rd-party install directory   /usd_install/installation
  Build directory               /usd_install/installation/build
  CMake generator               Default
  CMake toolset                 Default
  Downloader                    built-in

  Building                      Shared libraries
    Variant                     Release
    Imaging                     On
      Ptex support:             Off
      OpenVDB support:          Off
      OpenImageIO support:      Off 
      OpenColorIO support:      Off 
      PRMan support:            Off
    UsdImaging                  On
      usdview:                  On
    Python support              On
      Python Debug:             Off
      Python 3:                 On
    Documentation               Off
    Tests                       Off
    Examples                    On
    Tutorials                   On
    Tools                       On
    Alembic Plugin              Off
      HDF5 support:             Off
    Draco Plugin                Off
    MaterialX Plugin            Off

  Dependencies                  boost, TBB, OpenSubdiv
STATUS: Installing boost...
STATUS: Installing TBB...
STATUS: Installing OpenSubdiv...
STATUS: Installing USD...

Success! To use USD, please ensure that you have:

    The following in your PYTHONPATH environment variable:
    /usd_install/installation/lib/python

    The following in your PATH environment variable:
    /usd_install/installation/bin

  1. I update my PATH and PYTHONPATH environment variables, as instructed. Then, I try to run an example from the USD repo:
    cd USD/extras/usd/examples/usdDancingCubesExample/
    usdview dancingCubes.usda
  2. I see the following error when I run the usdview command above:
    Traceback (most recent call last):
    File "/usd_install/installation/bin/usdview", line 28, in <module>
    import pxr.Usdviewq as Usdviewq
    File "/usd_install/installation/lib/python/pxr/Usdviewq/__init__.py", line 32, in <module>
    from .qt import QtWidgets, QtCore
    File "/usd_install/installation/lib/python/pxr/Usdviewq/qt.py", line 42, in <module>
    PySideModule = GetPySideModule()
    File "/usd_install/installation/lib/python/pxr/Usdviewq/qt.py", line 31, in GetPySideModule
    from . import attributeValueEditorUI
    File "/usd_install/installation/lib/python/pxr/Usdviewq/attributeValueEditorUI.py", line 1
    /********************************************************************************
    ^
    SyntaxError: invalid syntax
  3. Looking at the attributeValueEditorUI.py file, it actually looks like it's a C file:
    attributeValueEditorUI.py
/********************************************************************************
** Form generated from reading UI file 'attributeValueEditorUI.ui'
**
** Created by: Qt User Interface Compiler version 5.12.8
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef ATTRIBUTEVALUEEDITORUI_H
#define ATTRIBUTEVALUEEDITORUI_H

#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QStackedWidget>
#include <QtWidgets/QTextBrowser>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE

class Ui_AttributeValueEditor
{
public:
    QVBoxLayout *verticalLayout;
    QStackedWidget *stackedWidget;
    QTextBrowser *valueViewer;

    void setupUi(QWidget *AttributeValueEditor)
    {
        if (AttributeValueEditor->objectName().isEmpty())
            AttributeValueEditor->setObjectName(QString::fromUtf8("AttributeValueEditor"));
        AttributeValueEditor->resize(400, 300);
        verticalLayout = new QVBoxLayout(AttributeValueEditor);
        verticalLayout->setContentsMargins(0, 0, 0, 0);
        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
        stackedWidget = new QStackedWidget(AttributeValueEditor);
        stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
        stackedWidget->setLineWidth(0);
        valueViewer = new QTextBrowser();
        valueViewer->setObjectName(QString::fromUtf8("valueViewer"));
        stackedWidget->addWidget(valueViewer);

        verticalLayout->addWidget(stackedWidget);

        retranslateUi(AttributeValueEditor);

        stackedWidget->setCurrentIndex(0);

        QMetaObject::connectSlotsByName(AttributeValueEditor);
    } // setupUi

    void retranslateUi(QWidget *AttributeValueEditor)
    {
        AttributeValueEditor->setWindowTitle(QApplication::translate("AttributeValueEditor", "Form", nullptr));
        AttributeValueEditor->setProperty("comment", QVariant(QApplication::translate("AttributeValueEditor", "\n"
"     Copyright 2016 Pixar                                                                   \n"
"                                                                                            \n"
"     Licensed under the Apache License, Version 2.0 (the \"Apache License\")      \n"
"     with the following modification; you may not use this file except in                   \n"
"     compliance with the Apache License and the following modification to it:               \n"
"     Section 6. Trademarks. is deleted and replaced with:                                   \n"
"                                                                                            \n"
"     6. Trademarks. This License does not grant permission to use the trade                 \n"
"        names, trademarks, service marks, or product names of the Licensor                  \n"
"        and its affiliates, except as required to comply with Section 4(c) of               \n"
"        the License and to reproduce the content of the NOTI"
                        "CE file.                        \n"
"                                                                                            \n"
"     You may obtain a copy of the Apache License at                                         \n"
"                                                                                            \n"
"         http://www.apache.org/licenses/LICENSE-2.0                                         \n"
"                                                                                            \n"
"     Unless required by applicable law or agreed to in writing, software                    \n"
"     distributed under the Apache License with the above modification is                    \n"
"     distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   \n"
"     KIND, either express or implied. See the Apache License for the specific               \n"
"     language governing permissions and limitations under the Apache License.               \n"
"  ", nullptr)));
    } // retranslateUi

};

namespace Ui {
    class AttributeValueEditor: public Ui_AttributeValueEditor {};
} // namespace Ui

QT_END_NAMESPACE

#endif // ATTRIBUTEVALUEEDITORUI_H

  1. My build log seems similar to the one posted earlier in this issue (there are some warnings when building some of the code in the USD repo, though): https://gist.github.com/adlarkin/a4c965e514c2befa982606f2c6da4ecc

So, I am not sure why I have .py files that appear to be C files in my installation. Here is some other information that may be helpful:

adlarkin commented 2 years ago

As an update to my previous comment, I have tried to run the build again with Jinja2 installed (version 3.0.3), and with PySide2 set to version 5.13.2 (I thought version 5.13.2 would be worth a try based on what I read in https://github.com/PixarAnimationStudios/USD/issues/1111). I am still seeing the same issue as described above. I should also mention that I am using the release branch of USD, on commit https://github.com/PixarAnimationStudios/USD/commit/faed18ce62c8736b02413635b584a2f637156bad.

I went ahead and tried building USD on Ubuntu 18.04 with python2 (I'm using Docker containers), and everything seems to work fine. So, maybe it's an issue with python3?

(if you'd like me to ticket a new issue for this because I'm on Ubuntu 20.04 instead of MacOS, let me know!)

hradec commented 2 years ago

just to add, I'm also seeing this problem in a few python files: image

usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/mainWindowUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/adjustClippingUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/adjustDefaultMaterialUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/attributeValueEditorUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/preferencesUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/primLegendUI.py
usd/21.5.0/boost.1.66.0/lib/python/pxr/Usdviewq/propertyLegendUI.py

They all have been generated as C source instead of Python source. I'm seeing this building USD 21.5.0 on a fedora35 docker, using GCC 6.3.1 (was built from the original Redhat DTS 6.1 GCC 6.3.1 source code with all patches), python 2.7 and Qt 5.15.2 (booth where built using the same GCC 6.3.1).

Is there any workaround for this?

azhong-git commented 2 years ago

Also seeing this error ^, which prevents me from running usdview on macos

brainteaser1990 commented 2 years ago

Still have the same error in ubuntu 20.04.4 LTS

usdview HelloWorld.usda Traceback (most recent call last): File "/usr/local/USD/bin/usdview", line 28, in import pxr.Usdviewq as Usdviewq File "/usr/local/USD/lib/python/pxr/Usdviewq/init.py", line 32, in from .qt import QtWidgets, QtCore File "/usr/local/USD/lib/python/pxr/Usdviewq/qt.py", line 42, in PySideModule = GetPySideModule() File "/usr/local/USD/lib/python/pxr/Usdviewq/qt.py", line 31, in GetPySideModule from . import attributeValueEditorUI File "/usr/local/USD/lib/python/pxr/Usdviewq/attributeValueEditorUI.py", line 1 /**** ^ SyntaxError: invalid syntax

jianmzhe commented 2 years ago

It is a pyside uic version issue (worked fine in uic version 5.15.2 but failed with 5.12.8). One workaround I found is to replace this line with

COMMAND "pyside2-uic"

or

COMMAND "pyside-uic"
ShaddyDC commented 1 year ago

I've run into the same issue using pyside6-uic from here. That version also requires the -g python argument. I don't know if that goes for all versions of pyside 6 or if I have an unusual binary name because of the way I compiled it, but otherwise, adding a check for pyside6-uic in this line does the trick for me.

Edit: I remember why I had that binary name. In this line in the findPySide.cmake file, it only looks for pyside6-uic, so I made a symlink that cmake would use. If I change the file to find uic instead as well, it also works without the change above.

Edit 2: Turns out my pyside tools installation was just broken. Normally, the pyside6-uic binary is effectively a call to uic -g python, which I borked by only building the pyside-tools` part of the repository with cmake directly. Given that binary is the only necessary part, it's easy to work around.