conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
383 stars 423 forks source link

conda fails to install R package 'seacarb' (from CRAN) #733

Closed jamesorr closed 4 years ago

jamesorr commented 8 years ago

It's amazing that conda is now able install R packages (along with python). How nice that we can now use conda for both!

Unfortunately, I couldn't install one R package (seacarb) on CRAN , even though I was able to install another (oce) from the same CRAN archive.

Could you help solve this problem?

I've followed the procedure outlined on http://ihrke.github.io/conda.html under 'Starting up a new project'. More exactly, here is what I've done:

conda config --add channels r conda create --name Renv r source activate Renv conda skeleton cran seacarb

The first 3 commands work fine, but the final command does not. It gives the following output:

Tip: install CacheControl to cache the CRAN metadata Fetching metadata from http://cran.r-project.org/ Writing recipe for seacarb An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at:

https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.

File "/homel/orr/anaconda2/bin/conda-skeleton", line 5, in sys.exit(main()) File "/homel/orr/anaconda2/lib/python2.7/site-packages/conda_build/main_skeleton.py", line 272, in main args_func(args, p) File "/homel/orr/anaconda2/lib/python2.7/site-packages/conda_build/main_build.py", line 468, in args_func args.func(args, p) File "/homel/orr/anaconda2/lib/python2.7/site-packages/conda_build/main_skeleton.py", line 290, in execute cran.main(args, parser) File "/homel/orr/anaconda2/lib/python2.7/site-packages/conda_build/cran.py", line 581, in main f.write(clear_trailing_whitespace(CRAN_META.format(**d))) UnicodeEncodeError: 'ascii' codec can't encode characters in position 524-525: ordinal not in range(128)


As requested, here is the output of the conda info command:

$ conda info

Current conda install:

         platform : linux-64
    conda version : 3.19.0

conda-build version : 1.18.2 python version : 2.7.11.final.0 requests version : 2.9.1 root environment : /homel/orr/anaconda2 (writable) default environment : /homel/orr/anaconda2/envs/Renv envs directories : /homel/orr/anaconda2/envs package cache : /homel/orr/anaconda2/pkgs channel URLs : https://conda.anaconda.org/r/linux-64/ https://conda.anaconda.org/r/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /homel/orr/.condarc is foreign system : False

ocefpaf commented 8 years ago

That is a bug that has plagued Python and R builds for a while. I guess that this got sorted out for Python modules, but it still exists when parsing R skeletons. The workaround is to use miniconda (or anaconda) for Python 3 to build your packages.

Note that it does not matter the Python version used when running conda-build. Even if you were building Python modules you could still build Python 2 using miniconda3.

BTW I also have r-gsw and r-oce (and now r-seacarb) in the IOOS channel. It would be nice to join efforts to keep those packages up-to-date.

jameslamb commented 4 years ago

I think this issue can be safely closed. The error seems to have fixed some time in the 4 years since it was opened.

conda skeleton cran seacarb

The command for me works!

logs ``` Adding in variants from internal_defaults INFO:conda_build.variants:Adding in variants from internal_defaults Parsing input package seacarb: .. name: seacarb location: None new_location: /Users/jlamb/repos/LightGBM/r-seacarb Making/refreshing recipe for seacarb Tip: install CacheControl and lockfile (conda packages) to cache the CRAN metadata Fetching main index from https://cran.r-project.org /Users/jlamb/miniconda3/lib/python3.6/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) /Users/jlamb/miniconda3/lib/python3.6/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) Downloading source from https://cran.r-project.org/src/contrib/seacarb_3.2.13.tar.gz No hash (md5, sha1, sha256) provided for source-seacarb_3.2.13.tar.gz. Source download forced. Add hash to recipe to use source cache. WARNING:conda_build.source:No hash (md5, sha1, sha256) provided for source-seacarb_3.2.13.tar.gz. Source download forced. Add hash to recipe to use source cache. Reading package metadata from /Users/jlamb/miniconda3/conda-bld/src_cache/source-seacarb_3.2.13_364c617d7d.tar.gz Writing recipe for seacarb --dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test. INFO:conda_build.config:--dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test. ```
meta.yaml that was generated ``` {% set version = '3.2.13' %} {% set posix = 'm2-' if win else '' %} {% set native = 'm2w64-' if win else '' %} package: name: r-seacarb version: {{ version|replace("-", "_") }} source: url: - {{ cran_mirror }}/src/contrib/seacarb_{{ version }}.tar.gz - {{ cran_mirror }}/src/contrib/Archive/seacarb/seacarb_{{ version }}.tar.gz sha256: 364c617d7d166f9e10a3597fcbece9ad487e8276f8abf1bbc081f42bc097162a build: merge_build_host: True # [win] # If this is a new build for the same version, increment the build number. number: 0 # no skip # This is required to make R link correctly on Linux. rpaths: - lib/R/lib/ - lib/ requirements: build: - {{posix}}zip # [win] host: - r-base - r-gsw - r-oce run: - r-base - r-gsw - r-oce test: commands: # You can put additional test commands to be run here. - $R -e "library('seacarb')" # [not win] - "\"%R%\" -e \"library('seacarb')\"" # [win] # You can also put a file called run_test.py, run_test.sh, or run_test.bat # in the recipe that will be run at test time. # requires: # Put any additional test requirements here. about: home: https://CRAN.R-project.org/package=seacarb license: GPL-2 summary: Calculates parameters of the seawater carbonate system and assists the design of ocean acidification perturbation experiments. license_family: GPL2 license_file: - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2' # The original CRAN metadata for this package was: # Package: seacarb # Title: Seawater Carbonate Chemistry # Version: 3.2.13 # Date: 2020-04-01 # LazyData: true # Authors@R: c(person("Jean-Pierre", "Gattuso", role = c("aut", "cre", "cph"), email = "gattuso@obs-vlfr.fr"), person("Jean-Marie", "Epitalon", role = "aut", email = "Jean-Marie.Epitalon@orange.fr"), person("Heloise", "Lavigne", role = "aut", email = "lavigne@obs-vlfr.fr"), person("James", "Orr", role = "aut", email = "james.orr@lsce.ipsl.fr"), person("Bernard", "Gentili", role = "ctb"), person("Mathilde", "Hagens", role = "ctb"), person("Andreas", "Hofmann", role = "ctb"), person("Jens-Daniel", "Mueller", role = "ctb"), person("Aurelien", "Proye", role = "ctb"), person("James", "Rae", role = "ctb"), person("Karline", "Soetaert", role = "ctb") ) # Depends: R (>= 2.10), oce, gsw # Description: Calculates parameters of the seawater carbonate system and assists the design of ocean acidification perturbation experiments. # Encoding: UTF-8 # URL: https://CRAN.R-project.org/package=seacarb # License: GPL (>= 2) # Repository: CRAN # RoxygenNote: 6.1.1 # NeedsCompilation: no # Packaged: 2020-04-01 12:45:59 UTC; gattuso # Author: Jean-Pierre Gattuso [aut, cre, cph], Jean-Marie Epitalon [aut], Heloise Lavigne [aut], James Orr [aut], Bernard Gentili [ctb], Mathilde Hagens [ctb], Andreas Hofmann [ctb], Jens-Daniel Mueller [ctb], Aurelien Proye [ctb], James Rae [ctb], Karline Soetaert [ctb] # Maintainer: Jean-Pierre Gattuso # Date/Publication: 2020-04-01 13:50:02 UTC # See # https://docs.conda.io/projects/conda-build for # more information about meta.yaml ```
Environment info Python version: 3.6.10 `conda` package versions: ``` conda==4.8.3 conda-build==3.19.2 conda-package-handling==1.6.0 conda-smithy==3.6.17 ```
`conda-info` output ``` active environment : gs active env location : /Users/jlamb/miniconda3/envs/gs shell level : 1 user config file : /Users/jlamb/.condarc populated config files : /Users/jlamb/.condarc conda version : 4.8.3 conda-build version : 3.19.2 python version : 3.6.10.final.0 virtual packages : __osx=10.14.6 base environment : /Users/jlamb/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/jlamb/miniconda3/pkgs /Users/jlamb/.conda/pkgs envs directories : /Users/jlamb/miniconda3/envs /Users/jlamb/.conda/envs platform : osx-64 user-agent : conda/4.8.3 requests/2.22.0 CPython/3.6.10 Darwin/18.7.0 OSX/10.14.6 UID:GID : 501:20 netrc file : None offline mode : False ```
github-actions[bot] commented 2 years ago

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!