iograft can work with Python 2.7, but it requires a new iograft environment with a custom “subcore command” that calls Conda’s Python interpreter rather than iograft’s built-in interpreter. This is how many of our other integrations work as well (i.e. Maya 2020 with Python 2.7; Blender with Python 3.10, etc).
The first step would be creating a new iograft environment to represent the Conda environment. The key items in this iograft environment would be to:
Update the Path setting to include the directory containing the Python executable your Conda environment is using.
Update the Python Path setting to include any directories that should be available in this Conda environment. At a minimum this should include the “python27” subdirectory and the “types” subdirectory from the iograft installation.
Update the Subcore Launch Command.
The last step is most likely the item that is causing the confusion of how iograft works with other Python interpreters. By default, iograft will use the built-in “iograft_subcore” executable which in fact uses iograft’s built-in Python 3 interpreter rather than the desired Python interpreter of your Conda environment in this case.
To ensure iograft uses the expected Python interpreter, you will need to use a different Subcore launch command. There is an example subcore command in the iograft GitHub repository that might get you the behavior you are looking for with Conda (if Conda’s python executable directory is added to the Path as mentioned above): iograft/bin at main · iograft/iograft · GitHub
That being said, to fully “activate” a Conda environment that is running within iograft, you will most likely need a separate subcore command that executes the full conda activate <ENV_NAME> that you would normally run when working with Conda.
I will work to put together an example with Conda in iograft, but in the meantime if you are able to build the iograft environment and share the JSON for that environment, we can make sure it all looks good. (To access the environment’s JSON within iograft, go to “Help > Open User Settings Folder” and then navigate to the “envs” subdirectory. There should be a JSON file in that directory corresponding to the environment you have built).
I managed to get a Conda environment working within iograft using the “iograftpy_subcore” that I mentioned previously (and was able to do a quick proof of concept importing multiqc).
Besides what I mentioned previously, in order to use the iograftpy_subcore, I have also cloned the “iograft” GitHub repository and added the “bin” directory from that repository to the environment’s Path.
And here was my quick test (all the test_multiqc node is doing is importing the multiqc package from the Conda environment and outputting the package location):
Ah, thanks for the report. Currently we are building iograft’s Python 2.7 bindings on Debian with ucs2 which is likely conflicting with the ucs setting of the Python 2.7 interpreter that Conda provides.
To confirm, can you run your Conda environment’s Python interpreter directly and give the output of this script:
import sys
print(sys.maxunicode)
iograft’s Ubuntu Python 2.7 bindings are currently an outlier (all 3.x Python bindings and 2.7 Python bindings on CentOS are built with ucs4), so I will do some digging and see if we should default the Ubuntu Python 2.7 bindings to ucs4 as well.
Either way, we will either make both a ucs2 AND a ucs4 bindings available, or switch over to all ucs4 bindings on Linux. This would go out in the next release of iograft.