安装Django-toolbelt时出现python_setup.py和egg.info错误

时间:2015-05-16 03:33:11

标签: django pip

我尝试安装Django-toolbelt,但我一直在下面。我正在使用Mac。我试过谷歌搜索解决方案,但没有运气。感谢。

(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

1 个答案:

答案 0 :(得分:0)

我有完全相同的错误消息。但是,在我的情况下,我已经安装了psycopg2。发生的事情如下:

我第一次安装Macports, 然后在python文档中我得到了这一行:

sudo port install py27-psycopg2

但该行在

中安装了该软件包
'/opt/local/Library/Frameworks/Python.Framework/....'

而不是

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

我刚刚创建了一个解决问题的符号链接。