⚠️ The only library that need to be built from source is pye57
for reading E57 files and only on macOS.
On other platforms it is installed from PyPI as other libraries, there is no need to build wheel manually. Guide is included only so macOS users can also benefit from better E57 reading library then PyMeshLab
which sometimes does not preserve colors, uses scalar as colors even when colors are available and there is no way to prevent that.
Guide is for macOS 12 and Blender 3.6. For Blender 4.0+ you need to install and use python 3.11 and Blender 4.0 python, but steps are identical.
- install homebrew
- install correct python version (for Blender 3.6 it is python 3.10) with homebrew
$ brew install python@3.10
- install
wheel
andpybind11
packages into python
$ /usr/local/opt/python@3.10/bin/pip3.10 install wheel
$ /usr/local/opt/python@3.10/bin/pip3.10 install pybind11
- install
xerces-c
library with homebrew
$ brew install xerces-c
- check path to
xerces-c
, we will use it later
$ brew info xerces-c
-
at the time of writing:
/usr/local/Cellar/xerces-c/3.2.5
-
clone
pye57
repository
$ cd ~/Desktop
$ git clone --recursive --depth 1 --branch v0.4.5 https://github.com/davidcaron/pye57.git
$ cd pye57/
- open
setup.py
in your favorite source code editor.. - after line
libE57_cpp = sorted(map(str, (HERE / "libE57Format" / "src").glob("*.cpp")))
add following line:
libE57_cpp = [os.path.relpath(p, start=HERE, ) for p in libE57_cpp]
- after line
package_data.append("xerces-c_3_2.dll")
add following lines so it creates another platform related block between windows and linux (some basic python skills are needed to understand, sorry) and use path toxerces-c
we checked earlier
elif platform.system() == "Darwin":
libraries.append("xerces-c")
library_dirs.append("/usr/local/Cellar/xerces-c/3.2.5/lib")
include_dirs.append("/usr/local/Cellar/xerces-c/3.2.5/include")
- save and close
- build wheel
$ /usr/local/opt/python@3.10/bin/python3.10 setup.py bdist_wheel
-
if there is error:
Error: setup script specifies an absolute path
, delete~/Desktop/pye57/src/pye57.egg-info
directory and run again, that directory will be recreated -
install wheel with Blender python
-
ensure pip is present Blender python (not a copy-paste command, adjust path to Blender.app)
$ /Applications/Blender/blender-3.6.4.app/Contents/Resources/3.6/python/bin/python3.10 -m ensurepip
- macOS 11+ versioning is not that easy.. lets it turn off for a session, otherwise pip will fail with
ERROR: pye57-0.4.5-cp310-cp310-macosx_12_0_x86_64.whl is not a supported wheel on this platform.
$ export SYSTEM_VERSION_COMPAT=0
- use pip from Blender python to install just built wheel into user site-packages (
~/.local/lib/python3.10/site-packages
) (not a copy-paste command, adjust path to Blender.app and wheel filename)
$ /Applications/Blender/blender-3.6.4.app/Contents/Resources/3.6/python/bin/python3.10 -m pip install --user ~/Desktop/pye57/dist/pye57-0.4.5-cp310-cp310-macosx_12_0_x86_64.whl
- library files will be installed to
~/.local/lib/python3.10/site-packages
- start Blender and check if e57 file are being loaded
- now you can archive or delete
~/Desktop/pye57