0

I tried to install Django-toolbelt, but I keep getting the below. I am using Mac. I've tried googling around for solutions but no luck. Thanks.

(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ pip install django-toolbelt
/Users/chantrinh/Django_app2/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting django-toolbelt
  Using cached django-toolbelt-0.0.1.tar.gz
Collecting django (from django-toolbelt)
  Using cached Django-1.8.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-toolbelt)
  Using cached psycopg2-2.6.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    Error: pg_config executable not found.

    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/4r/bh8wxz5d2678zg90jn1715s80000gn/T/pip-build-eUKfh5/psycopg2
(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ pg_config
-bash: pg_config: command not found
(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ sudo find / -name pg_config
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
tutuDajuju
  • 10,307
  • 6
  • 65
  • 88
shizznetz
  • 151
  • 1
  • 2
  • 10
  • 1
    `pg_config` is a PostgreSQL development library configuration script shipped with PostgreSQL. Install PostgreSQL e.g. from Homebrew. – Mikko Ohtamaa May 16 '15 at 08:22
  • possible duplicate of [Can't install psycopg2 with pip in virtualenv on Mac OS X 10.7](http://stackoverflow.com/questions/9678408/cant-install-psycopg2-with-pip-in-virtualenv-on-mac-os-x-10-7) – tutuDajuju May 18 '15 at 20:07

1 Answers1

0

I had exactly the same error message. However, in my case, I had already installed psycopg2. What was happening was the following:

I had first to install Macports, Then in the python documentation I got this line:

sudo port install py27-psycopg2

But that line installed the package in

'/opt/local/Library/Frameworks/Python.Framework/....'

instead of

'/Library/Frameworks/Python.Framework/....'

I just created a symbolic link to solve the problem.

Wilder
  • 45
  • 4