fix PY-17586 Conda: No repositories for installing packages

PY-20477 Couldn't install and update packages using conda interpreter
This commit is contained in:
Ekaterina Tuzova
2016-11-03 18:05:23 +03:00
parent 9eea5815d8
commit 0dbddc907b
+16 -5
View File
@@ -10,8 +10,13 @@ def usage():
exit(ERROR_WRONG_USAGE)
def do_list_available_packages():
from conda.cli.main_search import common
index = common.get_index_trap()
try:
from conda.cli.main_search import common
index = common.get_index_trap()
except ImportError:
from conda.cli.main_search import get_index
index = get_index()
for pkg in index.values():
sys.stdout.write("\t".join([pkg["name"], pkg["version"], ":".join(pkg["depends"])])+chr(10))
sys.stdout.flush()
@@ -19,9 +24,15 @@ def do_list_available_packages():
def do_list_channels():
import conda.config as config
for channel in config.get_channel_urls():
sys.stdout.write(channel+chr(10))
sys.stdout.flush()
if hasattr(config, "get_channel_urls"):
channels = config.get_channel_urls()
else:
channels = config.context.channels
for channel in channels:
if channel != 'defaults':
sys.stdout.write(channel+chr(10))
sys.stdout.flush()
def main():
retcode = 0