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

One or more Python packages fails to install... but which? #325

Open
JThomasWatson opened this issue Sep 19, 2023 · 3 comments
Open

One or more Python packages fails to install... but which? #325

JThomasWatson opened this issue Sep 19, 2023 · 3 comments

Comments

@JThomasWatson
Copy link

Bug Report

Github issues is reserved for bug report. If you have a question, please don't use this form.
Instead, please ask your question on the Synapse Help Forum.

Operating system

Windows 10

Description of the problem

I'm trying to install the synapser R package using install.packages("synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org")), which appears to work without error. However, when I library(synapser) I get an error message that says there are Python package/s that failed to install. I've set dependencies=TRUE and separately installed the Python packages mentioned in the console output from the library command - requests, pandas, pysftp, jinja2, markupsafe - but the error persists.

Expected behavior

I expected the package to install and load successfully.

Actual behavior

Below is the complete console output from installing and attempting to library the synapser package.

> install.packages("synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org"), dependencies = TRUE)
trying URL 'http://ran.synapse.org/bin/windows/contrib/4.3/synapser_1.1.0.119.zip'
Content type 'application/zip' length 362009 bytes (353 KB)
downloaded 353 KB

package ‘synapser’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\qbk7582\AppData\Local\Temp\RtmpMJDMvF\downloaded_packages
> library(synapser)
+ "C:/Users/qbk7582/AppData/Local/r-miniconda/condabin/conda.bat" "install" "--yes" "--name" "r-reticulate" "-c" "conda-forge" "requests" "pandas" "pysftp" "jinja2" "markupsafe"
Channels:
 - conda-forge
 - bioconda
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): ...working... failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\exception_handler.py", line 16, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\cli\main.py", line 84, in main_subshell
        exit_code = do_call(args, p)
                    ^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\cli\conda_argparse.py", line 126, in do_call
        return getattr(module, func_name)(args, parser)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\notices\core.py", line 123, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\cli\main_install.py", line 22, in execute
        install(args, parser, "install")
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\cli\install.py", line 309, in install
        unlink_link_transaction = solver.solve_for_transaction(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\core\solve.py", line 153, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(
                                   ^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\core\solve.py", line 214, in solve_for_diff
        final_precs = self.solve_final_state(
                      ^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda_libmamba_solver\solver.py", line 185, in solve_final_state
        index = LibMambaIndexHelper(
                ^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda_libmamba_solver\index.py", line 125, in __init__
        self._index = self._load_channels()
                      ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda_libmamba_solver\index.py", line 248, in _load_channels
        jsons = {url: str(path) for (url, path) in executor.map(self._fetch_channel, urls)}
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda_libmamba_solver\index.py", line 248, in <dictcomp>
        jsons = {url: str(path) for (url, path) in executor.map(self._fetch_channel, urls)}
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\concurrent\futures\_base.py", line 619, in result_iterator
        yield _result_or_cancel(fs.pop())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\concurrent\futures\_base.py", line 317, in _result_or_cancel
        return fut.result(timeout)
               ^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\concurrent\futures\_base.py", line 456, in result
        return self.__get_result()
               ^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\concurrent\futures\_base.py", line 401, in __get_result
        raise self._exception
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\concurrent\futures\thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda_libmamba_solver\index.py", line 214, in _fetch_channel
        json_path, _ = subdir_data.repo_fetch.fetch_latest_path()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\gateways\repodata\__init__.py", line 769, in fetch_latest_path
        _, state = self.fetch_latest()
                   ^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\gateways\repodata\__init__.py", line 819, in fetch_latest
        cache.load_state()
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\gateways\repodata\__init__.py", line 625, in load_state
        self.load(state_only=True)
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\site-packages\conda\gateways\repodata\__init__.py", line 575, in load
        state = json.loads(state_file.read())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\json\__init__.py", line 346, in loads
        return _default_decoder.decode(s)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\json\decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\qbk7582\AppData\Local\R-MINI~1\Lib\json\decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

`$ C:\Users\qbk7582\AppData\Local\R-MINI~1\Scripts\conda-script.py install --yes --name r-reticulate -c conda-forge requests pandas pysftp jinja2 markupsafe`

  environment variables:
                 CIO_TEST=<not set>
                CONDA_EXE=C:\Users\qbk7582\AppData\Local\R-MINI~1\condabin\..\Scripts\conda.exe
               CONDA_EXES="C:\Users\qbk7582\AppData\Local\R-
                          MINI~1\condabin\..\Scripts\conda.exe"
               CONDA_ROOT=C:\Users\qbk7582\AppData\Local\R-MINI~1
                CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8
           CURL_CA_BUNDLE=C:/Users/qbk7582/AppData/Local/Programs/R/R-4.3.0/etc/curl-ca-
                          bundle.crt
                 HOMEPATH=\Users\qbk7582
               LD_PRELOAD=<not set>
          NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
                     PATH=C:\Users\qbk7582\AppData\Local\r-
                          miniconda\condabin;C:\Users\qbk7582\AppData\Local\r-
                          miniconda\Scripts;C:\Users\qbk7582\AppData\Local\r-
                          miniconda\Library\bin;C:\Users\qbk7582\AppData\Local\Programs\Python\P
                          ython311;C:\Users\qbk7582\AppData\Local\Programs\Python\Python311\Scri
                          pts;C:\rtools43\x86_64-w64-
                          mingw32.static.posix\bin;C:\rtools43\usr\bin;C:\Users\qbk7582\AppData\
                          Local\Programs\R\R-4.3.0\bin\x64;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v11.8\libnvvp;C:\Program Files\Common
                          Files\Oracle\Java\javapath_target_958656;C:\Program Files (x86)\Common
                          Files\Oracle\Java\javapath_target_22315328;C:\Windows\System32;C:\Wind
                          ows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.
                          0;C:\Windows\System32\OpenSSH;C:\Program Files
                          (x86)\Sennheiser\SoftphoneSDK;C:\Program Files\PuTTY;C:\Program
                          Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\Program
                          Files\NVIDIA Corporation\Nsight Compute 2022.3.0;C:\Program Files
                          (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\qbk7582\AppData\Local\M
                          icrosoft\WindowsApps;C:\Users\qbk7582\AppData\Local\Programs\Git\cmd;C
                          :\Users\qbk7582\AppData\Local;C:\Users\qbk7582\AppData\Local\GitHubDes
                          ktop\bin;C:\Users\qbk7582\AppData\Local\Programs\Microsoft VS
                          Code\bin;C:\Program
                          Files\RStudio\resources\app\bin\quarto\bin;C:\Program
                          Files\RStudio\resources\app\bin\postback
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\Windows
                          PowerShell\v1.0\Modules
         PYTHONIOENCODING=utf-8
       REQUESTS_CA_BUNDLE=<not set>
   RMARKDOWN_MATHJAX_PATH=C:/Program Files/RStudio/resources/app/resources/mathjax-27
        RS_RPOSTBACK_PATH=C:/Program Files/RStudio/resources/app/bin/rpostback.exe
          R_RTOOLS43_PATH=C:\rtools43/x86_64-w64-mingw32.static.posix/bin;C:\rtools43/usr/bin
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : C:\Users\qbk7582\.condarc
 populated config files : C:\Users\qbk7582\.condarc
          conda version : 23.5.2
    conda-build version : not installed
         python version : 3.11.4.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=11.8=0
                          __win=0=0
       base environment : C:\Users\qbk7582\AppData\Local\R-MINI~1  (writable)
      conda av data dir : C:\Users\qbk7582\AppData\Local\R-MINI~1\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/win-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\qbk7582\AppData\Local\R-MINI~1\pkgs
                          C:\Users\qbk7582\.conda\pkgs
                          C:\Users\qbk7582\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\qbk7582\AppData\Local\R-MINI~1\envs
                          C:\Users\qbk7582\.conda\envs
                          C:\Users\qbk7582\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.5.2 requests/2.29.0 CPython/3.11.4 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/23.5.0 libmambapy/1.4.1
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

Upload successful.
Error: package or namespace load failed for ‘synapser’:
 .onLoad failed in loadNamespace() for 'synapser', details:
  call: NULL
  error: one or more Python packages failed to install [error code 1]
@thomasyu888
Copy link
Member

thomasyu888 commented Sep 19, 2023

Hi @JThomasWatson , I will open up a ticket within synapser to track this issue.

By the looks of it, it seems like your R environment is using conda to try to install it's python dependencies when using reticulate which could be an issue. Let me dig into this more.

@JThomasWatson
Copy link
Author

Hi, @thomasyu888. I ended up using the command line to bypass the issue altogether, and was able to download the files I needed.

@thomasyu888
Copy link
Member

Hi @JThomasWatson ,

Thanks for letting us know - glad the command line client worked out for you.

We are still investigating this issue, but I will shift this to another github repo.

@thomasyu888 thomasyu888 transferred this issue from Sage-Bionetworks/synapsePythonClient Oct 14, 2023
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

2 participants