
This could be because the cmake options you configured above (like ENABLE_PNG=OFF) were not properly loaded. Note: If you get an error like - Configuring incomplete, errors occurred! your makefile won't be created and you won't be able to run make in the next step. While inside the 'build' directory, run:Ĭd. ( \ continues the command on a new line). The last line of the cmake command is the folder extracted from the tarball.
Ubuntu install python 3.6 only install#
( nb: source is just a folder in my home directory where I install programs. I chose ~/source/eccodes as the location to which I will tell cmake to install eccodes. Take a look at this link: if you need more information about those extra dependencies.įor example you would need libpng and the jpeg2000 libs installed on your system to enable png and jpg functionality in pygrib. In my case, I didn't need any of the extra options. Ensure you have the required dependency installed on your system. Now here take a moment to understand the cmake build requirements for eccodes.įrom the installation link above, you'll see there are various params that you can enable or disable for any feature you need enabled, like png, jpg, fortran etc. Ubuntu 18 ships with both Python 2 and 3 but if yours doesn't install Python 3.6.5 by updating aptitude:

So without further ado, let's begin! Python Virtualenv and CMake setup If you want to understand the finer details behind the setup, read on. So if you're really just in a rush, that's another option.

UPDATE: User added a very useful dockerfile for this setup down below in the comments. I will put the AWS lambda deploy in a separate gist. Those built for Conda do not work on AWS machine architecture like lambda. This ensures that the built binaries will work on lambda. This is fine but here is the dealbreaker: Since I will be uploading this to AWS lambda, I also need to be able to build Pygrib on either an AWS lambda EC2 (Linux AMI) or AWS Lambda docker image that replicates the AWS Lambda machine architecture. Let me know below if it worked for you with other distros!īut before you go any further, the alternative way to install Pygrib is to use the Conda version (this is by far the easiest way since all the binaries are pre-built): īut it comes with the disadvantage that it is quite large.


The key to this installation is to build eccodes correctly (for your machine architecture) and successfully point pygrib to it. This setup should also work with lower and higher Ubuntu versions (as someone below mentioned) and other Linux distros (like RHEL - AWS Linux AMI etc). You can just as well use your system Python 3 however I personally find virtualenv a clean way to deal with these kind of complicated setups (prevents me mucking up my system's Python). Note: You don't have to use virtualenv Python. In this tutorial I use Ubuntu 18 and python 3.6.5 virtualenv. Pygrib for python is by far the best library for reading grib files but the installation can leave you dizzy Needless to say, if you're reading this, you probably know how hard it is to get a library that can read them and even harder, setting up those libraries. Recently I've had to work with Meterological data of the GRIB format.
Ubuntu install python 3.6 only how to#
How to install PyGrib with ECCodes (Python 3.6.5, Ubuntu 19, 18, 16, RHEL, Lambda, Linux AMI, Docker)
