I need to install a new matplotlib and basemap for my new anaconda python 3.7. I still remember the pain many years ago when I first installed these two guys using source...check my old blog!
One thing requires attention is that basemap is not working with the newest version proj4.6.X. You will get errors like (this thread):
$ conda create -n test python=3.7 pandas pillow numpy
$ conda activate test
$ conda install -c conda-forge matplotlib basemap proj4=5.0
$ python -c "from mpl_toolkits.basemap import Basemap"
After this, I have an issue about the QT backend support between matplotlib and anaconda, such as "Could not open XDG", "Could not connect to display" (see this post). So I add the following in ~/.bashrc:
export QT_QPA_PLATFORM='offscreen'
And it worked for me!
One thing requires attention is that basemap is not working with the newest version proj4.6.X. You will get errors like (this thread):
epsgf = open(os.path.join(pyproj_datadir,'epsg'))
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/miniconda3/envs/test/share/proj/epsg'
So need to specify the proj4 version!$ conda create -n test python=3.7 pandas pillow numpy
$ conda activate test
$ conda install -c conda-forge matplotlib basemap proj4=5.0
$ python -c "from mpl_toolkits.basemap import Basemap"
After this, I have an issue about the QT backend support between matplotlib and anaconda, such as "Could not open XDG", "Could not connect to display" (see this post). So I add the following in ~/.bashrc:
export QT_QPA_PLATFORM='offscreen'
And it worked for me!