Installing Kartograph / GDAL / Etc. with PIP and virtualenv

826 Views Asked by At

Running into a few different problems here. Trying to install Kartograph and first installing dependencies. Here are my steps and results thus far:

  1. Install GDAL from .pkg. Goes well. No problems here.
  2. Try to install Kartograph using the default instructions for OSX with several packages. This fails with the following errors:

File "", line 4, in

main.gdal_config_error: [Errno 2] No such file or directory

Command python setup.py egg_info failed with error code 1 in /Users/chris/ENV/build/GDAL

  1. Ok, no dice. So then I try the install excluding GDAL as that seems to be presenting a problem to pip's install of Kartograph. That doesn't work either and produces the following errors:
raise KeyError('please set the environment variable PROJ_DIR to point to the location of your proj.4 installation')

KeyError: 'please set the environment variable PROJ_DIR to point to the location of your proj.4 installation'

---------------------------------------- Command python setup.py egg_info failed with error code 1 in /Users/chris/ENV/build/pyproj

Now, I've edited the activate script of my virtualenv with the PYTHONPATH variable assignment per the Kartograph documentation. However, not sure that helped or has changed anything.

Has anyone run into a similar sequence of errors and if so, how did you solve this issue?

1

There are 1 best solutions below

0
On

I managed to fix this error but now I'm stuck at another error.

Anyway this is what I did:

  1. I installed the PROJ framework package from here:

    http://www.kyngchaos.com/software/frameworks

  2. Then I ran the following in Terminal to add the installation path to PROJ_DIR (as instructed in the error message):

    $ export PROJ_DIR=$PROJ_DIR:/Library/Frameworks/PROJ.framework/Programs
    

Apparently PROJ is included in the GDAL framework so maybe the first step is unnecessary.

Update: It seems the path is lost when you close Terminal