Hi CMS Helpdesk,
I’m having difficulty installing the cf-python and cf-plot packages on my local machine. I’m working through VS Code on OSX with a conda environment at python version 3.11.
When I run conda install -c conda-forge cf-python cf-plot, the install fails saying that:
PackagesNotFoundError: The following packages are not available from current channels:
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.
I have checked anaconda.org and cf-python is listed as one of the available packages through the anaconda forge channel so I’m at a loss as to why the package can’t be installed.
Can you offer any advice, please? Or point me in the direction of somebody who might be able to solve this problem?
Thanks,
Alfred
Hi Alfred,
I can’t recreate this locally, but have ideas as to what could be causing the failure for your system to recognise the package.
So I can confirm, please can you run, and share the output from, conda info
in your active environment - and since you say you are using VS Code, I believe you may have to run it from the command palette so we can see the details about the exact environment there, rather than from the terminal.
Thanks,
Sadie
Hi Sadie,
Thanks for getting back to me.
I’m not quite sure what you meant by the command palette but running conda info
for the environment that I created env_01
returned the following:
active environment : env_01
active env location : /opt/anaconda3/envs/env_01
shell level : 2
user config file : /Users/ajw1g19/.condarc
populated config files : /Users/ajw1g19/.condarc
conda version : 24.5.0
conda-build version : 24.5.1
python version : 3.12.4.final.0
solver : classic
virtual packages : __archspec=1=m1
__conda=24.5.0=0
__osx=14.5=0
__unix=0=0
base environment : /opt/anaconda3 (writable)
conda av data dir : /opt/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-arm64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/conda-forge/osx-arm64
https://conda.anaconda.org/conda-forge/noarch
package cache : /opt/anaconda3/pkgs
/Users/ajw1g19/.conda/pkgs
envs directories : /opt/anaconda3/envs
/Users/ajw1g19/.conda/envs
platform : osx-arm64
user-agent : conda/24.5.0 requests/2.32.2 CPython/3.12.4 Darwin/23.5.0 OSX/14.5 aau/0.4.4 c/. s/. e/.
UID:GID : 502:20
netrc file : None
offline mode : False
Hopefully, that helps things?
Thanks,
Alfred
Hi again Alfred,
Thanks for your response (command palette is a VS Code feature for running commands to pick up the environment VS Code uses, in short, but the terminal output is fine here since it looks like the environment you are using there anyway).
I see the issue: you are not using a compatible platform for your conda environment, since cf-python is only registered as being supported for linux-64
and osx64
, but you are using platform : osx-arm64
(see ‘Installers’ listing under Cf Python | Anaconda.org). So that it why anaconda is telling you it is not available.
So you have two options, since you can use osx-64
with ARM processors, but note libraries set with that platform will likely run slower on your system:
- You can create a whole new environment with a compatible platform of
osx-64
: conda create --platform osx-64 --name cf-compat-env
and install cf-python and cf-plot from within that after activation.
- Or you can install the cf-python library and dependencies only with that platform set using your current environment, by adding
--platform osx-64
to your original command, and then it should work: conda install -c conda-forge --platform osx-64 cf-python cf-plot udunits2
(note you might need to add udunits2
to your original install instructions as well, since cf-python requires this.
I’ll look into why we don’t specify osx-arm64
as supported, as well, since perhaps we can include that on our ‘Installers’ list so that you would have been able to install directly for your osx-arm64
-based env, but it may be due to it being much slower there.