简体   繁体   中英

pycafe installation on conda fails in MacBook Air Catalina

I use MacBook Air, with catalina OS . The conda version I use is 4.9.2 .

I am trying to install pycafe with conda using the following syntax in my homebrew window:

conda install -c paulscherrerinstitute pycafe

And I get the following error:

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

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

  - pycafe

Current channels:

  - https://conda.anaconda.org/paulscherrerinstitute/osx-64
  - https://conda.anaconda.org/paulscherrerinstitute/noarch
  - 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
  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch

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.

Can you please help on how to install pycafe ?

Package Unavailable for OS X

As mentioned in the comments, this particular package is only available through a user channel and they had only built it for the linux-64 platform and Python 3.5. If you're keen on avoiding having to compile this yourself (and I should note that the version build is still the latest), then I'd suggest going through Docker to build and host the environment.

Alternative: Docker Container

I put together a basic Dockerfile and YAML as a starter, but I'd expect there may be some additional configuration (eg, setting environmental variables) that is needed.

pycafe.yaml

name: pycafe
channels:
  - paulscherrerinstitute
  - conda-forge
  - defaults
dependencies:
  - python=3.5
  - pycafe
  - cafe
  - numpy

Dockerfile

ROM continuumio/miniconda3

SHELL ["/bin/bash", "--login", "-c"]

# Install PyCafe
COPY pycafe.yaml .
RUN conda env create -f pycafe.yaml -n pycafe \
  && conda config --set auto_activate_base false \
  && sed -i "s/conda activate base/conda activate pycafe/" ~/.bashrc \
  && conda clean -a -y

Placing both of these in a directory, one can build the Docker image with

docker build -t "pycafe:1.3.0" .

Then one could launch a Python session with

docker run -it pycafe:1.3.0 bash
python

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM