Linux Shapely Installation – How to Install Shapely on Linux?

installationlinuxshapely

I am beginner in Linux. I have a problem to use Shapely 1.6.4 post2…
I installed shapely by this command:

$ pip install shapely

and it worked good

Collecting shapely
  Using cached https://files.pythonhosted.org/packages/81/d1/b8e1b089a8ddd6df74be583d70373eac55c725c6197c115efbd3c3e1509f/Shapely-1.6.4.post2-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: shapely
Successfully installed shapely-1.6.4.post2

but when i want to import shapely…

$ python chp1.py
Traceback (most recent call last):
File "chp1.py", line 3, in <module>
from shapely.geometry import Point
ModuleNotFoundError: No module named 'shapely'

I use python 3.6.7

Could you explain the problem?

Best Answer

If you are using python 3.6.7, for installing shapely you need to do:

pip3 install shapely

If you got an error and you use Debian or Debian derivatives distros you need to do first:

apt-get install python3-pip

as superuser (for other Linux distros you need to use equivalent command).

By default:

pip install shapely

install shapely for your python 2.7.x version.