How can I solve USDZConvert Pxr Import Error?

5.5k Views Asked by At

I'm running into this issue after installing USDZ tools from Apple's website. I'm a bit rusty at Python and tried installing all the underlying packages.

I set my PYTHONPATH already using export PYTHONPATH="/Users/gt/usdpython/USD/lib/python:$PYTHONPATH"

USD git:(master) ✗ usdzconvert
Traceback (most recent call last):
  File "/Users/gt/usdpython/usdzconvert/usdzconvert", line 17, in <module>
    usdUtils.printError("failed to import pxr module. Please add path to USD Python bindings to your PYTHONPATH.")
NameError: name 'usdUtils' is not defined
2

There are 2 best solutions below

13
Andy Jazz On

Download the latest version – usdpython 0.66 from https://developer.apple.com.

You need to paste these 3 lines inside .zshrc file – you can see how to create it HERE.

export PYTHONPATH="/Users/gt/usdpython/USD/lib/python:$PYTHONPATH"
export PATH="/Users/gt/usdpython/USD:$PATH"
export PATH="/Users/gt/usdpython/usdzconvert:$PATH"

P.S.

Do not use the version of usdpython_0.63 (Feb 5, 2020) because it unfortunately causes errors.

0
Wayne Ohm On

Run Rosetta Terminal fixes it. https://developer.apple.com/forums/thread/671459