New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writeup Ubuntu 12.04 install instructions #46

Closed
pelson opened this Issue Sep 24, 2012 · 23 comments

Comments

Projects
None yet
8 participants
@pelson
Member

pelson commented Sep 24, 2012

They are:

wget http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py

# to install from git source
sudo apt-get update
sudo apt-get install git

sudo apt-get install python-dev
sudo pip install numpy

sudo pip install cython
sudo apt-get install libproj-dev

# install geos 
sudo apt-add-repository ppa:sharpie/for-science
sudo apt-get update
sudo apt-get install libgeos-dev

sudo pip install shapely
sudo apt-get install python-scipy
sudo pip install pyshp

sudo apt-get install python-imaging

# for matplotlib 1.2 (no pre-build package available yet)
sudo apt-get build-dep matplotlib
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
git checkout v1.2.0rc2
sudo python setup.py install

@ghost ghost assigned pelson Sep 24, 2012

@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Sep 24, 2012

Member

For matplotlib, the following might be preferable:

sudo apt-get build-dep matplotlib
wget https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.2.0rc2.tar.gz
tar xzf matplotlib-1.2.0rc2.tar.gz
cd matplotlib-1.2.0rc2
sudo python setup.py install
Member

pelson commented Sep 24, 2012

For matplotlib, the following might be preferable:

sudo apt-get build-dep matplotlib
wget https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.2.0rc2.tar.gz
tar xzf matplotlib-1.2.0rc2.tar.gz
cd matplotlib-1.2.0rc2
sudo python setup.py install
@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Sep 24, 2012

Member

In order to run the tests:

sudo pip install nose
Member

pelson commented Sep 24, 2012

In order to run the tests:

sudo pip install nose
@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Sep 24, 2012

Member

To build cartopy:

git clone https://github.com/SciTools/cartopy.git
cd cartopy
python setup.py install
Member

pelson commented Sep 24, 2012

To build cartopy:

git clone https://github.com/SciTools/cartopy.git
cd cartopy
python setup.py install
@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Sep 24, 2012

Member

@marqh wanted some knowledge of this issue.

Member

pelson commented Sep 24, 2012

@marqh wanted some knowledge of this issue.

@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Sep 25, 2012

Member

Also need PIL.

Member

pelson commented Sep 25, 2012

Also need PIL.

@bblay

This comment has been minimized.

Show comment
Hide comment
@bblay

bblay Oct 10, 2012

Contributor

When writing this up it may be helpful to suggest it is done in a temporary folder that can later be deleted.

Contributor

bblay commented Oct 10, 2012

When writing this up it may be helpful to suggest it is done in a temporary folder that can later be deleted.

@bblay

This comment has been minimized.

Show comment
Hide comment
@bblay

bblay Oct 10, 2012

Contributor

might be worth adding a note to developers not to install cartopy,
but to make a softlink in ~/.local/lib/python2.7/site-packages

Contributor

bblay commented Oct 10, 2012

might be worth adding a note to developers not to install cartopy,
but to make a softlink in ~/.local/lib/python2.7/site-packages

@esc24

This comment has been minimized.

Show comment
Hide comment
@esc24

esc24 Oct 10, 2012

Member

@bblay - if a developer doesn't do an install, they'll still need to build the extensions - perhaps a separate note describing the option of an in place build (see Iris INSTALL for an example) would be useful.

Member

esc24 commented Oct 10, 2012

@bblay - if a developer doesn't do an install, they'll still need to build the extensions - perhaps a separate note describing the option of an in place build (see Iris INSTALL for an example) would be useful.

@marqh

This comment has been minimized.

Show comment
Hide comment
@marqh

marqh Oct 20, 2012

Member

hello

i have libgeos-dev 3.2.2-3 installed (and the other dependencies, afaik), and the latest master, but:

python setup.py build_ext --inplace
.....
lib/cartopy/_trace.cpp:310:77: error: ‘GEOSGeom_createEmptyCollection_r’ was not declared in this scope
lib/cartopy/_trace.cpp: In function ‘bool straightAndDomain(double, Point&, double, Point&, Interpolator*, double, GEOSContextHandle_t, const GEOSPreparedGeometry*, bool)’:
lib/cartopy/_trace.cpp:411:76: error: ‘GEOSPreparedDisjoint_r’ was not declared in this scope
error: command 'gcc' failed with exit status 1

any help gratefully received

Member

marqh commented Oct 20, 2012

hello

i have libgeos-dev 3.2.2-3 installed (and the other dependencies, afaik), and the latest master, but:

python setup.py build_ext --inplace
.....
lib/cartopy/_trace.cpp:310:77: error: ‘GEOSGeom_createEmptyCollection_r’ was not declared in this scope
lib/cartopy/_trace.cpp: In function ‘bool straightAndDomain(double, Point&, double, Point&, Interpolator*, double, GEOSContextHandle_t, const GEOSPreparedGeometry*, bool)’:
lib/cartopy/_trace.cpp:411:76: error: ‘GEOSPreparedDisjoint_r’ was not declared in this scope
error: command 'gcc' failed with exit status 1

any help gratefully received

@esc24

This comment has been minimized.

Show comment
Hide comment
@esc24

esc24 Oct 20, 2012

Member

I hit the same error building on linux mint. I downloaded the latest geos (3.3.5 at the time) and built it from source. That solved it.

Member

esc24 commented Oct 20, 2012

I hit the same error building on linux mint. I downloaded the latest geos (3.3.5 at the time) and built it from source. That solved it.

@MartinDix

This comment has been minimized.

Show comment
Hide comment
@MartinDix

MartinDix Oct 31, 2012

With Ubuntu 12.10 I needed to install libproj-dev rather than proj. Everything else was ok.

MartinDix commented Oct 31, 2012

With Ubuntu 12.10 I needed to install libproj-dev rather than proj. Everything else was ok.

@rhattersley

This comment has been minimized.

Show comment
Hide comment
@rhattersley

rhattersley Oct 31, 2012

Member

Thanks for the feedback @MartinDix - I've updated the issue description accordingly.

Member

rhattersley commented Oct 31, 2012

Thanks for the feedback @MartinDix - I've updated the issue description accordingly.

@tresCalme

This comment has been minimized.

Show comment
Hide comment
@tresCalme

tresCalme Nov 29, 2012

Cannot install it. I followed all the steps but when I come to install cartopy itself I it the following problem:

david@david:~/ProgramCodes/Python/lib/cartopy$ python setup.py install
running install
running build
running build_py
running build_ext
cythoning lib/cartopy/trace.pyx to lib/cartopy/trace.cpp

Error converting Pyrex file to C:

...
cdef extern from "_trace.h":
cdef cppclass Interpolator:
pass

cdef cppclass SphericalInterpolator:
    SphericalInterpolator(projPJ src_proj, projPJ dest_proj)
                                ^

/home/david/ProgramCodes/Python/lib/cartopy/lib/cartopy/trace.pyx:48:37: Expected ')'
building 'cartopy.trace' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I./lib/cartopy -I/usr/include/python2.6 -c lib/cartopy/trace.cpp -o build/temp.linux-i686-2.6/lib/cartopy/trace.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
lib/cartopy/trace.cpp:1: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1

Any idea?

tresCalme commented Nov 29, 2012

Cannot install it. I followed all the steps but when I come to install cartopy itself I it the following problem:

david@david:~/ProgramCodes/Python/lib/cartopy$ python setup.py install
running install
running build
running build_py
running build_ext
cythoning lib/cartopy/trace.pyx to lib/cartopy/trace.cpp

Error converting Pyrex file to C:

...
cdef extern from "_trace.h":
cdef cppclass Interpolator:
pass

cdef cppclass SphericalInterpolator:
    SphericalInterpolator(projPJ src_proj, projPJ dest_proj)
                                ^

/home/david/ProgramCodes/Python/lib/cartopy/lib/cartopy/trace.pyx:48:37: Expected ')'
building 'cartopy.trace' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I./lib/cartopy -I/usr/include/python2.6 -c lib/cartopy/trace.cpp -o build/temp.linux-i686-2.6/lib/cartopy/trace.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
lib/cartopy/trace.cpp:1: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1

Any idea?

@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Nov 30, 2012

Member

Thanks for posting @tresCalme - I've responded in the group where this was originally raised: https://groups.google.com/forum/?fromgroups=#!topic/scitools-iris/InzfnjpqvJk

Member

pelson commented Nov 30, 2012

Thanks for posting @tresCalme - I've responded in the group where this was originally raised: https://groups.google.com/forum/?fromgroups=#!topic/scitools-iris/InzfnjpqvJk

@rsignell-usgs

This comment has been minimized.

Show comment
Hide comment
@rsignell-usgs

rsignell-usgs Jul 12, 2013

Contributor

On my Ubuntu 12.04, I'm getting:

rsignell@igsagiegwsrsil0:~/python/cartopy$ python setup.py install --user
running install
running build
running build_py
running build_ext
skipping 'lib/cartopy/trace.cpp' Cython extension (up-to-date)
building 'cartopy.trace' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -fPIC -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include -I./lib/cartopy -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include/python2.7 -c lib/cartopy/trace.cpp -o build/temp.linux-x86_64-2.7/lib/cartopy/trace.o
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1

Contributor

rsignell-usgs commented Jul 12, 2013

On my Ubuntu 12.04, I'm getting:

rsignell@igsagiegwsrsil0:~/python/cartopy$ python setup.py install --user
running install
running build
running build_py
running build_ext
skipping 'lib/cartopy/trace.cpp' Cython extension (up-to-date)
building 'cartopy.trace' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -fPIC -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include -I./lib/cartopy -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include/python2.7 -c lib/cartopy/trace.cpp -o build/temp.linux-x86_64-2.7/lib/cartopy/trace.o
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1

@MartinDix

This comment has been minimized.

Show comment
Hide comment
@MartinDix

MartinDix Jul 15, 2013

Do you have g++ installed? It’s a separate package to gcc in Ubuntu.

MartinDix commented Jul 15, 2013

Do you have g++ installed? It’s a separate package to gcc in Ubuntu.

@rsignell-usgs

This comment has been minimized.

Show comment
Hide comment
@rsignell-usgs

rsignell-usgs Jul 15, 2013

Contributor

Yep, that was it. Thanks!

So progress! on to the next problem: I've installed libgeos-dev, but I'm getting

python setup.py build

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -fPIC -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include -I./lib/cartopy -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include/python2.7 -c lib/cartopy/_trace.cpp -o build/temp.linux-x86_64-2.7/lib/cartopy/_trace.o
lib/cartopy/_trace.cpp: In member function ‘GEOSGeometry* LineAccumulator::as_geom(GEOSContextHandle_t)’:
lib/cartopy/trace.cpp:310:77: error: ‘GEOSGeom_createEmptyCollection_r’ was not declared in this scope
lib/cartopy/trace.cpp: In function ‘bool straightAndDomain(double, Point&, double, Point&, Interpolator, double, GEOSContextHandle_t, const GEOSPreparedGeometry
, bool)’:
lib/cartopy/_trace.cpp:446:76: error: ‘GEOSPreparedDisjoint_r’ was not declared in this scope
error: command 'gcc' failed with exit status 1

Contributor

rsignell-usgs commented Jul 15, 2013

Yep, that was it. Thanks!

So progress! on to the next problem: I've installed libgeos-dev, but I'm getting

python setup.py build

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -fPIC -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include -I./lib/cartopy -I/home/rsignell/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/include/python2.7 -c lib/cartopy/_trace.cpp -o build/temp.linux-x86_64-2.7/lib/cartopy/_trace.o
lib/cartopy/_trace.cpp: In member function ‘GEOSGeometry* LineAccumulator::as_geom(GEOSContextHandle_t)’:
lib/cartopy/trace.cpp:310:77: error: ‘GEOSGeom_createEmptyCollection_r’ was not declared in this scope
lib/cartopy/trace.cpp: In function ‘bool straightAndDomain(double, Point&, double, Point&, Interpolator, double, GEOSContextHandle_t, const GEOSPreparedGeometry
, bool)’:
lib/cartopy/_trace.cpp:446:76: error: ‘GEOSPreparedDisjoint_r’ was not declared in this scope
error: command 'gcc' failed with exit status 1

@rsignell-usgs

This comment has been minimized.

Show comment
Hide comment
@rsignell-usgs

rsignell-usgs Jul 17, 2013

Contributor

@MartinDix any ideas here?

Contributor

rsignell-usgs commented Jul 17, 2013

@MartinDix any ideas here?

@esc24

This comment has been minimized.

Show comment
Hide comment
@esc24

esc24 Jul 17, 2013

Member

The version of geos available in Precise (12.04) is too old, hence the missing definitions. I have put together a PPA for ubuntu with packages for Iris and Cartopy for ubuntu 12.04 and 12.10. In order to get the 12.04 packages to install, I had to use a more recent geos that was built for 12.04 so this package is also on my PPA along with matplotlib 1.2. Feel free to add my PPA to your system and install either the more recent libgeos-dev, or try out the iris and cartopy packages. The ppa is on launchpad: https://launchpad.net/~drescampbell/+archive/ppa

You can add it using:

sudo add-apt-repository ppa:drescampbell/ppa
sudo apt-get update

You can then install cartopy using sudo apt-get install python-cartopy. This will install the required libgeos and other packages. Alternartively, try sudo apt-get install python-iris which will install cartopy as one of its dependencies.

Please bear in mind these packages are almost completely untested. I have very little experience with packaging under ubuntu so please be careful as these commands could break your system. I've been hesitant to post these details as I wanted to test them first. I'd welcome any feedback.

Member

esc24 commented Jul 17, 2013

The version of geos available in Precise (12.04) is too old, hence the missing definitions. I have put together a PPA for ubuntu with packages for Iris and Cartopy for ubuntu 12.04 and 12.10. In order to get the 12.04 packages to install, I had to use a more recent geos that was built for 12.04 so this package is also on my PPA along with matplotlib 1.2. Feel free to add my PPA to your system and install either the more recent libgeos-dev, or try out the iris and cartopy packages. The ppa is on launchpad: https://launchpad.net/~drescampbell/+archive/ppa

You can add it using:

sudo add-apt-repository ppa:drescampbell/ppa
sudo apt-get update

You can then install cartopy using sudo apt-get install python-cartopy. This will install the required libgeos and other packages. Alternartively, try sudo apt-get install python-iris which will install cartopy as one of its dependencies.

Please bear in mind these packages are almost completely untested. I have very little experience with packaging under ubuntu so please be careful as these commands could break your system. I've been hesitant to post these details as I wanted to test them first. I'd welcome any feedback.

@rsignell-usgs

This comment has been minimized.

Show comment
Hide comment
@rsignell-usgs

rsignell-usgs Jul 17, 2013

Contributor

Yep, that worked. Awesome!

I did

sudo add-apt-repository ppa:drescampbell/ppa
sudo apt-get update
sudo apt-get install libgeos-dev

I didn't want to install canopy/iris this way to the system python because I want them to work from within Enthought Canopy.

Can I also install just the pp unpacker and grib-api using your PPA?

-Rich

Contributor

rsignell-usgs commented Jul 17, 2013

Yep, that worked. Awesome!

I did

sudo add-apt-repository ppa:drescampbell/ppa
sudo apt-get update
sudo apt-get install libgeos-dev

I didn't want to install canopy/iris this way to the system python because I want them to work from within Enthought Canopy.

Can I also install just the pp unpacker and grib-api using your PPA?

-Rich

@esc24

This comment has been minimized.

Show comment
Hide comment
@esc24

esc24 Jul 20, 2013

Member

Can I also install just the pp unpacker and grib-api using your PPA?

Not yet. I'll get to it when I return from my vacation. In the meantime take a look at steps 3 and 4 on https://github.com/SciTools/installation-recipes/tree/master/xubuntu12.04 (note these instructions need updating to reflect the issue with geos, but pp packing and grib should be unaffected.)

Member

esc24 commented Jul 20, 2013

Can I also install just the pp unpacker and grib-api using your PPA?

Not yet. I'll get to it when I return from my vacation. In the meantime take a look at steps 3 and 4 on https://github.com/SciTools/installation-recipes/tree/master/xubuntu12.04 (note these instructions need updating to reflect the issue with geos, but pp packing and grib should be unaffected.)

@bblay

This comment has been minimized.

Show comment
Hide comment
@bblay

bblay Nov 20, 2013

Contributor

sudo apt-get install python-iris has just saved me a great deal of time and effort, thank you.

Continuing on to set up a development environment, I needed to do this:

sudo apt-get install python-pip libproj-dev
sudo pip install cython
python setup.py build_ext --inplace

(and then make the softlink or pth file in .local to lib/cartopy)

Contributor

bblay commented Nov 20, 2013

sudo apt-get install python-iris has just saved me a great deal of time and effort, thank you.

Continuing on to set up a development environment, I needed to do this:

sudo apt-get install python-pip libproj-dev
sudo pip install cython
python setup.py build_ext --inplace

(and then make the softlink or pth file in .local to lib/cartopy)

@pelson

This comment has been minimized.

Show comment
Hide comment
@pelson

pelson Jun 19, 2014

Member

https://github.com/SciTools/installation-recipes has some useful instructions. As well as there being conda packages for installation not-from-source.

Member

pelson commented Jun 19, 2014

https://github.com/SciTools/installation-recipes has some useful instructions. As well as there being conda packages for installation not-from-source.

@pelson pelson closed this Jun 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment