PixarAnimationStudios / OpenUSD

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

Windows: DLL load failed while importing _tf #2066

Closed johhnry closed 2 years ago

johhnry commented 2 years ago

Description of Issue

Steps to Reproduce

  1. Adding $USD_INSTALL_ROOT/bin and $USD_INSTALL_ROOT/lib/python folders to $PATH and $PYTHONPATH respectively
  2. Launching usdview
Traceback (most recent call last):
  File "C:\system\profiles\jhenry\Documents\USD\bin\usdview", line 28, in <module>
    import pxr.Usdviewq as Usdviewq
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Usdviewq\__init__.py", line 27, in <module>
    from pxr import Tf
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Tf\__init__.py", line 163, in <module>
    PreparePythonModule()
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Tf\__init__.py", line 88, in PreparePythonModule
    module = importlib.import_module(
  File "C:\software\Python3KBR\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing _tf: Le module spécifié est introuvable.

This is the same issue as https://github.com/PixarAnimationStudios/USD/issues/1602 but I am not using any conda environment.

Am I missing something?

Thanks!

System Information (OS, Hardware)

Package Versions

Build Flags

$ python .\build_scripts\build_usd.py --prman --prman-location "C:\Program Files\Pixar\RenderManProServer-24.4" "C:\system\profiles\jhenry\Documents\USD"
sunyab commented 2 years ago

Hi @johhnry, the command line you posted indicates you tried to install to "C:\Program Files\USD" but your error messages are pointing to a USD build in "C:\system\profiles\jhenry\Documents\USD" -- just wanted to double check you're running the right build?

In any case, try adding $USD_INSTALL_ROOT/lib to your $PATH as well, since that's where the main USD (and other dependency) DLLs live. The build script should mention this in its instructions after the build completes.

johhnry commented 2 years ago

Hi @sunyab,

Thanks for the quick answer!

Yes my bad I installed it in C:\system\profiles\jhenry\Documents\USD not in Program Files, the command I provided was an old one. (I edited the line)

It works well by adding $USD_INSTALL_ROOT/lib to $PATH but now I have a Python syntax error:

$ usdview

Traceback (most recent call last):
  File "C:\system\profiles\jhenry\Documents\USD\bin\usdview", line 28, in <module>
    import pxr.Usdviewq as Usdviewq
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Usdviewq\__init__.py", line 34, in <module>
    from .appController import AppController
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Usdviewq\appController.py", line 49, in <module>
    from .mainWindowUI import Ui_MainWindow
  File "C:\system\profiles\jhenry\Documents\USD\lib\python\pxr\Usdviewq\mainWindowUI.py", line 677
    if (self.metadataView.columnCount() < 2)
                                           ^
SyntaxError: invalid syntax

There is missing dots at this if statement:

# USD\lib\python\pxr\Usdviewq\mainWindowUI.py lines 675 - 681

self.verticalLayout_71.setContentsMargins(2, 0, 0, 5)
self.metadataView = QTableWidget(self.attributeBrowserFrame_1)
if (self.metadataView.columnCount() < 2)
  self.metadataView.setColumnCount(2)
__qtablewidgetitem = QTableWidgetItem()
self.metadataView.setHorizontalHeaderItem(0, __qtablewidgetitem)
__qtablewidgetitem1 = QTableWidgetItem()
sunyab commented 2 years ago

I believe that's a PySide2 bug: https://bugreports.qt.io/browse/PYSIDE-1169

According to the bug report, that should be fixed in 5.14.1. Could you try updating your PySide2 version to a newer version? You will need to re-run the build afterwards.

johhnry commented 2 years ago

Good catch, I updated PySide2 to version 5.15.2.1.

Now I need to build USD again, I deleted the installation directory and ran the command (is there a better way to only rebuild python related libs?):

$ python .\build_scripts\build_usd.py --prman --prman-location "C:\Program Files\Pixar\RenderManProServer-24.4" "C:\system\profiles\jhenry\Documents\USD"

Building with settings:
  USD source directory          C:\system\profiles\jhenry\Documents\git\USD
  USD install directory         C:\system\profiles\jhenry\Documents\USD
  3rd-party source directory    C:\system\profiles\jhenry\Documents\USD\src
  3rd-party install directory   C:\system\profiles\jhenry\Documents\USD
  Build directory               C:\system\profiles\jhenry\Documents\USD\build
  CMake generator               Default
  CMake toolset                 Default
  Downloader                    curl

  Building                      Shared libraries
    Variant                     Release
    Imaging                     On
      Ptex support:             Off
      OpenVDB support:          Off
      OpenImageIO support:      Off
      OpenColorIO support:      Off
      PRMan support:            On
    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                  zlib, boost, TBB, OpenSubdiv
STATUS: Installing zlib...
STATUS: Installing boost...
ERROR: Failed to extract archive boost_1_70_0.tar.gz: unrecognized archive file type

It's trying to extract a .tar.gz archive even thought I am on Windows...

This is really strange because it just worked before. I am using the VS 2019 x64 native command prompt.

Should I open another issue?

EDIT:

Found that it was a network issue (from https://github.com/PixarAnimationStudios/USD/issues/258):

<!-- USD/src/boost_1_70_0.tar.gz.bad -->

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

I'll retry later... ;)

johhnry commented 2 years ago

It worked @sunyab ! Thanks again for your time!

Solution: