USDZ Tools on Apple Silicon

Hi,

On my mac (with Apple Silicon chip) I have different tools that required Python 3.9. To install Python 3.9 I use Homebrew.

I wanted to install "USDZ Tools". I downloaded USDPython-pkg from https://developer.apple.com/augmented-reality/tools/ and by unzipping it I got the file USDPython-0.65.pkg

If I try to run usdzconvert -h I get this

~ % usdzconvert -h
env: python3.7: No such file or directory

I tried replacing !/usr/local/bin/python3.7 with !/usr/bin/env python3 in all python scripts

I then tried to relaunch usdzconvert -h now I get this

% usdzconvert -h
  Error: failed to import pxr module. Please add path to USD Python bindings to your PYTHONPATH

I checked PATH and PYTHONPATH are good. I then looked in the pxr folder. Inside there are python files and dynamic libraries with the extension so.

If run the following command, for example, on _ar.so

% file /Applications/usdpython/USD/lib/python/pxr/Ar/_ar.so
/Applications/usdpython/USD/lib/python/pxr/Ar/_ar.so: Mach-O 64-bit dynamically linked shared library x86_64

This is not a dynamic library for Apple Silicon

On the Internet some say that by launching the terminal in Resetta mode it works. I tried it doesn't work for me.

Will there be a native version for Apple Silicon for USDZ Tools?

Regards

Tof

Answered by DTS Engineer in 711711022

Hi folks,

This version of USD Python tools uses Python 3.7 as indicated by the error message. You can download and install Python 3.7.9 (recommended) from https://www.python.org/downloads/release/python-379/.

Installation with brew may not be successful.

Note: After installing Python 3.7 be sure to execute "Install Certificates.command” as mentioned in the installer's instructions.

If you run brew info python it will show something akin to:

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.9/libexec/bin

So adding /usr/local/opt/python@3.9/libexec/bin to your PATH will allow for python calls to work.

Have you solved this problem? space_moon's method does not seem to work.

btw, I am trying to run usdzconvert in rosetta terminal.

I started having this problem since I upgraded the macOS to 12.3 and installed usdz tool version 0.65. Prior to that, I was able to run usdz tools within rosetta terminal.

how did you do this? "I tried replacing !/usr/local/bin/python3.7 with !/usr/bin/env python3 in all python scripts"

Hi folks,

This version of USD Python tools uses Python 3.7 as indicated by the error message. You can download and install Python 3.7.9 (recommended) from https://www.python.org/downloads/release/python-379/.

Installation with brew may not be successful.

Note: After installing Python 3.7 be sure to execute "Install Certificates.command” as mentioned in the installer's instructions.

To be exact python 3.7 installation via brew is not successful. You need to use the above installer. In addition you need to run Terminal in Rosetta as the compiled libraries are only for x86_64.

Got it working without Rosetta, I was using usdpython version 0.63 which was compiled on older Mac OS (before Monterey) and this relied on python2 which is no longer on Monterey. I tried getting python2 back but this seemed impossible. version 0.65 of usdpython worked for me instead. But I realized this may not even be necessary for my purposes since Blender now exports the .usdc binary. usdc shows the animation correctly in quickview, so should this work in a Metal implemented project? If so, what is usdpython useful for?

HI,

I have just tried the running the file commend outlined on this post... some 9 month later, December 2022

localuser@marc-macbook-pro local % file /Applications/usdpython/USD/lib/python/pxr/Ar/_ar.so

/Applications/usdpython/USD/lib/python/pxr/Ar/_ar.so: Mach-O 64-bit dynamically linked shared library x86_64

And as you can see there has been no update, good work Apple! really useful tools running under a version of python I need an Intel based Mac to run!! Whixh of of course I am not running-- I spent 2K on an M1 MBP earlier this year!!

After struggling with this for a few days what worked for me was to install exactly Python 3.7.9 (not the latest python 3.7)

I used the macos installer from here https://www.python.org/downloads/release/python-379/ and created an alias

alias python=/usr/local/bin/python3

So the official toolchain showcased https://developer.apple.com/augmented-reality/tools/ and all over RealityKit, requires x86_64 prebuilt and 3.7.9, even further backwards from shipped system /usr/bin/python3?

Apple should donate some hardware to whoever is maintaining the dependency that is preventing dogfooding on flagship hardware

I am trying to convert USDC files to USDA format then pack them into an USDZ file. USDZ Tools works perfectly for me after installing python 3.7.9.

I wish to include this convertion in my App, which is written in Swift to use the photogrammetry API. But I can not find a way to include python 3.7 x86 executable/framework in the app.

I tried PythonKit but cannot find a x86 3.7 framework to include, and I tried portable-python but the build always fails due to their build script.

Does anyone have USDZ Tools (Specifically usdzconvert and/or usdzip) alternatives that runs in Swift App's sandbox?

USDZ Tools on Apple Silicon
 
 
Q