Forums

Trouble pip install Geopandas

Hello - I'm trying to install Geopandas, but I end up getting an error saying that permission is denied:

14:56 ~ $ pip install geopandas
Collecting geopandas
  Downloading geopandas-0.2.1-py2.py3-none-any.whl (199kB)
    100% |████████████████████████████████| 204kB 1.9MB/s 
Collecting descartes (from geopandas)
  Downloading descartes-1.1.0-py2-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pyproj in /usr/local/lib/python2.7/dist-packages (from geopandas)
Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/local/lib/python2.7/dist-packages (from geopandas)
Requirement already satisfied (use --upgrade to upgrade): fiona in /usr/local/lib/python2.7/dist-packages (from geopandas)
Requirement already satisfied (use --upgrade to upgrade): shapely in /usr/local/lib/python2.7/dist-packages (from geopandas)
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /usr/local/lib/python2.7/dist-packages (from descartes->geopandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas->geopandas)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from pandas->geopandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python2.7/dist-packages (from pandas->geopandas)
Requirement already satisfied (use --upgrade to upgrade): click-plugins in /usr/local/lib/python2.7/dist-packages (from fiona->geopandas)
Requirement already satisfied (use --upgrade to upgrade): munch in /usr/local/lib/python2.7/dist-packages (from fiona->geopandas)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from fiona->geopandas)
Requirement already satisfied (use --upgrade to upgrade): cligj in /usr/local/lib/python2.7/dist-packages (from fiona->geopandas)
Requirement already satisfied (use --upgrade to upgrade): cycler in /usr/local/lib/python2.7/dist-packages (from matplotlib->descartes->geopandas)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.4,>=1.5.6 in /usr/local/lib/python2.7/dist-packages (from matplotlib->descartes->ge
opandas)
Requirement already satisfied (use --upgrade to upgrade): click>=3.0 in /usr/local/lib/python2.7/dist-packages (from click-plugins->fiona->geopandas)
Installing collected packages: descartes, geopandas
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 346, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 317, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/descartes'

Any help would be appreciated.

https://help.pythonanywhere.com/pages/InstallingNewModules

Classic error! You may always install modules but do so locally: pip install module --user

Hello, Im also trying to install geopandas(pip3.7 install geopandas). But I get an error form pyproj:

Complete output from command python setup.py egg_info: proj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.html

Then I follow the instructions of that site and set:

export PROJ_DIR=/usr/local/lib

export PROJ_LIBDIR=/usr/local/lib

export PROJ_INCDIR=/usr/local/lib

Then I get the error:

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/bin/proj': '/usr/local/lib/bin/proj'

How can I install pyproj which is a prerequisite of geopandas?

What do you get if you run

pip3.7 install --user pyproj

...?

If that works, then you'd need to set the environment variables to point to your private installation of pyproj -- the commands would be the same, but with /usr/local/ replaced with $HOME/.local/

pip3.7 install --user pyproj

then I get the error: proj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.html

export PROJ_DIR=$HOME/.local/lib

export PROJ_LIBDIR=$HOME/.local/lib

export PROJ_INCDIR=$HOME/.local/lib

pip3.7 install --user pyproj

then I get the error: FileNotFoundError: [Errno 2] No such file or directory: '/home/SpyrosT93B/.local/lib/bin/proj': '/home/SpyrosT93B/.local/lib/bin/proj'

Try changing PROJ_DIR to $HOME/.local/ -- that looks like it might help.

export PROJ_DIR=$HOME/.local/

export PROJ_LIBDIR=$HOME/.local/

export PROJ_INCDIR=$HOME/.local/

pip3.7 install --user pyproj

then I get the error: FileNotFoundError: [Errno 2] No such file or directory: '/home/SpyrosT93B/.local/bin/proj': '/home/SpyrosT93B/.local/bin/proj'

I have my console 19687227 open. I dont know if its posible for you to look in it to see all the details.

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-tz1dr8xk/pyproj/ that comes in red at the bottom

proj_dir and proj_libdir etc are different paths. try just setting proj_dir and not setting anything else (the rest should work by default)

Giles suggested changing proj_dir but leaving the rest.

when is set only proj_dir:

15:52 ~ $ export PROJ_DIR=$HOME/.local/
15:53 ~ $ pip3.7 install --user pyproj
Looking in links: /usr/share/pip-wheels
Collecting pyproj
  Using cached https://files.pythonhosted.org/packages/2c/12/7a8cca32506747c05ffd5c6ba556cf8435754af0939906cbcc7fa5802ea3/pyproj-3.0.1.tar.gz
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    PROJ_DIR is set, using existing PROJ installation..

    ERROR: PROJ_INCDIR dir not found. Please set PROJ_INCDIR.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-r7z4oz7u/pyproj/
15:55 ~ $

Looks like you need to set PROJ_INCDIR if the includes directory is not inside the PROJ directory. See Installation — pyproj 3.0.1 documentation

Set it to where?

This is the path to the PROJ include directory. If not set, it assumes it is the includes directory inside the PROJ directory.

So I assume it should be set to where include directory is located for the PROJ.