Open EarlyForGimlet opened 5 months ago
Running setpath.bat
will add the build folder to PATH
/PYTHONPATH
environment variables. Once that is done you should be able to import mitsuba
in your python shell.
Alternatively, you can ignore the setpath.bat
script and in your python file add something along the lines of
import sys
sys.path.append("your/path/to/the/release/build/folder")
import mitsuba
This is equivalent to adding the build folder to the PYTHONPATH
environment variable.
thank you for your answers, i tried your ways and finally succeeded, however the mudule"mitsuba" is highlighed with underline i still can print the following variants correctly ,which is a great progress for me i wonder to know how to solve this problem cause there is no automatic code completion which is a bit annoying what's more, when i import this mudule i found that i have to change my environment from conda env i established before into python's “oiginal environment” because it said that :
ImportError: The 'mitsuba' native modules could not be imported. You're likely trying to use Mitsuba within a Python binary (D:\ProgramFiles\Anaconda3\envs\mitsuba\python.exe) that is different from the one for which the native module was compiled (C:\Users\MSI\AppData\Local\Programs\Python\Python39\python.exe).
is there any solutions to compatible the compiled mitsuba with the conda env? thank you for your time and attention in this matter!
That snippet of code makes Python aware of the mitsuba
package at runtime. For you IDE to be able to give you auto-completion information, it also needs to add that path to its PYTHONPATH
.Maybe your IDE has an option to add paths somewhere.
When you compiled mitsuba, were you in a conda env? I think that should work.
Description
i am afraid i am not very familiar with the compiling issue, i changed my mitsuba.conf with the following :
and then i compiled it following the guide, there is only one error but doesn't seem matter, however when i use the setpath.bat nothing happened, and i can't find the mitsuba3.exe neither, i just wanna to know how to use the compiled mitsuba in python since i know that i don't need to use "pip install mitsuba" because it may cause some confusing problems according to the former Q&As, so what should i do after compiling and are my compling methods proper? thanks a lot!