'How can I solve USDZConvert Pxr Import Error?

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


Solution 1:[1]

Download the previous version – usdpython 0.65 or usdpython 0.64 – from https://developer.apple.com.

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

(This link also tells you about Apple's Reality Converter app)

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.

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Wayne Ohm