Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTMs internally packaged Python Interpreter shadows the one in the activated anaconda env. #7

Open
lks-dev opened this issue Dec 10, 2024 · 1 comment

Comments

@lks-dev
Copy link

lks-dev commented Dec 10, 2024

Hallo,

I was not able to use the this PAF workflow, as It does not use the interpreter of the prepared anaconda env, but instead uses the internal Interpeter:

I amended the run_opensim_example.bat to verify this:

call conda activate opensim_example

where python

echo "===="

echo $Env:%PATH%
echo "===="

python "%~dp0qtm2opensim.py" --c3d_dir "%~1"

pause
exit

resulting in the following output:

C:\Program Files (x86)\Qualisys\Qualisys Track Manager>call conda activate opensim_example
C:\Program Files (x86)\Qualisys\Qualisys Track Manager\python.exe
C:\Users\user0\anaconda3\envs\opensim_example\python.exe
C:\Python312\python.exe
C:\Users\user0\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\user0\anaconda3\python.exe
"===="
$Env:C:\Users\user0\anaconda3\envs\opensim_example;C:\Users\user0\anaconda3\envs\opensim_example\Library\mingw-w64\bin;C:\Users\user0\anaconda3\envs\opensim_example\Library\usr\bin;C:\Users\user0\anaconda3\envs\opensim_example\Library\bin;C:\Users\user0\anaconda3\envs\opensim_example\Scripts;C:\Users\user0\anaconda3\envs\opensim_example\bin;C:\Program Files (x86)\Measurement Computing\DAQ;C:\Python312\Scripts;C:\Python312;C:\Windows\system32; [...] ;C:\Users\user0\anaconda3\condabin;C:\Users\user0\anaconda3;.
"===="
Traceback (most recent call last):
  File "F:\00_Dev\06_qtm_paf_examples\paf-opensim-example\Templates\qtm2opensim.py", line 3, in <module>
    import scipy.signal
ModuleNotFoundError: No module named 'scipy'

From the Env I would assume that in general the activation of the anaconda env. was successful.

Using the qtm2opensim.py from a cmd instance with activated env worked as expected, as well as the paf-python-example. <-> in this paf example the environement is the same, apart from using another conda env. which python only differs in that regard that the internal interpreter is not listed.

Any guideance on what could be the issue here is highly appreciated.


Example Version: main/tag v1.0.5
QTM Version 2023.3

@lks-dev
Copy link
Author

lks-dev commented Dec 11, 2024

I adapted the example to not use the php/initialize Template:

settings.paf:

Analyses:
  Generate .trc and .mot:
    Type: External program
    Program display name: Command Prompt
    Export session: Yes
    Export measurements: [c3d, tsv]
    Arguments: ['/C $TemplateDirectory$\run_opensim_example.bat']
    Template files: ['*.py']

run_opensim_exmaple.bat

call conda activate opensim_example

python qtm2opensim.py --c3d_dir .


exit

Which worked as expected.

Hence I was wondering what would be the benefit of using the Initialize Template / RunProcessing.php? in this specific use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant