Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation problems #18

Closed
dougwyu opened this issue Apr 3, 2020 · 15 comments
Closed

installation problems #18

dougwyu opened this issue Apr 3, 2020 · 15 comments

Comments

@dougwyu
Copy link
Collaborator

dougwyu commented Apr 3, 2020

I'm having trouble installing on macOS, which is weird because i previously installed without problem (and then it stopped working). I removed both conda env folders (r-sjSDM and sjSDM_env) before installing, and i only have miniconda2.

conda create --name sjSDM_env python=3.7`
conda activate sjSDM_env`
conda install pytorch torchvision cpuonly -c pytorch # cpu
devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", subdir = "sjSDM", build_vignettes = TRUE, build_manual = TRUE)

library(sjSDM)
install_sjSDM(version = "cpu", conda_python_version = "3.7") 

I get this error:

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

All requested packages already installed.

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  • torchvision
  • torch

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Installation failed... Try to install manually PyTorch (install instructions: https://github.com/TheoreticalEcology/s-jSDM
If the installation still fails, please report the following error on https://github.com/TheoreticalEcology/s-jSDM/issues
one or more Python packages failed to install [error code 1]

@MaximilianPi
Copy link
Member

Hi Doug,
miniconda2 provides only python2 support which is not compatible with torch (they stopped supporting python2). Removing miniconda2 (and all python2 environments) and installing miniconda3 should resolve your issue: https://docs.conda.io/en/latest/miniconda.html

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 3, 2020

I am using miniconda3 (I removed miniconda2 previously).

that's why i'm confused:

$ conda info

     active environment : base
    active env location : /Users/Negorashi2011/opt/miniconda3
            shell level : 1
       user config file : /Users/Negorashi2011/.condarc
 populated config files :
          conda version : 4.8.3
    conda-build version : not installed
         python version : 3.7.6.final.0
       virtual packages : __osx=10.14.6
       base environment : /Users/Negorashi2011/opt/miniconda3  (writable)

           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/Negorashi2011/opt/miniconda3/pkgs
                          /Users/Negorashi2011/.conda/pkgs
       envs directories : /Users/Negorashi2011/opt/miniconda3/envs
                          /Users/Negorashi2011/.conda/envs
               platform : osx-64
             user-agent : conda/4.8.3 requests/2.23.0 CPython/3.7.6 Darwin/18.7.0 OSX/10.14.6
                UID:GID : 502:20
             netrc file : None
           offline mode : False

@MaximilianPi
Copy link
Member

Okay, this is weird... Can you please try to install pytorch manually in the bash:

($conda activate <env>) 
$ conda pytorch torchvision -c pytorch

I just tested the newest miniconda3 version on ubuntu and it worked. Did you install miniconda as sudo?

If this doesn't work, you could install pytorch via pip:

$pip install torch torchvision # (use the pip3 installer, see $pip --version)

My conda info

     active environment : base
    active env location : /home/max/miniconda3
            shell level : 1
       user config file : /home/max/.condarc
 populated config files :
          conda version : 4.8.3
    conda-build version : not installed
         python version : 3.7.6.final.0
       virtual packages : __glibc=2.27
       base environment : /home/max/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/max/miniconda3/pkgs
                          /home/max/.conda/pkgs
       envs directories : /home/max/miniconda3/envs
                          /home/max/.conda/envs
               platform : linux-64
             user-agent : conda/4.8.3 requests/2.22.0 CPython/3.7.6 Linux/4.4.0-17134-Microsoft ubuntu/18.04.1 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False 

@MaximilianPi
Copy link
Member

I found the issue...
~2 weeks ago the automatic MacOS Rmdcheck started to fail and I removed MacOS from the list. I just looked at it and two weeks ago there was coincidentally a new miniconda3 release.

I do not believe in coincidences and forced the automatic test system to install the old miniconda3 version and it runs.

Here the bash snippet you can use to install the old miniconda3 version and config conda to not update automatically to the newest version:

$ rm -r miniconda #remove old version
$wget https://repo.continuum.io/miniconda/Miniconda3-py37_4.8.2-MacOSX-x86_64.sh -O miniconda.sh
$bash miniconda.sh -b -p $HOME/miniconda
$export PATH="$HOME/miniconda/bin:$PATH"
$hash -r
$rm miniconda.sh
$conda config --set auto_update_conda false

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 5, 2020

okay, i have reinstalled miniconda3 now as $HOME/miniconda, and I successfully ran:

conda create --name sjSDM_env python=3.7
# conda init bash # first time
conda activate sjSDM_env
conda install pytorch torchvision cpuonly -c pytorch # cpu

then i made a mistake. i decided to reinstall s-jSDM from the beginning, but i get this error.

devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", subdir = "sjSDM")
Downloading GitHub repo TheoreticalEcology/s-jSDM@master
✓  checking for file ‘/private/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T/Rtmp3asXmA/remotes148863b0995e6/TheoreticalEcology-s-jSDM-33e5b0e/sjSDM/DESCRIPTION’ ...
─  preparing ‘sjSDM’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘sjSDM_0.0.1.9000.tar.gz’
   
* installing *source* package ‘sjSDM’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1: 84323 Killed: 9               '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T//RtmpSjFjJM/file14956694ec740'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sjSDM’
Error: Failed to install 'sjSDM' from GitHub:  
  (converted from warning) installation of package   ‘/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T//Rtmp3asXmA/file1488672504d51/sjSDM_0.0.1.9000.tar.gz’ had non-zero exit status  

@MaximilianPi
Copy link
Member

Strange, maybe it is an access error? Was RStudio still running? To get a more informative error message, you could build the package from RStudio.

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 29, 2020

I upgraded to R 4.0.0 to see if it would help, but i still cannot install sjSDM

> devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", subdir = "sjSDM")
Downloading GitHub repo TheoreticalEcology/s-jSDM@master
✓  checking for file ‘/private/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T/RtmpQUoUi3/remotesb1a76f08237c/TheoreticalEcology-s-jSDM-d4c8669/sjSDM/DESCRIPTION’ ...
─  preparing ‘sjSDM’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘sjSDM_0.0.2.9000.tar.gz’
   
* installing *source* package ‘sjSDM’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1: 45851 Killed: 9               R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T//RtmpNkfrx5/fileb3075e9bcc3c'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sjSDM’
Error: Failed to install 'sjSDM' from GitHub:
  (converted from warning) installation of package ‘/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T//RtmpQUoUi3/fileb1a77f51dad6/sjSDM_0.0.2.9000.tar.gz’ had non-zero exit status

I'm running this inside RStudio. I just reinstalled more than a hundred packages, so i don't know why sjSDM doesn't work.

@dougwyu dougwyu closed this as completed Apr 29, 2020
@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 29, 2020

i didn't mean to close the issue

@dougwyu dougwyu reopened this Apr 29, 2020
@florianhartig
Copy link
Member

Hi Max, is this now also fixed with the new update?

@MaximilianPi
Copy link
Member

Hi Doug, Florian,

is this now also fixed with the new update?

I do not think so, the pkg installation is independent of the python installation (install_sjSDM()). Maybe it is a access related problem.
@dougwyu Here is the built pkg (latest version), download the file and try to install it via:
install.packages("<path to tar.gz>/sjSDM_0.0.2.9000.tar.gz", repos=NULL)
sjSDM_0.0.2.9000.tar.gz

Let's see if this works (or at least we get a informative error message)

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 29, 2020

So weird. i got the same error

> install.packages("~/Downloads/sjSDM_0.0.2.9000.tar.gz", repos=NULL)
* installing *source* package ‘sjSDM’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1: 63326 Killed: 9               R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T//RtmpWPVsaC/filef74b283442a7'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sjSDM’
Warning in install.packages :
  installation of package ‘/Users/Negorashi2011/Downloads/sjSDM_0.0.2.9000.tar.gz’ had non-zero exit status

@MaximilianPi
Copy link
Member

Hi Doug,
it seems like the load check is the error... let's turn if off for now:
install.packages("<path to tar.gz>/sjSDM_0.0.2.9000.tar.gz", repos=NULL, INSTALL_opts = "--no-test-load")

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 29, 2020

It works!

@dougwyu dougwyu closed this as completed Apr 29, 2020
@MaximilianPi
Copy link
Member

cool! But I have to keep an eye on this weird behavior. Maybe the .onLoad function, with its reticulate queries, infers with the system (does this temporary test folder has specific security restrictions?)

@dougwyu
Copy link
Collaborator Author

dougwyu commented Apr 29, 2020

I've successfully run the vignette code.

I was able to ls into all these folders:
/var/folders/4g/4wpmdzbd7tj0cwctcd99wz680000gp/T/

(RtmpWPVsaC has been removed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants