External Tool using Python >3.11

support
External Tool using Python >3.11 julianu  2025-01-17 02:22
 
Hej Skyline-Team,

We just wanted to create an External Tool for Skyline, which depends on recent Python versions and some packages installed by pip. The only example I found uses Python 2.7, though.
I tried to sketch the necessary info.properties file and upon installation, Skyline shows a download window for any version I tried. But this immediately aborts and states that it could not download anything.
So, is there any recent version available, and what do I need to put into the "Command" property for this?

Thanks,
Julian
 
 
Nick Shulman responded:  2025-01-17 09:38
I think the highest Python version number you can use is 3.4.

When you have the following in the .properties file for your menu item:
Command = $(ProgramPath(Python,VERSIONNUMBER))
Skyline will download python from the URL:
http://python.org/ftp/python/VERSIONNUMBER/python-VERSIONNUMBER.msi

It looks like for version numbers above 3.4 there no longer is a .msi file there.

We are working on improving Skyline's support for external tools written in Python because virtual environments are important. I will try to find out more information about when to expect this to be available.
-- Nick
 
dshteyn responded:  2025-01-17 11:13
I am currently working on code in Skyline that functions for installing Python, downloading pip, setting up virtual environments, and installing packages inside Skyline BuildLibraryDlg. The current version I am testing is 3.9.2, but other version are possible with additional testing. Pasted below are snippets of the function that performs this task which is called SetupPythonEnvironmentForAlpha and can be found in BuildLibraryDlg.cs file in the source. Please check out the following branch for more information:

https://github.com/ProteoWizard/pwiz/commits/Skyline/work/20240816_pythoninstaller_with_virtual_env_support

Best,
-David

            var programPathContainer = new ProgramPathContainer(@"Python", @"3.9.2);
            var packages = new List<PythonPackage>()
            {
                new PythonPackage {Name = @"peptdeep", Version = null },
                new PythonPackage {Name = @"numpy", Version = @"1.26.4" }
            };
            
            pythonInstaller = new PythonInstaller(programPathContainer, packages, new TextBoxStreamWriterHelper(),
                new PythonInstallerTaskValidator(), @"alphapeptdeep");

            if (pythonInstaller.IsPythonVirtualEnvironmentReady())
            {
                return true;
            }
           
           PythonInstallerUI.InstallPythonVirtualEnvironment(this, pythonInstaller);