KrishnaswamyLab / phateR

PHATE dimensionality reduction method implemented in R
GNU General Public License v2.0
77 stars 9 forks source link

install issue #34

Closed xnaer closed 5 years ago

xnaer commented 5 years ago

Hi I tried to install phateR in ubuntu and got these errors below. Could anyone help pls?

install.packages("phateR") Installing package into ‘/home/xnaer/R/x86_64-pc-linux-gnu-library/3.5’ (as ‘lib’ is unspecified) trying URL 'https://cloud.r-project.org/src/contrib/phateR_0.4.1.tar.gz' Content type 'application/x-gzip' length 3701293 bytes (3.5 MB)

downloaded 3.5 MB

The downloaded source packages are in ‘/tmp/Rtmp7UziWO/downloaded_packages’

library(phateR) Loading required package: Matrix Error in py_module_import(module, convert = convert) : ImportError: libmkl_rt.so: cannot open shared object file: No such file or directory

Detailed traceback: File "/home/xnaer/.local/lib/python3.6/site-packages/phate-0.4.3-py3.6.egg/phate/init.py", line 3, in from .phate import PHATE File "/home/xnaer/.local/lib/python3.6/site-packages/phate-0.4.3-py3.6.egg/phate/phate.py", line 10, in import graphtools File "/home/xnaer/.local/lib/python3.6/site-packages/graphtools-1.1.0-py3.6.egg/graphtools/init.py", line 1, in from .api import Graph, from_igraph, read_pickle File "/home/xnaer/.local/lib/python3.6/site-packages/graphtools-1.1.0-py3.6.egg/graphtools/api.py", line 6, in import pygsp File "/home/xnaer/.local/lib/python3.6/site-packages/pygsp/init.py", line 19, in from pygsp import utils as _utils File "/home/xnaer/.local/lib/python3.6/site-packages/pygsp/utils.py", line 19, in import scipy.io File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/io/init.py", line 97, in from .matlab import loadmat, savemat, whosmat, byteordercodes File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/io/matlab/init.py", line 13, in from .mio import loadmat, savemat, whosmat File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/io/matlab/mio.py", line 12, in from .miobase import get_matfile_version, docfiller File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/io/matlab/miobase.py", line 22, in from scipy.misc import doccer File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/misc/init.py", line 68, in from scipy.interpolate._pade import pade as _pade File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/interpolate/init.py", line 175, in from .interpolate import File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/interpolate/interpolate.py", line 20, in import scipy.linalg File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/linalg/init.py", line 190, in from .misc import File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/linalg/misc.py", line 5, in from .blas import get_blas_funcs File "/home/xnaer/.local/lib/python3.6/site-packages/scipy-1.1.0-py3.6-linux-x86_64.egg/scipy/linalg/blas.py", line 214, in from scipy.linalg import _fblas

scottgigante commented 5 years ago

Hi @xnaer , looks like your installation of scipy is broken. Can you reinstall it? Run from terminal:

pip uninstall scipy
pip install scipy

If you don't have permission, instead do

pip install --user scipy

Then you can restart your R session and try again.

zpingfeng commented 5 years ago

Hi Scott, We met in WEHI years ago. Nice to see you here!

I installed phate at the terminal via pip, can import it in python, and load phateR library in R, but have problem to use phate function in R. Any suggest? Please see the message below: pip install phate Collecting phate Using cached https://files.pythonhosted.org/packages/e3/4b/84b4c37d5c42334472dd40b0ccdbb7442066131ca1b11365dd42cc5d1089/phate-0.4.4-py3-none-any.whl Requirement already satisfied: future in ./.local/lib/python3.7/site-packages (from phate) (0.17.1) Requirement already satisfied: scprep>=0.11.1 in ./.local/lib/python3.7/site-packages (from phate) (0.12.2) Requirement already satisfied: graphtools>=1.0.0 in ./.local/lib/python3.7/site-packages (from phate) (1.1.0) Requirement already satisfied: scipy>=1.1.0 in /Applications/anaconda3/lib/python3.7/site-packages (from phate) (1.1.0) Requirement already satisfied: numpy>=1.14.0 in /Applications/anaconda3/lib/python3.7/site-packages (from phate) (1.15.4) Requirement already satisfied: scikit-learn>=0.20.0 in /Applications/anaconda3/lib/python3.7/site-packages (from phate) (0.20.1) Requirement already satisfied: tasklogger>=0.4.0 in ./.local/lib/python3.7/site-packages (from phate) (0.4.2) Requirement already satisfied: decorator>=4.3.0 in /Applications/anaconda3/lib/python3.7/site-packages (from scprep>=0.11.1->phate) (4.3.0) Requirement already satisfied: pandas<0.24,>=0.19.0 in /Applications/anaconda3/lib/python3.7/site-packages (from scprep>=0.11.1->phate) (0.23.4) Requirement already satisfied: pygsp>=0.5.1 in ./.local/lib/python3.7/site-packages (from graphtools>=1.0.0->phate) (0.5.1) Requirement already satisfied: python-dateutil>=2.5.0 in /Applications/anaconda3/lib/python3.7/site-packages (from pandas<0.24,>=0.19.0->scprep>=0.11.1->phate) (2.7.5) Requirement already satisfied: pytz>=2011k in /Applications/anaconda3/lib/python3.7/site-packages (from pandas<0.24,>=0.19.0->scprep>=0.11.1->phate) (2018.7) Requirement already satisfied: six>=1.5 in /Applications/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.5.0->pandas<0.24,>=0.19.0->scprep>=0.11.1->phate) (1.11.0) Installing collected packages: phate Successfully installed phate-0.4.4

(base) JCSMR-028178ML:~ u1034711$ python Python 3.7.1 (default, Dec 14 2018, 13:28:58) [Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information.

import phate

in R

library(Matrix) library(phateR) data(tree.data) plot(prcomp(tree.data$data)$x, col=tree.data$branches) tree.phate <- phate(tree.data$data) Error in py_module_import(module, convert = convert) : ImportError: No module named phate Error: Python module phate was not found.

Detected Python configuration:

python: /Users/u1034711/.virtualenvs/r-reticulate/bin/python libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7 virtualenv: /Users/u1034711/.virtualenvs/r-reticulate/bin/activate_this.py version: 2.7.10 (default, Feb 22 2019, 21:55:15) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] numpy: /Users/u1034711/.virtualenvs/r-reticulate/lib/python2.7/site-packages/numpy numpy_version: 1.16.4 phate: [NOT FOUND]

python versions found: /Users/u1034711/.virtualenvs/r-reticulate/bin/python /usr/bin/python /usr/local/bin/python3

Restart R session:

library(Matrix) library(phateR) data(tree.data) plot(prcomp(tree.data$data)$x, col=tree.data$branches) tree.phate <- phate(tree.data$data) Error in py_module_import(module, convert = convert) : ImportError: No module named phate Error loading Python module phate ImportError: No module named phateInstall PHATE Python package with reticulate?

1: Yes 2: No

Selection: 1 Attempting to install PHATE Python package with reticulate Using virtual environment 'r-reticulate' ... DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Collecting phate Using cached https://files.pythonhosted.org/packages/1f/b7/d314c52b9492f8a1d9ed71caa88217993207e969e20f2554db145e0ee324/phate-0.4.4.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/7v/9xs_gcw13jn71d0394p0pjtczd7q59/T/pip-install-PQBU5K/phate/setup.py", line 28, in raise RuntimeError("Python version >=3.5 required.") RuntimeError: Python version >=3.5 required.

ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7v/9xs_gcw13jn71d0394p0pjtczd7q59/T/pip-install-PQBU5K/phate/ WARNING: You are using pip version 19.1.1, however version 19.2.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Error in value[3L] : Cannot locate PHATE Python package, please install through pip (e.g. pip install --user phate) and then restart R.

Thanks!

zpingfeng commented 5 years ago

Actually I have updated pip

which pip /Applications/anaconda3/bin/pip (base) JCSMR-028178ML:~ u1034711$ pip install --upgrade pip Requirement already up-to-date: pip in /Applications/anaconda3/lib/python3.7/site-packages (19.2.1)

zpingfeng commented 5 years ago

I have also tried :

library(reticulate) reticulate::py_discover_config(required_module = "phate") python: /Users/u1034711/.virtualenvs/r-reticulate/bin/python libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7 virtualenv: /Users/u1034711/.virtualenvs/r-reticulate/bin/activate_this.py version: 2.7.10 (default, Feb 22 2019, 21:55:15) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] numpy: /Users/u1034711/.virtualenvs/r-reticulate/lib/python2.7/site-packages/numpy numpy_version: 1.16.4 phate: [NOT FOUND]

python versions found: /Users/u1034711/.virtualenvs/r-reticulate/bin/python /usr/bin/python /usr/local/bin/python3

zpingfeng commented 5 years ago

I have also tried:

library(reticulate) path_to_python <- "/Applications/anaconda3/lib/python3.7" use_python(python=path_to_python) reticulate::py_discover_config(required_module = "phate") python: /Applications/anaconda3/bin/python libpython: /Applications/anaconda3/lib/libpython3.7m.dylib pythonhome: /Applications/anaconda3:/Applications/anaconda3 version: 3.7.1 (default, Dec 14 2018, 13:28:58) [Clang 4.0.1 (tags/RELEASE_401/final)] numpy: /Applications/anaconda3/lib/python3.7/site-packages/numpy numpy_version: 1.15.4 phate: /Applications/anaconda3/lib/python3.7/site-packages/phate

python versions found: /Applications/anaconda3/bin/python /Users/u1034711/.virtualenvs/r-reticulate/bin/python /usr/bin/python /usr/local/bin/python3

reticulate::import("phate") Error in py_module_import(module, convert = convert) : ImportError: No module named phate

scottgigante commented 5 years ago

Hi @zpingfeng , thanks for trying out PHATE!

You'll see from the error messages

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

and

RuntimeError: Python version >=3.5 required.

you're actually running Python 2.7 from R, not Python 3.

You can fix this by setting your environment variable RETICULATE_PYTHON=/usr/local/bin/python3.

zpingfeng commented 5 years ago

I added the following paths in the ./Renviron file and the phateR works! Thanks a lot !

RETICULATE_PYTHON=/Applications/anaconda3/bin/python PATH=/Applications/anaconda3/bin/python