What am I doing wrong? Do I need to install Panda into the python that Iâm calling with bash (the systemâs python)? Iâm getting this error when running freezify.py. Below are steps I took to get here. This is on a fresh Ubuntu 16.04 install.
Traceback (most recent call last):
File "freezify.py", line 1, in <module>
from direct.showutil import FreezeTool
ImportError: No module named direct.showutil
git clone GitHub - emscripten-core/emsdk: Emscripten SDK
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
sudo apt-get install nodejs
sudo apt-get install cmake
sudo apt-get install default-jre
Then to get Panda set up
cd âŚ
git clone GitHub - panda3d/panda3d: Powerful, mature open-source cross-platform game engine for Python and C++, developed by Disney and CMU
cd panda3d
sudo apt-get install build-essential pkg-config python-dev libpng-dev libjpeg-dev libtiff-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libeigen3-dev libopenal-dev libode-dev libbullet-dev nvidia-cg-toolkit libgtk2.0-dev libassimp-dev libopenexr-dev
git checkout webgl-port
python2 makepanda/makepanda.py --nothing --static
export PATH=$PATH:~/projects/panda3d/built/bin:~/projects/panda3d/built/lib
git checkout webgl-port
To prevent this
ERROR âerror: undefined symbol: popenâ see Build error when compiling for WebAssembly ¡ Issue #23005 ¡ godotengine/godot ¡ GitHub and error: undefined symbol: popen ¡ Issue #7302 ¡ emscripten-core/emscripten ¡ GitHub
Do this
In makepanda.py add " -s ERROR_ON_UNDEFINED_SYMBOLS=0 " next to " -s WARN_ON_UNDEFINED_SYMBOLS=1 " in the same strings (2 places). Replacing the old with the new didnât work for me.
python2 makepanda/makepanda.py --nothing --no-png --use-egg --use-zlib --no-freetype --use-bullet --no-openssl --use-python --use-direct --use-pview --use-gles2 --use-openal --use-vorbis --optimize 4 --outputdir embuilt --target emscripten --no-egl
cd ./editor
add " -s WASM=0 " to freezify.py and update all of the paths at the top. Find and replace paths up to /pand3d/ repository-directory which is where rdbâs zip is extracted.
EDIT:
I also kept the optimization below â-O3â. That is a capital O not zero. The memory initializer, the .mem file, would disappear after building and later generate a 404.
python2 freezify.py
Output:
Traceback (most recent call last):
File âfreezify.pyâ, line 1, in <module>
from direct.showutil import FreezeTool
ImportError: No module named direct.showutil
I added the full path to /embuilt/ to $PATH and appended it to sys.path in freezify.py, but I got this error instead
Traceback (most recent call last):
File âfreezify.pyâ, line 6, in
from direct.showutil import FreezeTool
File â/home/jcavin/projects/panda3d/embuilt/direct/showutil/FreezeTool.pyâ, line 19, in
from panda3d.core import *
ImportError: No module named core
I got past this once. I believe by installing Panda. However, if I deleted the built and embuilt folders and did âemcc --clear-cache,â Iâd end up with these errors when I re-ran the compile commands again.