How to install Contextily? - python-3.x

This question is written in relation with the answer to Plotting a map using geopandas and matplotlib.
The main point is that installing (spatial) libraries such as Proj.4 or Contextily can be a confusing task under Windows, so that most of the time we are advised to directly
use the OSGeo4W software distribution.
An example of such an advise here.
A contrario, the task is rather easy with other operating systems.
The main idea is to provide interrogative users with a "lite" installation approach.

Using Anaconda / conda
If you are using the Anaconda distribution or in general the conda package manager (which I recommend for installing the python geo stack), it should suffice to install contextily with:
conda install contextily --channel conda-forge
This will automatically install all python and C dependencies (proj.4, GDAL, ...)
This should work on all platforms (Windows, Linux, Mac).

Windows
(Without any conda-like distribution)
After manually downloading the WHL files from Unofficial Windows Binaries for Python Extension Packages. Open an Administrator Command Prompt and type (illustrated on Python3.6 32bit):
pip3.6 install GDAL-2.3.3-cp36-cp36m-win32.whl && setx GDAL_VERSION "2.3.3"
pip3.6 install Fiona-1.8.4-cp36-cp36m-win32.whl
pip3.6 install geopandas-0.4.0-py2.py3-none-any.whl
pip3.6 install proj
pip3.6 install Shapely-1.6.4.post1-cp36-cp36m-win32.whl
pip3.6 install Cartopy-0.17.0-cp36-cp36m-win32.whl
pip3.6 install rasterio-1.0.13-cp36-cp36m-win32.whl
pip3.6 install contextily
(tested).

Well from oficial install page with conda is :
conda install -c conda-forge contextily
Install geopandas and contextily

Related

how to install pytorch version 0.1.12 in anaconda 3.6 windows 10?

Tried to install with this command but still didn't work-> conda install -c peterjc123 pytorch=0.1.12
Also tried installing using this command:
conda install pytorch=0.1.12 -c pytorch
How can it be installed with python anaconda 3.6?
First of all, make sure that Python 3.5 or later is installed as well.
Go to this link and download "pytorch-0.1.12-py36_0.1.12cu80.tar.bz2".
Now navigate to the downloaded file and install it through Anaconda console conda install [path to file]/pytorch-0.1.12-py36_0.1.12cu80.tar.bz2
Note:
If it requires some additional modules, use conda or pip to install those addition modules via:
conda install (module)
or
pip install (module)

installing Mayavi with pip - no module named 'vtkOpenGLKitPython'

I am trying to install mayavi via pip on my ubuntu 16.04 via shell. I am using python 3.6 via anaconda and already installed vtk and all other requirements but i get the above error when i try pip3 install mayavi or pip2 install mayavi.
Mayavi is packaged for ubuntu packages.ubuntu.com/xenial/mayavi2.
I suggest that you install with the command
sudo apt-get install mayavi2
instead, this will take care of installing a version that matches the vtk install on your system.
Try to rename libvtkOpenGLKitPython*.so file.
In my case it was:
cd /opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/vtk
cp libvtkOpenGLKitPython36D-8.1.so libvtkOpenGLKitPython.so
and, maybe one more error with libxt6 file. Fix it:
apt install libxt6

How to install library

I am a little bit confused....
I installed anaconda on my computer (I have windows 10).
Normally, when I want to install a package I simply do "pip install package_name" or "conda install package_name" and it is done.
First question: what is the difference between pip and conda?
Now I tried to install xgboost and it was really complicated I tried lot of things nothings worked until I install something called miniconda.
There it works but now, when I do "conda install package_name" it install it in miniconda3/lib/site _package and I have to copy/paste it in Anaconda3/lib/site_package if I want it to work.
Second question: how can I ask to the computer that "conda install
package_name" install it directly in anaconda3 and not miniconda3?
Finally I tried to install the package "surprise" for recommended systems. Both "pip install" or "conda install" failed.
I went in github and got the file "surprise" from https://github.com/NicolasHug/Surprise
I tried to copy it in Anaconda3/lib/site_package but it doesn't work.
When I do from surprise import Reader I did not get the error "no module name surprise" anymore but I get "cannot import name 'Reader'"
Last question: how can I make it work? I think I have to build it but
I do not now how...
Thank you in advance for anyone that can explain all this for me :-)
Similarly to you, I had issues installing the surprise package.
I tried both pip install surprise and conda install surprise unsuccessfully.
conda install -c conda-forge scikit-surprise
conda install -c conda-forge/label/gcc7 scikit-surprise
conda install -c conda-forge/label/cf201901 scikit-surprise
I found those on the anconda website and the first one worked for me.
Hopefully this would help you as well
pip vs conda
pip is a package manager that facilitates installation, upgrade,
and uninstallation of python packages. It also works with virtual python environments.
conda is a package manager for any software (installation, upgrade and uninstallation).
It also works with virtual system environments.
Conda is a packaging tool and installr that aims to do more than what pip does;
handle library dependencies outside of the Python packages as well as the Python packages themselves.
Conda also creates a virtual environment, like virtualenv does.
For more see here
Anaconda vs miniconda
The open source version of Anaconda is an easy-to-install
high performance Python and R distribution with a package manager,
environment manager and collection of 720+ open source packages.
It also comes with the options to install RStudio.
The "lite" version of Anaconda without the collection of 720 packages.
The downside is that you need to type in command line commands,
"conda install PACKAGENAME"
And Last
To install this package with conda run:
conda install -c anaconda py-xgboost=0.60
Update for surprise
The easiest way is to use pip (you'll need numpy):
$ pip install numpy
$ pip install scikit-surprise
Or you can clone the repo and build the source (you'll need Cython and numpy):
$ git clone https://github.com/NicolasHug/surprise.git
$ python setup.py install

Not able to install scipy, matplotlob and scikit-learn using pip 1.5.6

Trying to install
pip install numpy
pip install scipy
pip install matplotlib
pip install scikit-learn
It failed with scipy, matplotlib and scikit-learn.
(from https://pypi.python.org/simple/scipy/) because it is not compatible with this Python
Skipping
My python version is 3.4 and pip version is 1.5.6
please help me install those above package
With pip 1.5.6 it will try to compile those projects from source which requires a lot of system dependencies (especially for scipy, you need gfortran and an optimized BLAS/LAPACK implementation).
I assume you are using the system provided version of pip under Linux. I would recommend to either use the latest version of pip (8.1 or later) in an a virtualenv (to avoid replacing the files of the system installed version of pip). Then you should be able to install manylinux wheels which do not require the compilation step.
Alternatively you can install miniconda and install those packages with the conda command line instead of pip.
Forget shitty pip, which is flawed beyond repair (static linking etc.)
Download IPython with the Anaconda Suite.... https://www.continuum.io/downloads
It brings most of the needed modules for scientific computing (as it is a crappy task if you have to download stuff to site-packages and run python setup.py install 3781 times..)
I wrote several programs using matplotlib, scipy, numpy etc with it..
Moreover it sports module package manager (comparable to Synaptic on Ubuntu..) if you are to lazy for the above mentioned task (and you are..).
Greets Dr. Cobra

Installing Anaconda on Ubuntu 14.04 - installing mrjob

The installation went fine, except for the last three packages:
mrjob, pattern, and seaborn
I was able to install these from a terminal, however they installed into my old Python environment and not into the anaconda environment. How can I install these packages into my anaconda environment?
Those packages are not available in Anaconda. So you need to use the pip command to install them. The package will be installed in your active conda environment.
pip install mrjob
Use conda to install them. For mrjob and pattern, you may need find them on Binstar. It looks like conda install -c chdoig -c nbsantos mrjob pattern seaborn should work.
If you installed Python environment uses Anaconda, then you should do this command
conda install -c conda-forge -n [your-env-name] mrjob.
It would take mrjob packages from conda-forge repository.

Resources