By default the reticulate package uses the python command that is in the PATH. On our Linux and Mac builders the python command found in the PATH points to Python 2. On our Windows builder it points to Python 3.
So on a non-Windows system, you need to tell reticulate to use the python3 command: library(reticulate) if (.Platform$OS.type != "windows") use_python(Sys.which("python3"), required=TRUE) Then you can import the phate module: import("phate") # Module(phate) Successfully tested on malbec2, tokay2, and celaya2. Hope this helps, H. On 12/26/19 17:49, William Chen wrote: > Thanks for looking into this and confirming! Would appreciate any > suggestions on how to correctly import the python module on malbec1. > > Best > Will > ᐧ > > On Mon, Dec 23, 2019 at 8:41 PM Pages, Herve <hpa...@fredhutch.org > <mailto:hpa...@fredhutch.org>> wrote: > > Hi William, > > I can confirm that the phate module is installed for Python 3 on > malbec1: > > biocbuild@malbec1:~$ python3 > Python 3.6.9 (default, Nov 7 2019, 10:44:02) > [GCC 8.3.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import phate > >>> phate.__version__ > '0.4.5' > > However please note that it is NOT installed for Python 2: > > biocbuild@malbec1:~$ python > Python 2.7.17 (default, Nov 7 2019, 10:07:09) > [GCC 7.4.0] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import phate > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named phate > > So make sure you invoke Python 3. > > Best, > H. > > > On 12/22/19 22:51, William Chen wrote: > > Hi all, > > > > A package I maintain on Bioconductor ('phemd') has failed R CMD > check on > > two of three of the Bioconductor builders (tokay1 and malbec1) > with the > > following error message: > > > > Error in py_module_import(module, convert = convert) : > > > > ImportError: No module named phate > > > > > > It looks like this package (or one of its dependent packages) has an > > > > unstated dependence on a standard package. All dependencies must be > > > > declared in DESCRIPTION. > > > > See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ > > > > manual. > > > > * checking whether the package can be unloaded cleanly ... WARNING > > > > ---- unloading > > > > * checking whether the namespace can be loaded with stated > dependencies ... > > WARNING > > > > Error in py_module_import(module, convert = convert) : > > > > ImportError: No module named phate > > > > > > A namespace must be able to be loaded with just the base namespace > > > > loaded: otherwise if the namespace gets loaded by a saved object, the > > > > session will be unable to start. > > > > I have been told that the 'phate' python module is unable to be > installed > > on tokay1 which uses Python2 (phate requires Python3) but that it > has been > > installed on the malbec1 builder such that the error should not > be occuring > > on that build. I have tried without avail to fix this / search for a > > solution online (including the 'Writing R Extensions' manual). Any > > recommendations on how to address this issue? > > > > Link to build: > > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__master.bioconductor.org_checkResults_3.10_bioc-2DLATEST_phemd_&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=F3I6u7a5ehHjXSCdocoJZt6QyxonF1Mr9yERW8nrkJg&s=0mydgs8zLKpjMbGeLEhBkhh8phXWfQi2pXPF431wR10&e= > > > > Thanks! > > Will > > > > ᐧ > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioc-devel@r-project.org <mailto:Bioc-devel@r-project.org> > mailing list > > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=F3I6u7a5ehHjXSCdocoJZt6QyxonF1Mr9yERW8nrkJg&s=ZoAsmfsXMbKVd97M8Gy9hqBAIKWHz07tGe4YkCtmlE8&e= > > > > -- > Hervé Pagès > > Program in Computational Biology > Division of Public Health Sciences > Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N, M1-B514 > P.O. Box 19024 > Seattle, WA 98109-1024 > > E-mail: hpa...@fredhutch.org <mailto:hpa...@fredhutch.org> > Phone: (206) 667-5791 > Fax: (206) 667-1319 > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fredhutch.org Phone: (206) 667-5791 Fax: (206) 667-1319 _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel