PYGMT installation in base anaconda environment?

Hi everyone,
I require to use PYGMT and OBSPY parallel. So, I attempted to install PYGMT in conda base environment using the command (conda install pygmt), but every time get an installation error (Solving environment: failed with initial frozen solve. Retrying with flexible solve.)

On the other hand, if I create an environment and then install pygmt, it works perfectly. May someone suggest to me how can I install pygmt in the base environment.

I think it’s generally advised to leave the base conda environment alone and install packages in a separate conda environment - I only activate the base environment when I need to update conda itself (hopefully someone will correct me if I’m wrong!). Installing packages when you create the environment (rather than adding them later) can help conda solve the environment (conda create -n pygmt python=3.# pygmt obspy). When I installed pygmt, it helped to prioritize the conda-forge channel above the default channel.

1 Like

Can you show me your installation process?

Hi, I tested both approaches based on conda install pygmt and pip install pygmt, but both of them did not work. However, if I create a separate environment and then install pygmt that works.

I have a environments.yml file with additional packages (jupyter, matplotlib, geojson, etc.), but this creates a functional environment with GMT and PyGMT for me on my system (macOS Monterey on an M1 chip):

conda create --name gmt_conda_environment -c conda-forge -c defaults gmt pygmt

Followed by conda activate gmt_conda_environment