I wanted to create some map visualizations using python, and found Basemap is a library that many people recommend. However, I got into some troubles installing Basemap on mac. My favourite “pip install” strategy just didn’t work for this Basemap library.
The installation of Basemap requires some pre-requisites, while these pre-requisites require some other pre-requisites. And for some unknown reasons, the instruction I found on-line doesn’t work on my mac. So here is my step-by-step instructions to install Basemap library on mac. Hope it could help people having the some problem as I did.
![Download Basemap For Python On Mac Download Basemap For Python On Mac](/uploads/1/2/6/7/126749641/280817634.png)
To install Basemap, you need to have geos and proj.4 library installed on your system. And the easiest way I found to install these two library is to use MacPorts. To have MacPorts ready on your mac, you need to first install Xcode and command line tools for Xcode.
Version 1.0.6 (git tag v1.0.6rel) -. fix drawcounties for Python 3.3. update pyproj to version 1.9.3 (remove geographiclib python code, replace with C code from proj4). in contourf and contour, all points outside the map projection region were masked. OldVersion.com Points System. When you upload software to oldversion.com you get rewarded by points. For every field that is filled out correctly, points will be rewarded, some fields are optional but the more you provide the more you will get rewarded! For most Unix systems, you must download and compile the source code. Wasteland 2 mac os x download. The same source code archive can also be used to build the Windows and Mac versions, and is the starting point for ports to all other platforms. Download the latest Python 3 and Python 2 source.
Then you can download MacPorts and install it on your computer.
Hp deskjet 3632 driver download mac. With MacPort installed, you can then install geos and proj.4 libraries by using the following codes:
sudo port install geos
sudo port install proj
sudo port install geos
sudo port install proj
Next, you need to download basemap package, unzip the package, and navigate to the directory:
cd basemap-1.x.x
then run the following code:
sudo python setup.py install
cd basemap-1.x.x
then run the following code:
sudo python setup.py install
Now, you are all set. Try simpletest.py in the examples folder under your basemap folder, you should be able to see a colored map (it takes a minute or so though).
It doesn’t look complicated at all at this point, but it was really a pain when you follow official or someone else’s instructions but always get errors. I didn’t figure out why I got errors when following instructions (they must work for others), but I am glad that I eventually find a detour to walk around.
I guess that’s what happened in life. You don’t always find a way out following someone else’s steps, but it doesn’t mean you cannot find out your own way.
I'm running these in my Mac' s terminal, with python 3.7.0.
It seems to be some problems with
Above are some relative module that I already have.
It seems to be some problems with
numpy
or Cython
but I pretty sure I have already installed them.numpy 1.15.4
Cython 0.29.2
pyproj 1.9.5.1
geos 0.2.1
Above are some relative module that I already have.
Any idea or suggestions?
Basemap Python Source Code
![Python Python](/uploads/1/2/6/7/126749641/797264912.png)
Yande-MacBook-Air:basemap-1.1.0 yan$ python3 setup.py install
`/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'namespace_packages'
warnings.warn(msg)
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension '_geoslib' sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_geoslib' extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
Python Install Basemap
compile options: '-Iinclude -I['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include'] -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
gcc: src/_geoslib.c
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: Command 'gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Iinclude -I['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include'] -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_geoslib.c -o build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o -MMD -MF build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o.d' failed with exit status 1`
gcc: src/_geoslib.c
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: Command 'gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Iinclude -I['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include'] -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_geoslib.c -o build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o -MMD -MF build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o.d' failed with exit status 1`