- Installation notes for Linux / OS X and Windows
- Source/Project Directories Set-up
- Usual Install Issues
- Dependencies
The prefered way to install PyLayers is to first install the free python distribution Anaconda on your platform. By doing so, you're installing most of the required dependencies.
- Download Anaconda
- Install Anaconda with the given command ( $bash Anaconda--.sh ). Important : Say yes to add Anaconda to your path
- Clone PyLayers : git clone https://github.com/pylayers/pylayers.git
- Run "./installer_unix" file from the PyLayers directory (YOUR FIRST NEED to add exe rights using the command: chmod +x ./installer_unix )
- Done
- Download and Install Anaconda
- Download the Shapely package wheel corresponding to your platform from Unofficial Windows Binaries for Python Extension Packages #Shapely *
- Download the Basemap package wheel corresponding to your platform from Unofficial Windows Binaries for Python Extension Packages #Basemap
- Download the triangle package wheel corresponding to your platform from Unofficial Windows Binaries for Python Extension Packages #triangle
- Install the 3 previously downloaded packages (Shapely, Basemap and triangle) whells using pip ( e.g. pip install triangle-date-pythonversion-plateform.whl
- Clone PyLayers : git clone https://github.com/pylayers/pylayers.git
- Run installer.bat
- Done
- Despite shapely is part of the Anaconda distribution, the Windows distribution doesn't contains the libgeos dependencies.
# Source/project Directories Set-up
The source and Project directory path are automatically filled into a ".pylayers" file during the install. The .pylayers file is stored at the root of user's home (~/).
- The source directory, gathers all the source files.
- The project directory , gathers configuration files.
The default ".pylayers" contains :
```
source
/the/path/where/installer/has/been/run/pylayers
project
~/pylayers_project
```
The source path indicates where the PyLayers' source files are located. You generally don't have to modify this path
The project path indicates where the configurations files are located. If you decide to move your project directory elsewhere, you must change the project path in consequence.
Notes for previous users of PyLayers:
The environment variables $PYLAYERS and $BASENAME are no longer required. If you try to re-install PyLayers on an existing version: -the source path of the .pylayers file will be set at the value contained into the $PYLAYERS environment variable -the project path of the .pylayers file will be set at the value contained into the $BASENAME environment variable
# Usual Install Issues
Most of the issue encountered during the install is due to
- Multiple python installations and/or
- Multiple installation of some packages ( especially shapely/basemap under windows)
Often, multiple python installation co-exists on a same computer, and this can cause complex PyLayers installation issues. To avoid that kind of issue, please,, make sure that you're using the python installation provided by Anaconda ,and not another one. To this end, you can check this on unix platform with : $ which python
and under windows by opening 'cmd' and using : c:\ for %i in (python.exe) do @echo. %~$PATH:i
If the answer doesn't point to the Anaconda installation directory, you're using the wrong python version. You have to update the default python installation. I cannot describe here the detail procedure because it is really depend to your configuration.
Another source of issues comes from some package conflicts. This is especially the case by using a WINDOWS OS, when the shapely installation has to be perfomed by using an external installer and not the one provided by Anaconda (because it does not contains required dependencies).
If after the installation, the import of a PyLayers module cause an Error involving shapely and/or basemap, you're probably facing the package conflict issue.
The easiest way to solve it is to remove the '.egg' of the incriminated package in :
$ /lib/python2.7/site-packages/ (UNIX)
or c:<Path to Anaconda>\Lib\site-packages (Windows)
3. Everything is correctly installed, but I can't see the Mayavi scene when I use DL._show3() in the example
This is related to your Mayavi backend configuration, which doesn't use qt. The Mayavi website gives a solution in 2 step to the problem:
- Invoking ipython with the qt backend either in the bash, by launching ipython with 'ipython --gui=qt' or, in the interactive prompt by using the '%gui qt' command )
- Setting 2 environment variables 'QT_API=pyqt' and 'ETS_TOOLKIT=qt4 ipython'
If you still fail to see any 3D scene in mayavi, you may try the wx backend by:
- Invoking ipython with ipython --gui=wx
- Setting the environment variable to ETS_TOOLKIT=wx
The following modules are required to use PyLayers
numpy>=1.6.1
scipy>=0.10.1
networkx>=1.7
matplotlib>=1.1.0
shapely>=1.2.14
descartes>=1.0
SimPy>=2.2
PIL>=1.1.5
bitstring>=3.0.2
pyinterval>=1.0
osmapi>=0.3
imposm
basemap>=1.0
pandas >=0.12.0
mayavi >=4.3.1
gdal module is needed for importing aster files there are 3 broken links.
conda install gdal cd ~/anaconda2/lib ln -s ../pkgs/libnetcdf-4.3.3.1-3/lib/libnetcdf.so.7 . ln -s ../pkgs/hdf5-1.8.15.1-3/lib/libhdf5_cpp.so.10 . ln -s ../pkgs/kealib-1.4.5-0/lib/libkea.so.1.4.5 .