首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装Django工具带时出现python_setup.py和egg.info错误

安装Django工具带时出现python_setup.py和egg.info错误
EN

Stack Overflow用户
提问于 2015-05-16 11:33:11
回答 1查看 536关注 0票数 0

我试着安装了Django-工具带,但我一直收到下面的提示。我正在使用Mac。我试着用谷歌搜索解决方案,但没有成功。谢谢。

代码语言:javascript
运行
复制
(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
EN

回答 1

Stack Overflow用户

发布于 2016-03-11 01:27:22

我收到了完全相同的错误消息。然而,在我的例子中,我已经安装了psycopg2。当时发生的情况如下:

我必须首先安装Macports,然后在python文档中得到下面这行代码:

代码语言:javascript
运行
复制
sudo port install py27-psycopg2

但该行将软件包安装在

代码语言:javascript
运行
复制
'/opt/local/Library/Frameworks/Python.Framework/....'

而不是

代码语言:javascript
运行
复制
'/Library/Frameworks/Python.Framework/....'

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30271544

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档