USDPython 0.64 setting PATH as Environmental Variable

Dear community,

I downloaded the USDPython 0.64 Package for my macOS Big Sur 11 on my new Mac book pro with M1 (13inc).

After installing it the .pkg ( that is a modelio) I open the folder in my Applications folder and I double click on the usd.command.

I am on .zsh and I did .zshrc and inserted my filepath

in my case are

Code Block
export PATH=$PATH:/Users/<myusername>/Applications/usdpython/USD
export PYTHONPATH=$PYTHONPATH:/Users/<myusername>/Applications/usdpython/USD/lib/python
export PATH=$PATH:/Users/<myusername>/Applications/usdpython/usdzconvert


are these correct?

I am not sure if that Machintosh HD should be /Users/<myusername>

I keep getting the


Code Block
Error: failed to import pxr module. Please add path to USD Python bindings to your PYTHONPATH

Any help would be much appreciated

Replies

I also have this issue on my Mac mini (M1). The pxr python module is not compiled for ARM architecture and I think nothing can be done until Apple releases ARM version of the library.

Here is my debug:

Traceback (most recent call last):
File "/Users/michal/usdpython/usdzconvert/usdzconvert", line 13, in <module>
import usdUtils
File "/Users/michal/usdpython/usdzconvert/usdUtils.py", line 5, in <module>
from pxr import *
File "/Users/michal/usdpython/USD/lib/python/pxr/Tf/init.py", line 85, in <module>
from . import tf
ImportError: dlopen(/Users/michal/usdpython/USD/lib/python/pxr/Tf/
tf.so, 2): no suitable image found. Did find:
/Users/michal/usdpython/USD/lib/python/pxr/Tf/tf.so: mach-o, but wrong architecture
/Users/michal/usdpython/USD/lib/python/pxr/Tf/
tf.so: mach-o, but wrong architecture
I had the issue on M1 Mac and solved it.
  • Open Rosetta Terminal and run USD.command and usdzconvert in Applications/usdpython folder.


Locate the Terminal application within the Utilities folder (Finder > Go menu > Utilities)
Select Terminal.app and right-click on it, then choose “Duplicate”
Rename the duplicated Terminal app something obvious and distinct, like ‘Rosetta Terminal’
Now select the freshly renamed ‘Rosetta Terminal’ app and right-click and choose “Get Info” (or hit Command+i)
Check the box for “Open using Rosetta”, then close the Get Info window
Run the “Rosetta Terminal”
  • Big thank you on this. I hope these libraries will be updated or even better, how about a new 'Reality Converter' that has more features and command line options. Also anyone else tried to use "Object Capture' and cannot open it in "Reality Converter?" You can't unless you run it through Xcode first (open your USDZ file with Xcode, then click on it and then save it. Make sure not to touch any of the material textures and make a duplicate) then it will open. I do this to extract the texture files, but what I really want is to be able to bring these into to Blender or some other 3D tool. Sadly, not very many tools can import USDZ files.

  • You can also run the x86_64 version using the arch command like so: arch -x86_64 /Applications/usdpython/USD.command

Add a Comment

Copy usdpython from /Applications to ~/Developer as follows -

$ cp -R /Applications/usdpython ~/Developer/

Then add the following to your .bash_profile


export PATH=$PATH:$HOME/Developer/usdpython/USD

export PATH=$PATH:$HOME/Developer/usdpython/USD/lib/

export PATH=$PATH:$HOME/Developer/usdpython/usdzconvert

`Copy usdpython from /Applications to ~/Developer as follows -

$ cp -R /Applications/usdpython ~/Developer/ Then add the following to your .bash_profile`

This did not work.