callahantiff / OMOP2OBO

OMOP2OBO: A Python Library for mapping OMOP standardized clinical terminologies to Open Biomedical Ontologies
http://tiffanycallahan.com/OMOP2OBO_Dashboard
MIT License
84 stars 12 forks source link

OSError: [WinError 193] %1 is not a valid Win32 application when running owltools on Windows #82

Open shreema26 opened 2 weeks ago

shreema26 commented 2 weeks ago

Description:

I'm encountering an error when trying to execute the owltools file after cloning the OMOP2OBO repository. The error message is as follows: OSError: [WinError 193] %1 is not a valid Win32 application

Additional Information: Operating System: Windows Python Version: 3.12.6 Error Screenshot(s):

image (1) image

The error seems to indicate that the owltools file is not recognized as a valid executable on Windows. It might be related to compatibility issues or platform-specific requirements.

If there are any suggestions on resolving this issue or if there's a compatible version of owltools for Windows, please advise.

callahantiff commented 1 day ago

Hi @shreema26 -- Sorry for the delay. The code was developed and in tested for OSX and I am not a Windows user, but I will do my best to try and help (especially since I cannot reproduce the error on my end) 🙃😄.

This stack overview post seems particularly relevant and suggests something quick you can try. Can you run the following in your Python console within the project directory?

import os.path
import subprocess

owltools_location  = './omop2obo/libs/owltools'
write_loc = 'resources/ontologies/cl'
source = 'http://purl.obolibrary.org/obo/cl.owl'

subprocess.check_call(
    [os.path.abspath(owltools_location),
     str(source),
     '-o',
     str(write_loc) + '_without_imports.owl'],
    shell=True)

This is the functionality in the method that caused the error with one difference, the addition of shell=True in the subprocess.check_call() function. This may not work but it's worth a try.