Installing Additional Python Packages in Sim4Life Environment
-
Hi all,
I have been working with the Sim4Life Visual Studio Code Extension. While some modules like
numpy
work perfectly, others give a "ModuleNotFoundError."I believe this is because I am running my script in the Sim4Life environment, and certain packages are not included by default.
My question is: Is there a way to install additional packages within the Sim4Life environment so I can use them in my scripts?
Any suggestions or guidance would be greatly appreciated!
-
-
yes, you can install additional packages in the Python environment that Sim4Life is running. Simply type this in a console (using e.g. "cmd.exe"):
"C:\Program Files\Sim4Life_xyz\Python\python.exe" -m pip install package_name
adjusting for Sim4Life's version number and your package_name.
You most likely won't even need to restart Sim4Life. -
-
then it means that you can find python.exe in this directory:
C:\Program Files\Sim4Life_7.2.3.12730\PythonSo you should be able to run:
"C:\Program Files\Sim4Life_7.2.3.12730\Python\python.exe" -m pip install package_name
from Windows' console (NOT the Console of Sim4Life)