Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad files being created on OSX after successful build #1285

Open
dtlindsey opened this issue Aug 7, 2020 · 13 comments
Open

bad files being created on OSX after successful build #1285

dtlindsey opened this issue Aug 7, 2020 · 13 comments

Comments

@dtlindsey
Copy link

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
Copy link
Contributor

sunyab commented Aug 7, 2020

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
Copy link
Member

spiffmon commented Aug 7, 2020 via email

@dtlindsey
Copy link
Author

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
Copy link

jtran56 commented Aug 8, 2020

Filed as internal issue #USD-6274

@spiffmon
Copy link
Member

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
Copy link
Contributor

sunyab commented Aug 11, 2020

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
Copy link

adlarkin commented Nov 12, 2021

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
  1. Clone the USD repo:
git clone [email protected]:PixarAnimationStudios/USD.git
  1. 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/
  1. 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
  1. 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
  1. 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:

  • using python 3.8.10 (python2 is not installed at all on my machine)
  • here's the output of running pip3 list (I have other packages/dependencies that were installed through apt):
Package     Version
----------- -------
dbus-python 1.2.16 
pip         20.0.2 
PyGObject   3.36.0 
PyOpenGL    3.1.5  
PySide2     5.15.2 
setuptools  45.2.0 
shiboken2   5.15.2 
wheel       0.34.2

@adlarkin
Copy link

adlarkin commented Nov 12, 2021

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 #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 faed18c.

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
Copy link

hradec commented Feb 22, 2022

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
Copy link

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

@brainteaser1990
Copy link

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
Copy link

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
Copy link

ShaddyDC commented Aug 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants