setup.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:pyasp 作者: sthiele 项目源码 文件源码
def binaries_directory():
    """Return the installation directory, or None"""
    if '--user' in sys.argv:
        paths = (site.getusersitepackages(),)
    else:
        py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
        paths = (s % (py_version) for s in (
            sys.prefix + '/lib/python%s/dist-packages/',
            sys.prefix + '/lib/python%s/site-packages/',
            sys.prefix + '/local/lib/python%s/dist-packages/',
            sys.prefix + '/local/lib/python%s/site-packages/',
            '/Library/Python/%s/site-packages/',
        ))

    # yield the first valid path
    for path in paths:
        # add the package and bin subdir and, if exists, return it
        path = os.path.join(path, '%s/%s' % (info.__pkg_name__, constant.REL_DIR_BIN))
        if os.path.exists(path):
            return path
    logging.getLogger().error(
        'pyasp binaries path not found. You need to download and'
        ' put in place the binaries for gringo3, gringo4 and clasp'
        ' in order to start using pyasp.'
        ' You can find binaries from ' + BINARIES_BASE_URL +
        ' or https://sourceforge.net/projects/potassco/files/,'
        ' or compile them yourself.'
    )
    exit()
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号