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
评论列表
文章目录