repo
stringclasses
856 values
pull_number
int64
3
127k
instance_id
stringlengths
12
58
issue_numbers
sequencelengths
1
5
base_commit
stringlengths
40
40
patch
stringlengths
67
1.54M
test_patch
stringlengths
0
107M
problem_statement
stringlengths
3
307k
hints_text
stringlengths
0
908k
created_at
timestamp[s]
conda/conda
620
conda__conda-620
[ "599" ]
c453be49e865297bf12858548a6b3e7891a8cb43
diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -30,6 +30,11 @@ def normalized_version(version): return version +class NoPackagesFound(RuntimeError): + def __init__(self, msg, pkg): + super(NoPackagesFound, self).__init__(msg) + self.pkg = pkg + const_pat = re.compile(r'([=<>!]{1,2})(\S+)$') def ver_eval(version, constraint): """ @@ -243,7 +248,7 @@ def track_features(self, fn): def get_pkgs(self, ms, max_only=False): pkgs = [Package(fn, self.index[fn]) for fn in self.find_matches(ms)] if not pkgs: - raise RuntimeError("No packages found matching: %s" % ms) + raise NoPackagesFound("No packages found matching: %s" % ms, ms.spec) if max_only: maxpkg = max(pkgs) ret = [] @@ -262,7 +267,7 @@ def get_pkgs(self, ms, max_only=False): def get_max_dists(self, ms): pkgs = self.get_pkgs(ms, max_only=True) if not pkgs: - raise RuntimeError("No packages found matching: %s" % ms) + raise NoPackagesFound("No packages found matching: %s" % ms, ms.spec) for pkg in pkgs: yield pkg.fn @@ -371,11 +376,22 @@ def generate_version_eq(self, v, dists, include0=False): def get_dists(self, specs, max_only=False): dists = {} for spec in specs: + found = False + notfound = [] for pkg in self.get_pkgs(MatchSpec(spec), max_only=max_only): if pkg.fn in dists: + found = True continue - dists.update(self.all_deps(pkg.fn, max_only=max_only)) - dists[pkg.fn] = pkg + try: + dists.update(self.all_deps(pkg.fn, max_only=max_only)) + except NoPackagesFound as e: + # Ignore any package that has nonexisting dependencies. + notfound.append(e.pkg) + else: + dists[pkg.fn] = pkg + found = True + if not found: + raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), None) return dists @@ -387,25 +403,31 @@ def solve2(self, specs, features, guess=True, alg='sorter', returnall=False): # complicated cases that the pseudo-boolean solver does, but it's also # much faster when it does work. - dists = self.get_dists(specs, max_only=True) - - v = {} # map fn to variable number - w = {} # map variable number to fn - i = -1 # in case the loop doesn't run - for i, fn in enumerate(sorted(dists)): - v[fn] = i + 1 - w[i + 1] = fn - m = i + 1 - - dotlog.debug("Solving using max dists only") - clauses = self.gen_clauses(v, dists, specs, features) - solutions = min_sat(clauses) - - if len(solutions) == 1: - ret = [w[lit] for lit in solutions.pop(0) if 0 < lit] - if returnall: - return [ret] - return ret + try: + dists = self.get_dists(specs, max_only=True) + except NoPackagesFound: + # Handle packages that are not included because some dependencies + # couldn't be found. + pass + else: + v = {} # map fn to variable number + w = {} # map variable number to fn + i = -1 # in case the loop doesn't run + for i, fn in enumerate(sorted(dists)): + v[fn] = i + 1 + w[i + 1] = fn + m = i + 1 + + dotlog.debug("Solving using max dists only") + clauses = self.gen_clauses(v, dists, specs, features) + solutions = min_sat(clauses) + + + if len(solutions) == 1: + ret = [w[lit] for lit in solutions.pop(0) if 0 < lit] + if returnall: + return [ret] + return ret dists = self.get_dists(specs)
diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -3,13 +3,15 @@ import unittest from os.path import dirname, join -from conda.resolve import ver_eval, VersionSpec, MatchSpec, Package, Resolve +from conda.resolve import ver_eval, VersionSpec, MatchSpec, Package, Resolve, NoPackagesFound from .helpers import raises with open(join(dirname(__file__), 'index.json')) as fi: - r = Resolve(json.load(fi)) + index = json.load(fi) + +r = Resolve(index) f_mkl = set(['mkl']) @@ -672,9 +674,183 @@ def test_unsat(): def test_nonexistent(): r.msd_cache = {} - assert raises(RuntimeError, lambda: r.solve(['notarealpackage 2.0*']), 'No packages found') + assert raises(NoPackagesFound, lambda: r.solve(['notarealpackage 2.0*']), 'No packages found') # This exact version of NumPy does not exist - assert raises(RuntimeError, lambda: r.solve(['numpy 1.5']), 'No packages found') + assert raises(NoPackagesFound, lambda: r.solve(['numpy 1.5']), 'No packages found') + +def test_nonexistent_deps(): + index2 = index.copy() + index2['mypackage-1.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'python 3.3*', 'notarealpackage 2.0*'], + 'name': 'mypackage', + 'requires': ['nose 1.2.1', 'python 3.3'], + 'version': '1.0', + } + index2['mypackage-1.1-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'python 3.3*'], + 'name': 'mypackage', + 'requires': ['nose 1.2.1', 'python 3.3'], + 'version': '1.1', + } + r = Resolve(index2) + + assert set(r.find_matches(MatchSpec('mypackage'))) == { + 'mypackage-1.0-py33_0.tar.bz2', + 'mypackage-1.1-py33_0.tar.bz2', + } + assert set(r.get_dists(['mypackage']).keys()) == { + 'mypackage-1.1-py33_0.tar.bz2', + 'nose-1.1.2-py26_0.tar.bz2', + 'nose-1.1.2-py27_0.tar.bz2', + 'nose-1.1.2-py33_0.tar.bz2', + 'nose-1.2.1-py26_0.tar.bz2', + 'nose-1.2.1-py27_0.tar.bz2', + 'nose-1.2.1-py33_0.tar.bz2', + 'nose-1.3.0-py26_0.tar.bz2', + 'nose-1.3.0-py27_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-2.6.8-1.tar.bz2', + 'python-2.6.8-2.tar.bz2', + 'python-2.6.8-3.tar.bz2', + 'python-2.6.8-4.tar.bz2', + 'python-2.6.8-5.tar.bz2', + 'python-2.6.8-6.tar.bz2', + 'python-2.7.3-2.tar.bz2', + 'python-2.7.3-3.tar.bz2', + 'python-2.7.3-4.tar.bz2', + 'python-2.7.3-5.tar.bz2', + 'python-2.7.3-6.tar.bz2', + 'python-2.7.3-7.tar.bz2', + 'python-2.7.4-0.tar.bz2', + 'python-2.7.5-0.tar.bz2', + 'python-3.3.0-2.tar.bz2', + 'python-3.3.0-3.tar.bz2', + 'python-3.3.0-4.tar.bz2', + 'python-3.3.0-pro0.tar.bz2', + 'python-3.3.0-pro1.tar.bz2', + 'python-3.3.1-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + } + + assert set(r.get_dists(['mypackage'], max_only=True).keys()) == { + 'mypackage-1.1-py33_0.tar.bz2', + 'nose-1.3.0-py26_0.tar.bz2', + 'nose-1.3.0-py27_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-2.6.8-6.tar.bz2', + 'python-2.7.5-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + } + + assert r.solve(['mypackage']) == r.solve(['mypackage 1.1']) == [ + 'mypackage-1.1-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + assert raises(RuntimeError, lambda: r.solve(['mypackage 1.0'])) + + # This time, the latest version is messed up + index3 = index.copy() + index3['mypackage-1.1-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'python 3.3*', 'notarealpackage 2.0*'], + 'name': 'mypackage', + 'requires': ['nose 1.2.1', 'python 3.3'], + 'version': '1.1', + } + index3['mypackage-1.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'python 3.3*'], + 'name': 'mypackage', + 'requires': ['nose 1.2.1', 'python 3.3'], + 'version': '1.0', + } + r = Resolve(index3) + + assert set(r.find_matches(MatchSpec('mypackage'))) == { + 'mypackage-1.0-py33_0.tar.bz2', + 'mypackage-1.1-py33_0.tar.bz2', + } + assert set(r.get_dists(['mypackage']).keys()) == { + 'mypackage-1.0-py33_0.tar.bz2', + 'nose-1.1.2-py26_0.tar.bz2', + 'nose-1.1.2-py27_0.tar.bz2', + 'nose-1.1.2-py33_0.tar.bz2', + 'nose-1.2.1-py26_0.tar.bz2', + 'nose-1.2.1-py27_0.tar.bz2', + 'nose-1.2.1-py33_0.tar.bz2', + 'nose-1.3.0-py26_0.tar.bz2', + 'nose-1.3.0-py27_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-2.6.8-1.tar.bz2', + 'python-2.6.8-2.tar.bz2', + 'python-2.6.8-3.tar.bz2', + 'python-2.6.8-4.tar.bz2', + 'python-2.6.8-5.tar.bz2', + 'python-2.6.8-6.tar.bz2', + 'python-2.7.3-2.tar.bz2', + 'python-2.7.3-3.tar.bz2', + 'python-2.7.3-4.tar.bz2', + 'python-2.7.3-5.tar.bz2', + 'python-2.7.3-6.tar.bz2', + 'python-2.7.3-7.tar.bz2', + 'python-2.7.4-0.tar.bz2', + 'python-2.7.5-0.tar.bz2', + 'python-3.3.0-2.tar.bz2', + 'python-3.3.0-3.tar.bz2', + 'python-3.3.0-4.tar.bz2', + 'python-3.3.0-pro0.tar.bz2', + 'python-3.3.0-pro1.tar.bz2', + 'python-3.3.1-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + } + + assert raises(RuntimeError, lambda: r.get_dists(['mypackage'], max_only=True)) + + assert r.solve(['mypackage']) == r.solve(['mypackage 1.0']) == [ + 'mypackage-1.0-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + assert raises(NoPackagesFound, lambda: r.solve(['mypackage 1.1'])) def test_package_ordering(): sympy_071 = Package('sympy-0.7.1-py27_0.tar.bz2', r.index['sympy-0.7.1-py27_0.tar.bz2'])
Don't bail when a dependency can't be found When a dependency for a package can't be found, conda bails completely, but this can happen e.g., just for some old builds of something. So we should just exclude any package like this from the solver.
It can also happen if someone has a package on their binstar but not all the dependencies for it.
2014-03-24T18:23:13
conda/conda
662
conda__conda-662
[ "464" ]
3d4118668fca738984cce13d9235e0fc11a79df4
diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py --- a/conda/cli/main_remove.py +++ b/conda/cli/main_remove.py @@ -63,6 +63,7 @@ def execute(args, parser): from conda.api import get_index from conda.cli import pscheck from conda.install import rm_rf, linked + from conda import config if not (args.all or args.package_names): sys.exit('Error: no package names supplied,\n' @@ -71,12 +72,11 @@ def execute(args, parser): prefix = common.get_prefix(args) common.check_write('remove', prefix) - index = None + common.ensure_override_channels_requires_channel(args) + channel_urls = args.channel or () + index = get_index(channel_urls=channel_urls, + prepend=not args.override_channels) if args.features: - common.ensure_override_channels_requires_channel(args) - channel_urls = args.channel or () - index = get_index(channel_urls=channel_urls, - prepend=not args.override_channels) features = set(args.package_names) actions = plan.remove_features_actions(prefix, index, features) diff --git a/conda/plan.py b/conda/plan.py --- a/conda/plan.py +++ b/conda/plan.py @@ -20,7 +20,7 @@ from conda import install from conda.fetch import fetch_pkg from conda.history import History -from conda.resolve import MatchSpec, Resolve +from conda.resolve import MatchSpec, Resolve, Package from conda.utils import md5_file, human_bytes log = getLogger(__name__) @@ -60,7 +60,7 @@ def split_linkarg(arg): linktype = install.LINK_HARD return dist, pkgs_dir, int(linktype) -def display_actions(actions, index=None): +def display_actions(actions, index): if actions.get(FETCH): print("\nThe following packages will be downloaded:\n") @@ -79,19 +79,113 @@ def display_actions(actions, index=None): print(" " * 43 + "Total: %14s" % human_bytes(sum(index[dist + '.tar.bz2']['size'] for dist in actions[FETCH]))) - if actions.get(UNLINK): - print("\nThe following packages will be UN-linked:\n") - print_dists([ - (dist, None) - for dist in actions[UNLINK]]) - if actions.get(LINK): - print("\nThe following packages will be linked:\n") - lst = [] - for arg in actions[LINK]: - dist, pkgs_dir, lt = split_linkarg(arg) - extra = ' %s' % install.link_name_map.get(lt) - lst.append((dist, extra)) - print_dists(lst) + + # package -> [oldver-oldbuild, newver-newbuild] + packages = defaultdict(lambda: list(('', ''))) + features = defaultdict(lambda: list(('', ''))) + + # This assumes each package will appear in LINK no more than once. + Packages = {} + linktypes = {} + for arg in actions.get(LINK, []): + dist, pkgs_dir, lt = split_linkarg(arg) + pkg, ver, build = dist.rsplit('-', 2) + packages[pkg][1] = ver + '-' + build + Packages[dist] = Package(dist + '.tar.bz2', index[dist + '.tar.bz2']) + linktypes[pkg] = lt + features[pkg][1] = index[dist + '.tar.bz2'].get('features', '') + for arg in actions.get(UNLINK, []): + dist, pkgs_dir, lt = split_linkarg(arg) + pkg, ver, build = dist.rsplit('-', 2) + packages[pkg][0] = ver + '-' + build + Packages[dist] = Package(dist + '.tar.bz2', index[dist + '.tar.bz2']) + features[pkg][0] = index[dist + '.tar.bz2'].get('features', '') + + # Put a minimum length here---. .--For the : + # v v + maxpkg = max(len(max(packages or [''], key=len)), 0) + 1 + maxoldver = len(max(packages.values() or [['']], key=lambda i: len(i[0]))[0]) + maxnewver = len(max(packages.values() or [['', '']], key=lambda i: len(i[1]))[1]) + maxoldfeatures = len(max(features.values() or [['']], key=lambda i: len(i[0]))[0]) + maxnewfeatures = len(max(features.values() or [['', '']], key=lambda i: len(i[1]))[1]) + maxoldchannel = len(max([config.canonical_channel_name(Packages[pkg + '-' + + packages[pkg][0]].channel) for pkg in packages if packages[pkg][0]] or + [''], key=len)) + maxnewchannel = len(max([config.canonical_channel_name(Packages[pkg + '-' + + packages[pkg][1]].channel) for pkg in packages if packages[pkg][1]] or + [''], key=len)) + new = {pkg for pkg in packages if not packages[pkg][0]} + removed = {pkg for pkg in packages if not packages[pkg][1]} + updated = set() + downgraded = set() + oldfmt = {} + newfmt = {} + for pkg in packages: + # That's right. I'm using old-style string formatting to generate a + # string with new-style string formatting. + oldfmt[pkg] = '{pkg:<%s} {vers[0]:<%s}' % (maxpkg, maxoldver) + if config.show_channel_urls: + oldfmt[pkg] += ' {channel[0]:<%s}' % maxoldchannel + if packages[pkg][0]: + newfmt[pkg] = '{vers[1]:<%s}' % maxnewver + else: + newfmt[pkg] = '{pkg:<%s} {vers[1]:<%s}' % (maxpkg, maxnewver) + if config.show_channel_urls: + newfmt[pkg] += ' {channel[1]:<%s}' % maxnewchannel + # TODO: Should we also care about the old package's link type? + if pkg in linktypes and linktypes[pkg] != install.LINK_HARD: + newfmt[pkg] += ' (%s)' % install.link_name_map[linktypes[pkg]] + + if features[pkg][0]: + oldfmt[pkg] += ' [{features[0]:<%s}]' % maxoldfeatures + if features[pkg][1]: + newfmt[pkg] += ' [{features[1]:<%s}]' % maxnewfeatures + + if pkg in new or pkg in removed: + continue + P0 = Packages[pkg + '-' + packages[pkg][0]] + P1 = Packages[pkg + '-' + packages[pkg][1]] + try: + # <= here means that unchanged packages will be put in updated + newer = (P0.name, P0.norm_version, P0.build_number) <= (P1.name, P1.norm_version, P1.build_number) + except TypeError: + newer = (P0.name, P0.version, P0.build_number) <= (P1.name, P1.version, P1.build_number) + if newer: + updated.add(pkg) + else: + downgraded.add(pkg) + + arrow = ' --> ' + lead = ' '*4 + + def format(s, pkg): + channel = ['', ''] + for i in range(2): + if packages[pkg][i]: + channel[i] = config.canonical_channel_name(Packages[pkg + '-' + packages[pkg][i]].channel) + return lead + s.format(pkg=pkg+':', vers=packages[pkg], + channel=channel, features=features[pkg]) + + if new: + print("\nThe following NEW packages will be INSTALLED:\n") + for pkg in sorted(new): + print(format(newfmt[pkg], pkg)) + + if removed: + print("\nThe following packages will be REMOVED:\n") + for pkg in sorted(removed): + print(format(oldfmt[pkg], pkg)) + + if updated: + print("\nThe following packages will be UPDATED:\n") + for pkg in sorted(updated): + print(format(oldfmt[pkg] + arrow + newfmt[pkg], pkg)) + + if downgraded: + print("\nThe following packages will be DOWNGRADED:\n") + for pkg in sorted(downgraded): + print(format(oldfmt[pkg] + arrow + newfmt[pkg], pkg)) + print() # the order matters here, don't change it
diff --git a/tests/helpers.py b/tests/helpers.py --- a/tests/helpers.py +++ b/tests/helpers.py @@ -5,6 +5,8 @@ import sys import os +from contextlib import contextmanager + def raises(exception, func, string=None): try: a = func() @@ -35,3 +37,31 @@ def run_conda_command(*args): stdout, stderr = p.communicate() return (stdout.decode('utf-8').replace('\r\n', '\n'), stderr.decode('utf-8').replace('\r\n', '\n')) + +class CapturedText(object): + pass + +@contextmanager +def captured(): + """ + Context manager to capture the printed output of the code in the with block + + Bind the context manager to a variable using `as` and the result will be + in the stdout property. + + >>> from tests.helpers import capture + >>> with captured() as c: + ... print('hello world!') + ... + >>> c.stdout + 'hello world!\n' + """ + from conda.compat import StringIO + import sys + + stdout = sys.stdout + sys.stdout = file = StringIO() + c = CapturedText() + yield c + c.stdout = file.getvalue() + sys.stdout = stdout diff --git a/tests/test_plan.py b/tests/test_plan.py --- a/tests/test_plan.py +++ b/tests/test_plan.py @@ -1,15 +1,20 @@ import json import unittest from os.path import dirname, join +from collections import defaultdict from conda.config import default_python, pkgs_dirs +import conda.config from conda.install import LINK_HARD import conda.plan as plan +from conda.plan import display_actions from conda.resolve import Resolve +from tests.helpers import captured with open(join(dirname(__file__), 'index.json')) as fi: - r = Resolve(json.load(fi)) + index = json.load(fi) + r = Resolve(index) def solve(specs): return [fn[:-8] for fn in r.solve(specs)] @@ -77,3 +82,685 @@ def test_4(self): (['anaconda', 'python 3*'], []), ]: self.check(specs, added) + +def test_display_actions(): + conda.config.show_channel_urls = False + actions = defaultdict(list, {"FETCH": ['sympy-0.7.2-py27_0', + "numpy-1.7.1-py27_0"]}) + # The older test index doesn't have the size metadata + index['sympy-0.7.2-py27_0.tar.bz2']['size'] = 4374752 + index["numpy-1.7.1-py27_0.tar.bz2"]['size'] = 5994338 + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be downloaded: + + package | build + ---------------------------|----------------- + sympy-0.7.2 | py27_0 4.2 MB + numpy-1.7.1 | py27_0 5.7 MB + ------------------------------------------------------------ + Total: 9.9 MB + +""" + + actions = defaultdict(list, {'PREFIX': + '/Users/aaronmeurer/anaconda/envs/test', 'SYMLINK_CONDA': + ['/Users/aaronmeurer/anaconda'], 'LINK': ['python-3.3.2-0', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 1', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + python: 3.3.2-0 \n\ + readline: 6.2-0 \n\ + sqlite: 3.7.13-0 + tk: 8.5.13-0 + zlib: 1.2.7-0 \n\ + +""" + + actions['UNLINK'] = actions['LINK'] + actions['LINK'] = [] + + with captured() as c: + display_actions(actions, index) + + + assert c.stdout == """ +The following packages will be REMOVED: + + python: 3.3.2-0 \n\ + readline: 6.2-0 \n\ + sqlite: 3.7.13-0 + tk: 8.5.13-0 + zlib: 1.2.7-0 \n\ + +""" + + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0'], 'UNLINK': + ['cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 --> 0.19-py33_0 + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0', + 'dateutil-1.5-py33_0', 'numpy-1.7.1-py33_0'], 'UNLINK': + ['cython-0.19-py33_0', 'dateutil-2.1-py33_1', 'pip-1.3.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + numpy: 1.7.1-py33_0 \n\ + +The following packages will be REMOVED: + + pip: 1.3.1-py33_1 + +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 + +The following packages will be DOWNGRADED: + + dateutil: 2.1-py33_1 --> 1.5-py33_0 \n\ + +""" + + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 + dateutil: 1.5-py33_0 --> 2.1-py33_1 \n\ + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 --> 0.19-py33_0 + dateutil: 2.1-py33_1 --> 1.5-py33_0 \n\ + +""" + + + +def test_display_actions_show_channel_urls(): + conda.config.show_channel_urls = True + actions = defaultdict(list, {"FETCH": ['sympy-0.7.2-py27_0', + "numpy-1.7.1-py27_0"]}) + # The older test index doesn't have the size metadata + index['sympy-0.7.2-py27_0.tar.bz2']['size'] = 4374752 + index["numpy-1.7.1-py27_0.tar.bz2"]['size'] = 5994338 + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be downloaded: + + package | build + ---------------------------|----------------- + sympy-0.7.2 | py27_0 4.2 MB <unknown> + numpy-1.7.1 | py27_0 5.7 MB <unknown> + ------------------------------------------------------------ + Total: 9.9 MB + +""" + + + actions = defaultdict(list, {'PREFIX': + '/Users/aaronmeurer/anaconda/envs/test', 'SYMLINK_CONDA': + ['/Users/aaronmeurer/anaconda'], 'LINK': ['python-3.3.2-0', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 1', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + python: 3.3.2-0 <unknown> + readline: 6.2-0 <unknown> + sqlite: 3.7.13-0 <unknown> + tk: 8.5.13-0 <unknown> + zlib: 1.2.7-0 <unknown> + +""" + + actions['UNLINK'] = actions['LINK'] + actions['LINK'] = [] + + with captured() as c: + display_actions(actions, index) + + + assert c.stdout == """ +The following packages will be REMOVED: + + python: 3.3.2-0 <unknown> + readline: 6.2-0 <unknown> + sqlite: 3.7.13-0 <unknown> + tk: 8.5.13-0 <unknown> + zlib: 1.2.7-0 <unknown> + +""" + + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0'], 'UNLINK': + ['cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 <unknown> --> 0.19.1-py33_0 <unknown> + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 <unknown> --> 0.19-py33_0 <unknown> + +""" + + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0', + 'dateutil-1.5-py33_0', 'numpy-1.7.1-py33_0'], 'UNLINK': + ['cython-0.19-py33_0', 'dateutil-2.1-py33_1', 'pip-1.3.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + numpy: 1.7.1-py33_0 <unknown> + +The following packages will be REMOVED: + + pip: 1.3.1-py33_1 <unknown> + +The following packages will be UPDATED: + + cython: 0.19-py33_0 <unknown> --> 0.19.1-py33_0 <unknown> + +The following packages will be DOWNGRADED: + + dateutil: 2.1-py33_1 <unknown> --> 1.5-py33_0 <unknown> + +""" + + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 <unknown> --> 0.19.1-py33_0 <unknown> + dateutil: 1.5-py33_0 <unknown> --> 2.1-py33_1 <unknown> + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 <unknown> --> 0.19-py33_0 <unknown> + dateutil: 2.1-py33_1 <unknown> --> 1.5-py33_0 <unknown> + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + index['cython-0.19.1-py33_0.tar.bz2']['channel'] = 'my_channel' + index['dateutil-1.5-py33_0.tar.bz2']['channel'] = 'my_channel' + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 <unknown> --> 0.19.1-py33_0 my_channel + dateutil: 1.5-py33_0 my_channel --> 2.1-py33_1 <unknown> \n\ + +""" + + actions['LINK'], actions['UNLINK'] = actions['UNLINK'], actions['LINK'] + + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 my_channel --> 0.19-py33_0 <unknown> \n\ + dateutil: 2.1-py33_1 <unknown> --> 1.5-py33_0 my_channel + +""" + + +def test_display_actions_link_type(): + conda.config.show_channel_urls = False + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 2', 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 2', + 'numpy-1.7.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 2', 'python-3.3.2-0 /Users/aaronmeurer/anaconda/pkgs 2', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 2', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 2', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 2', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 2']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19.1-py33_0 (soft-link) + dateutil: 1.5-py33_0 (soft-link) + numpy: 1.7.1-py33_0 (soft-link) + python: 3.3.2-0 (soft-link) + readline: 6.2-0 (soft-link) + sqlite: 3.7.13-0 (soft-link) + tk: 8.5.13-0 (soft-link) + zlib: 1.2.7-0 (soft-link) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 2', + 'dateutil-2.1-py33_1 /Users/aaronmeurer/anaconda/pkgs 2'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 (soft-link) + dateutil: 1.5-py33_0 --> 2.1-py33_1 (soft-link) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19-py33_0 /Users/aaronmeurer/anaconda/pkgs 2', + 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 2'], 'UNLINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 --> 0.19-py33_0 (soft-link) + dateutil: 2.1-py33_1 --> 1.5-py33_0 (soft-link) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 1', 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 1', + 'numpy-1.7.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 1', 'python-3.3.2-0 /Users/aaronmeurer/anaconda/pkgs 1', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 1', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 1', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19.1-py33_0 + dateutil: 1.5-py33_0 \n\ + numpy: 1.7.1-py33_0 \n\ + python: 3.3.2-0 \n\ + readline: 6.2-0 \n\ + sqlite: 3.7.13-0 \n\ + tk: 8.5.13-0 \n\ + zlib: 1.2.7-0 \n\ + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 1', + 'dateutil-2.1-py33_1 /Users/aaronmeurer/anaconda/pkgs 1'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 + dateutil: 1.5-py33_0 --> 2.1-py33_1 \n\ + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19-py33_0 /Users/aaronmeurer/anaconda/pkgs 1', + 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 1'], 'UNLINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 --> 0.19-py33_0 + dateutil: 2.1-py33_1 --> 1.5-py33_0 \n\ + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'numpy-1.7.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', 'python-3.3.2-0 /Users/aaronmeurer/anaconda/pkgs 3', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 3', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 3', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 3', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 3']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19.1-py33_0 (copy) + dateutil: 1.5-py33_0 (copy) + numpy: 1.7.1-py33_0 (copy) + python: 3.3.2-0 (copy) + readline: 6.2-0 (copy) + sqlite: 3.7.13-0 (copy) + tk: 8.5.13-0 (copy) + zlib: 1.2.7-0 (copy) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'dateutil-2.1-py33_1 /Users/aaronmeurer/anaconda/pkgs 3'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 --> 0.19.1-py33_0 (copy) + dateutil: 1.5-py33_0 --> 2.1-py33_1 (copy) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 3'], 'UNLINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 --> 0.19-py33_0 (copy) + dateutil: 2.1-py33_1 --> 1.5-py33_0 (copy) + +""" + + conda.config.show_channel_urls = True + + index['cython-0.19.1-py33_0.tar.bz2']['channel'] = 'my_channel' + index['dateutil-1.5-py33_0.tar.bz2']['channel'] = 'my_channel' + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'numpy-1.7.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', 'python-3.3.2-0 /Users/aaronmeurer/anaconda/pkgs 3', 'readline-6.2-0 /Users/aaronmeurer/anaconda/pkgs 3', 'sqlite-3.7.13-0 /Users/aaronmeurer/anaconda/pkgs 3', 'tk-8.5.13-0 /Users/aaronmeurer/anaconda/pkgs 3', 'zlib-1.2.7-0 /Users/aaronmeurer/anaconda/pkgs 3']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19.1-py33_0 my_channel (copy) + dateutil: 1.5-py33_0 my_channel (copy) + numpy: 1.7.1-py33_0 <unknown> (copy) + python: 3.3.2-0 <unknown> (copy) + readline: 6.2-0 <unknown> (copy) + sqlite: 3.7.13-0 <unknown> (copy) + tk: 8.5.13-0 <unknown> (copy) + zlib: 1.2.7-0 <unknown> (copy) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19.1-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'dateutil-2.1-py33_1 /Users/aaronmeurer/anaconda/pkgs 3'], 'UNLINK': ['cython-0.19-py33_0', + 'dateutil-1.5-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + cython: 0.19-py33_0 <unknown> --> 0.19.1-py33_0 my_channel (copy) + dateutil: 1.5-py33_0 my_channel --> 2.1-py33_1 <unknown> (copy) + +""" + + actions = defaultdict(list, {'LINK': ['cython-0.19-py33_0 /Users/aaronmeurer/anaconda/pkgs 3', + 'dateutil-1.5-py33_0 /Users/aaronmeurer/anaconda/pkgs 3'], 'UNLINK': ['cython-0.19.1-py33_0', + 'dateutil-2.1-py33_1']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + cython: 0.19.1-py33_0 my_channel --> 0.19-py33_0 <unknown> (copy) + dateutil: 2.1-py33_1 <unknown> --> 1.5-py33_0 my_channel (copy) + +""" + +def test_display_actions_features(): + conda.config.show_channel_urls = False + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0', 'cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19-py33_0 \n\ + numpy: 1.7.1-py33_p0 [mkl] + +""" + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0', 'cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be REMOVED: + + cython: 0.19-py33_0 \n\ + numpy: 1.7.1-py33_p0 [mkl] + +""" + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0'], 'LINK': ['numpy-1.7.0-py33_p0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + numpy: 1.7.1-py33_p0 [mkl] --> 1.7.0-py33_p0 [mkl] + +""" + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0'], 'UNLINK': ['numpy-1.7.0-py33_p0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.0-py33_p0 [mkl] --> 1.7.1-py33_p0 [mkl] + +""" + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0'], 'UNLINK': ['numpy-1.7.1-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + # NB: Packages whose version do not changed are put in UPDATED + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.1-py33_0 --> 1.7.1-py33_p0 [mkl] + +""" + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0'], 'LINK': ['numpy-1.7.1-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.1-py33_p0 [mkl] --> 1.7.1-py33_0 + +""" + + conda.config.show_channel_urls = True + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0', 'cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following NEW packages will be INSTALLED: + + cython: 0.19-py33_0 <unknown> + numpy: 1.7.1-py33_p0 <unknown> [mkl] + +""" + + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0', 'cython-0.19-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be REMOVED: + + cython: 0.19-py33_0 <unknown> + numpy: 1.7.1-py33_p0 <unknown> [mkl] + +""" + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0'], 'LINK': ['numpy-1.7.0-py33_p0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be DOWNGRADED: + + numpy: 1.7.1-py33_p0 <unknown> [mkl] --> 1.7.0-py33_p0 <unknown> [mkl] + +""" + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0'], 'UNLINK': ['numpy-1.7.0-py33_p0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.0-py33_p0 <unknown> [mkl] --> 1.7.1-py33_p0 <unknown> [mkl] + +""" + + + actions = defaultdict(list, {'LINK': ['numpy-1.7.1-py33_p0'], 'UNLINK': ['numpy-1.7.1-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + # NB: Packages whose version do not changed are put in UPDATED + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.1-py33_0 <unknown> --> 1.7.1-py33_p0 <unknown> [mkl] + +""" + + actions = defaultdict(list, {'UNLINK': ['numpy-1.7.1-py33_p0'], 'LINK': ['numpy-1.7.1-py33_0']}) + + with captured() as c: + display_actions(actions, index) + + assert c.stdout == """ +The following packages will be UPDATED: + + numpy: 1.7.1-py33_p0 <unknown> [mkl] --> 1.7.1-py33_0 <unknown> + +"""
Make the conda install table easier to read The table of what packages will be installed and removed is hard to read. For one thing, it's hard to tell easily what packages are not removed but just upgraded or downgraded. Also, the "link" terminology is confusing. A suggestion by @jklowden: ``` $ conda update conda Updating Anaconda environment at /usr/local/anaconda The following packages will be downloaded: conda-2.2.3-py27_0.tar.bz2 [http://repo.continuum.io/pkgs/free/osx-64/] The following packages will be upgraded: Old version Replace with ------------------------- ------------------------- conda-1.4.4 conda-2.2.3 ``` > or, if you really want the build (I don't, it's not meaningful to the user) ``` package Old version New version ------------ ------------------ ------------------ conda 1.4.4, py27_0 2.2.3, py27_0 ``` I think the build is meaningful as it tells you what Python version is being used. It also tells you if you are using mkl. And also some people might use the build string to put other information which may be useful to users. <!--- @huboard:{"order":3.3142282405143226e-49,"custom_state":""} -->
2014-04-11T20:19:51
conda/conda
667
conda__conda-667
[ "666" ]
f2934aea3f32ac94907b742a800d82c1e08757fe
diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -278,12 +278,25 @@ def all_deps(self, root_fn, max_only=False): def add_dependents(fn1, max_only=False): for ms in self.ms_depends(fn1): + found = False + notfound = [] for pkg2 in self.get_pkgs(ms, max_only=max_only): if pkg2.fn in res: + found = True continue - res[pkg2.fn] = pkg2 - if ms.strictness < 3: - add_dependents(pkg2.fn, max_only=max_only) + try: + if ms.strictness < 3: + add_dependents(pkg2.fn, max_only=max_only) + except NoPackagesFound as e: + if e.pkg not in notfound: + notfound.append(e.pkg) + else: + found = True + res[pkg2.fn] = pkg2 + + if not found: + raise NoPackagesFound("Could not find some dependencies " + "for %s: %s" % (ms, ', '.join(notfound)), str(ms)) add_dependents(root_fn, max_only=max_only) return res @@ -394,7 +407,7 @@ def get_dists(self, specs, max_only=False): dists[pkg.fn] = pkg found = True if not found: - raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), None) + raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), spec) return dists
diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -696,6 +696,22 @@ def test_nonexistent_deps(): 'requires': ['nose 1.2.1', 'python 3.3'], 'version': '1.1', } + index2['anotherpackage-1.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'mypackage 1.1'], + 'name': 'anotherpackage', + 'requires': ['nose', 'mypackage 1.1'], + 'version': '1.0', + } + index2['anotherpackage-2.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'mypackage'], + 'name': 'anotherpackage', + 'requires': ['nose', 'mypackage'], + 'version': '2.0', + } r = Resolve(index2) assert set(r.find_matches(MatchSpec('mypackage'))) == { @@ -772,6 +788,32 @@ def test_nonexistent_deps(): ] assert raises(NoPackagesFound, lambda: r.solve(['mypackage 1.0'])) + assert r.solve(['anotherpackage 1.0']) == [ + 'anotherpackage-1.0-py33_0.tar.bz2', + 'mypackage-1.1-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + + assert r.solve(['anotherpackage']) == [ + 'anotherpackage-2.0-py33_0.tar.bz2', + 'mypackage-1.1-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + # This time, the latest version is messed up index3 = index.copy() index3['mypackage-1.1-py33_0.tar.bz2'] = { @@ -790,6 +832,22 @@ def test_nonexistent_deps(): 'requires': ['nose 1.2.1', 'python 3.3'], 'version': '1.0', } + index3['anotherpackage-1.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'mypackage 1.0'], + 'name': 'anotherpackage', + 'requires': ['nose', 'mypackage 1.0'], + 'version': '1.0', + } + index3['anotherpackage-2.0-py33_0.tar.bz2'] = { + 'build': 'py33_0', + 'build_number': 0, + 'depends': ['nose', 'mypackage'], + 'name': 'anotherpackage', + 'requires': ['nose', 'mypackage'], + 'version': '2.0', + } r = Resolve(index3) assert set(r.find_matches(MatchSpec('mypackage'))) == { @@ -852,6 +910,35 @@ def test_nonexistent_deps(): ] assert raises(NoPackagesFound, lambda: r.solve(['mypackage 1.1'])) + + assert r.solve(['anotherpackage 1.0']) == [ + 'anotherpackage-1.0-py33_0.tar.bz2', + 'mypackage-1.0-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + + # If recursive checking is working correctly, this will give + # anotherpackage 2.0, not anotherpackage 1.0 + assert r.solve(['anotherpackage']) == [ + 'anotherpackage-2.0-py33_0.tar.bz2', + 'mypackage-1.0-py33_0.tar.bz2', + 'nose-1.3.0-py33_0.tar.bz2', + 'openssl-1.0.1c-0.tar.bz2', + 'python-3.3.2-0.tar.bz2', + 'readline-6.2-0.tar.bz2', + 'sqlite-3.7.13-0.tar.bz2', + 'system-5.8-1.tar.bz2', + 'tk-8.5.13-0.tar.bz2', + 'zlib-1.2.7-0.tar.bz2', + ] + def test_package_ordering(): sympy_071 = Package('sympy-0.7.1-py27_0.tar.bz2', r.index['sympy-0.7.1-py27_0.tar.bz2']) sympy_072 = Package('sympy-0.7.2-py27_0.tar.bz2', r.index['sympy-0.7.2-py27_0.tar.bz2'])
NoPackagesFound does not work correctly for missing recursive dependencies
2014-04-14T22:05:18
conda/conda
682
conda__conda-682
[ "400" ]
102471a0fe64749a94ea0c1c9ddc45d17fd4f2d4
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -7,106 +7,368 @@ from __future__ import print_function, division, absolute_import from logging import getLogger +import re +import mimetypes +import os +import email +import base64 +import ftplib +import cgi +from io import BytesIO -from conda.compat import PY3, string_types -from conda.compat import iteritems, input +from conda.compat import urlparse, StringIO from conda.config import get_proxy_servers -if PY3: - # Python 3.x - import urllib.request as urllib2 - from urllib import parse as urlparse -else: - # Python 2.x - import urllib2 - import urlparse +import requests +RETRIES = 3 log = getLogger(__name__) -# 1. get proxies if needed. a proxy for each protocol -# 2. handle authentication -# basic, digest, and nltm (windows) authentications should be handled. -# 3. handle any protocol -# typically http, https, ftp - -# 1. get the proxies list -# urllib can only get proxies on windows and mac. so on linux or if the user -# wants to specify the proxy there has to be a way to do that. TODO get proxies -# from condarc and overrwrite any system proxies -# the proxies are in a dict {'http':'http://proxy:8080'} -# protocol:proxyserver -proxies_dict = get_proxy_servers() or urllib2.getproxies() - -#2. handle authentication - -proxypwdmgr = urllib2.HTTPPasswordMgrWithDefaultRealm() - - -def get_userandpass(proxytype='', realm=''): - """a function to get username and password from terminal. - can be replaced with anything like some gui""" - import getpass - - uname = input(proxytype + ' proxy username:') - pword = getpass.getpass() - return uname, pword - - -# a procedure that needs to be executed with changes to handlers -def installopener(): - opener = urllib2.build_opener( - urllib2.ProxyHandler(proxies_dict), - urllib2.ProxyBasicAuthHandler(proxypwdmgr), - urllib2.ProxyDigestAuthHandler(proxypwdmgr), - urllib2.HTTPHandler, - ) - # digest auth may not work with all proxies - # http://bugs.python.org/issue16095 - # could add windows/nltm authentication here - #opener=urllib2.build_opener(urllib2.ProxyHandler(proxies_dict), urllib2.HTTPHandler) - - urllib2.install_opener(opener) - - -firstconnection = True -#i made this func so i wouldn't alter the original code much -def connectionhandled_urlopen(request): - """handles aspects of establishing the connection with the remote""" - - installopener() - - if isinstance(request, string_types): - request = urllib2.Request(request) - - try: - return urllib2.urlopen(request) - - except urllib2.HTTPError as HTTPErrorinst: - if HTTPErrorinst.code in (407, 401): - # proxy authentication error - # ...(need to auth) or supplied creds failed - if HTTPErrorinst.code == 401: - log.debug('proxy authentication failed') - #authenticate and retry - uname, pword = get_userandpass() - #assign same user+pwd to all protocols (a reasonable assumption) to - #decrease user input. otherwise you'd need to assign a user/pwd to - #each proxy type - if firstconnection == True: - for aprotocol, aproxy in iteritems(proxies_dict): - proxypwdmgr.add_password(None, aproxy, uname, pword) - firstconnection == False - else: #...assign a uname pwd for the specific protocol proxy type - assert(firstconnection == False) - protocol = urlparse.urlparse(request.get_full_url()).scheme - proxypwdmgr.add_password(None, proxies_dict[protocol], - uname, pword) - installopener() - # i'm uncomfortable with this - # but i just want to exec to start from the top again - return connectionhandled_urlopen(request) - raise - - except: - raise +# Modified from code in pip/download.py: + +# Copyright (c) 2008-2014 The pip developers (see AUTHORS.txt file) +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +class CondaSession(requests.Session): + + timeout = None + + def __init__(self, *args, **kwargs): + retries = kwargs.pop('retries', RETRIES) + + super(CondaSession, self).__init__(*args, **kwargs) + + self.proxies = get_proxy_servers() + + # Configure retries + if retries: + http_adapter = requests.adapters.HTTPAdapter(max_retries=retries) + self.mount("http://", http_adapter) + self.mount("https://", http_adapter) + + # Enable file:// urls + self.mount("file://", LocalFSAdapter()) + + # Enable ftp:// urls + self.mount("ftp://", FTPAdapter()) + +class LocalFSAdapter(requests.adapters.BaseAdapter): + + def send(self, request, stream=None, timeout=None, verify=None, cert=None, + proxies=None): + pathname = url_to_path(request.url) + + resp = requests.models.Response() + resp.status_code = 200 + resp.url = request.url + + try: + stats = os.stat(pathname) + except OSError as exc: + resp.status_code = 404 + resp.raw = exc + else: + modified = email.utils.formatdate(stats.st_mtime, usegmt=True) + content_type = mimetypes.guess_type(pathname)[0] or "text/plain" + resp.headers = requests.structures.CaseInsensitiveDict({ + "Content-Type": content_type, + "Content-Length": stats.st_size, + "Last-Modified": modified, + }) + + resp.raw = open(pathname, "rb") + resp.close = resp.raw.close + + return resp + + def close(self): + pass + +def url_to_path(url): + """ + Convert a file: URL to a path. + """ + assert url.startswith('file:'), ( + "You can only turn file: urls into filenames (not %r)" % url) + path = url[len('file:'):].lstrip('/') + path = urlparse.unquote(path) + if _url_drive_re.match(path): + path = path[0] + ':' + path[2:] + else: + path = '/' + path + return path + +_url_drive_re = re.compile('^([a-z])[:|]', re.I) + +# Taken from requests-ftp +# (https://github.com/Lukasa/requests-ftp/blob/master/requests_ftp/ftp.py) + +# Copyright 2012 Cory Benfield + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +class FTPAdapter(requests.adapters.BaseAdapter): + '''A Requests Transport Adapter that handles FTP urls.''' + def __init__(self): + super(FTPAdapter, self).__init__() + + # Build a dictionary keyed off the methods we support in upper case. + # The values of this dictionary should be the functions we use to + # send the specific queries. + self.func_table = {'LIST': self.list, + 'RETR': self.retr, + 'STOR': self.stor, + 'NLST': self.nlst, + 'GET': self.retr,} + + def send(self, request, **kwargs): + '''Sends a PreparedRequest object over FTP. Returns a response object. + ''' + # Get the authentication from the prepared request, if any. + auth = self.get_username_password_from_header(request) + + # Next, get the host and the path. + host, port, path = self.get_host_and_path_from_url(request) + + # Sort out the timeout. + timeout = kwargs.get('timeout', None) + + # Establish the connection and login if needed. + self.conn = ftplib.FTP() + self.conn.connect(host, port, timeout) + + if auth is not None: + self.conn.login(auth[0], auth[1]) + else: + self.conn.login() + + # Get the method and attempt to find the function to call. + resp = self.func_table[request.method](path, request) + + # Return the response. + return resp + + def close(self): + '''Dispose of any internal state.''' + # Currently this is a no-op. + pass + + def list(self, path, request): + '''Executes the FTP LIST command on the given path.''' + data = StringIO() + + # To ensure the StringIO gets cleaned up, we need to alias its close + # method to the release_conn() method. This is a dirty hack, but there + # you go. + data.release_conn = data.close + + self.conn.cwd(path) + code = self.conn.retrbinary('LIST', data_callback_factory(data)) + + # When that call has finished executing, we'll have all our data. + response = build_text_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def retr(self, path, request): + '''Executes the FTP RETR command on the given path.''' + data = BytesIO() + + # To ensure the BytesIO gets cleaned up, we need to alias its close + # method. See self.list(). + data.release_conn = data.close + + code = self.conn.retrbinary('RETR ' + path, data_callback_factory(data)) + + response = build_binary_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def stor(self, path, request): + '''Executes the FTP STOR command on the given path.''' + + # First, get the file handle. We assume (bravely) + # that there is only one file to be sent to a given URL. We also + # assume that the filename is sent as part of the URL, not as part of + # the files argument. Both of these assumptions are rarely correct, + # but they are easy. + data = parse_multipart_files(request) + + # Split into the path and the filename. + path, filename = os.path.split(path) + + # Switch directories and upload the data. + self.conn.cwd(path) + code = self.conn.storbinary('STOR ' + filename, data) + + # Close the connection and build the response. + self.conn.close() + + response = build_binary_response(request, BytesIO(), code) + + return response + + def nlst(self, path, request): + '''Executes the FTP NLST command on the given path.''' + data = StringIO() + + # Alias the close method. + data.release_conn = data.close + + self.conn.cwd(path) + code = self.conn.retrbinary('NLST', data_callback_factory(data)) + + # When that call has finished executing, we'll have all our data. + response = build_text_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def get_username_password_from_header(self, request): + '''Given a PreparedRequest object, reverse the process of adding HTTP + Basic auth to obtain the username and password. Allows the FTP adapter + to piggyback on the basic auth notation without changing the control + flow.''' + auth_header = request.headers.get('Authorization') + + if auth_header: + # The basic auth header is of the form 'Basic xyz'. We want the + # second part. Check that we have the right kind of auth though. + encoded_components = auth_header.split()[:2] + if encoded_components[0] != 'Basic': + raise AuthError('Invalid form of Authentication used.') + else: + encoded = encoded_components[1] + + # Decode the base64 encoded string. + decoded = base64.b64decode(encoded) + + # The string is of the form 'username:password'. Split on the + # colon. + components = decoded.split(':') + username = components[0] + password = components[1] + return (username, password) + else: + # No auth header. Return None. + return None + + def get_host_and_path_from_url(self, request): + '''Given a PreparedRequest object, split the URL in such a manner as to + determine the host and the path. This is a separate method to wrap some + of urlparse's craziness.''' + url = request.url + # scheme, netloc, path, params, query, fragment = urlparse(url) + parsed = urlparse.urlparse(url) + path = parsed.path + + # If there is a slash on the front of the path, chuck it. + if path[0] == '/': + path = path[1:] + + host = parsed.hostname + port = parsed.port or 0 + + return (host, port, path) + +def data_callback_factory(variable): + '''Returns a callback suitable for use by the FTP library. This callback + will repeatedly save data into the variable provided to this function. This + variable should be a file-like structure.''' + def callback(data): + variable.write(data) + return + + return callback + +class AuthError(Exception): + '''Denotes an error with authentication.''' + pass + +def build_text_response(request, data, code): + '''Build a response for textual data.''' + return build_response(request, data, code, 'ascii') + +def build_binary_response(request, data, code): + '''Build a response for data whose encoding is unknown.''' + return build_response(request, data, code, None) + +def build_response(request, data, code, encoding): + '''Builds a response object from the data returned by ftplib, using the + specified encoding.''' + response = requests.Response() + + response.encoding = encoding + + # Fill in some useful fields. + response.raw = data + response.url = request.url + response.request = request + response.status_code = code.split()[0] + + # Make sure to seek the file-like raw object back to the start. + response.raw.seek(0) + + # Run the response hook. + response = requests.hooks.dispatch_hook('response', request.hooks, response) + return response + +def parse_multipart_files(request): + '''Given a prepared reqest, return a file-like object containing the + original data. This is pretty hacky.''' + # Start by grabbing the pdict. + _, pdict = cgi.parse_header(request.headers['Content-Type']) + + # Now, wrap the multipart data in a BytesIO buffer. This is annoying. + buf = BytesIO() + buf.write(request.body) + buf.seek(0) + + # Parse the data. Simply take the first file. + data = cgi.parse_multipart(buf, pdict) + _, filedata = data.popitem() + buf.close() + + # Get a BytesIO now, and write the file into it. + buf = BytesIO() + buf.write(''.join(filedata)) + buf.seek(0) + + return buf diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -8,7 +8,6 @@ import os import bz2 -import sys import json import shutil import hashlib @@ -18,22 +17,18 @@ from conda import config from conda.utils import memoized -from conda.connection import connectionhandled_urlopen -from conda.compat import PY3, itervalues, get_http_value +from conda.connection import CondaSession +from conda.compat import itervalues, get_http_value from conda.lock import Locked -if PY3: - import urllib.request as urllib2 -else: - import urllib2 - +import requests log = getLogger(__name__) dotlog = getLogger('dotupdate') stdoutlog = getLogger('stdoutlog') +stderrlog = getLogger('stderrlog') fail_unknown_host = False -retries = 3 def create_cache_dir(): @@ -55,9 +50,11 @@ def add_http_value_to_dict(u, http_key, d, dict_key): d[dict_key] = value -def fetch_repodata(url, cache_dir=None, use_cache=False): +def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): dotlog.debug("fetching repodata: %s ..." % url) + session = session or CondaSession() + cache_path = join(cache_dir or create_cache_dir(), cache_fn_url(url)) try: cache = json.load(open(cache_path)) @@ -67,33 +64,32 @@ def fetch_repodata(url, cache_dir=None, use_cache=False): if use_cache: return cache - request = urllib2.Request(url + 'repodata.json.bz2') - if '_etag' in cache: - request.add_header('If-None-Match', cache['_etag']) - if '_mod' in cache: - request.add_header('If-Modified-Since', cache['_mod']) + headers = {} + if "_tag" in cache: + headers["If-None-Match"] = cache["_etag"] + if "_mod" in cache: + headers["If-Modified-Since"] = cache["_mod"] try: - u = connectionhandled_urlopen(request) - data = u.read() - u.close() - cache = json.loads(bz2.decompress(data).decode('utf-8')) - add_http_value_to_dict(u, 'Etag', cache, '_etag') - add_http_value_to_dict(u, 'Last-Modified', cache, '_mod') + resp = session.get(url + 'repodata.json.bz2', headers=headers) + resp.raise_for_status() + if resp.status_code != 304: + cache = json.loads(bz2.decompress(resp.content).decode('utf-8')) except ValueError: raise RuntimeError("Invalid index file: %srepodata.json.bz2" % url) - except urllib2.HTTPError as e: - msg = "HTTPError: %d %s %s\n" % (e.code, e.msg, url) + except requests.exceptions.HTTPError as e: + msg = "HTTPError: %s: %s\n" % (e, url) log.debug(msg) - if e.code != 304: - raise RuntimeError(msg) + raise RuntimeError(msg) - except urllib2.URLError as e: - sys.stderr.write("Error: unknown host: %s (%r)\n" % (url, e)) + except requests.exceptions.ConnectionError as e: + msg = "Connection error: %s: %s\n" % (e, url) + stderrlog.info('Could not connect to %s\n' % url) + log.debug(msg) if fail_unknown_host: - sys.exit(1) + raise RuntimeError(msg) cache['_url'] = url try: @@ -104,16 +100,16 @@ def fetch_repodata(url, cache_dir=None, use_cache=False): return cache or None - @memoized def fetch_index(channel_urls, use_cache=False, unknown=False): log.debug('channel_urls=' + repr(channel_urls)) index = {} stdoutlog.info("Fetching package metadata: ") + session = CondaSession() for url in reversed(channel_urls): if config.allowed_channels and url not in config.allowed_channels: sys.exit("\nError: URL '%s' not in allowed channels" % url) - repodata = fetch_repodata(url, use_cache=use_cache) + repodata = fetch_repodata(url, use_cache=use_cache, session=session) if repodata is None: continue new_index = repodata['packages'] @@ -141,107 +137,80 @@ def fetch_index(channel_urls, use_cache=False, unknown=False): return index - -def fetch_pkg(info, dst_dir=None): +def fetch_pkg(info, dst_dir=None, session=None): ''' fetch a package given by `info` and store it into `dst_dir` ''' if dst_dir is None: dst_dir = config.pkgs_dirs[0] + session = session or CondaSession() + fn = '%(name)s-%(version)s-%(build)s.tar.bz2' % info url = info['channel'] + fn log.debug("url=%r" % url) path = join(dst_dir, fn) - pp = path + '.part' + + download(url, path, session=session, md5=info['md5'], urlstxt=True) + +def download(url, dst_path, session=None, md5=None, urlstxt=False): + pp = dst_path + '.part' + dst_dir = os.path.split(dst_path)[0] + session = session or CondaSession() with Locked(dst_dir): - for x in range(retries): - try: - fi = connectionhandled_urlopen(url) - except IOError: - log.debug("attempt %d failed at urlopen" % x) - continue - if fi is None: - log.debug("could not fetch (urlopen returned None)") - continue - n = 0 - h = hashlib.new('md5') - getLogger('fetch.start').info((fn, info['size'])) - need_retry = False - try: - fo = open(pp, 'wb') - except IOError: - raise RuntimeError("Could not open %r for writing. " - "Permissions problem or missing directory?" % pp) - while True: - try: - chunk = fi.read(16384) - except IOError: - need_retry = True - break - if not chunk: - break - try: - fo.write(chunk) - except IOError: - raise RuntimeError("Failed to write to %r." % pp) - h.update(chunk) - n += len(chunk) - getLogger('fetch.update').info(n) + try: + resp = session.get(url, stream=True) + except IOError: + raise RuntimeError("Could not open '%s'" % url) + except requests.exceptions.HTTPError as e: + msg = "HTTPError: %s: %s\n" % (e, url) + log.debug(msg) + raise RuntimeError(msg) - fo.close() - if need_retry: - continue + size = resp.headers.get('Content-Length') + if size: + size = int(size) + fn = basename(dst_path) + getLogger('fetch.start').info((fn[:14], size)) + + n = 0 + if md5: + h = hashlib.new('md5') + try: + with open(pp, 'wb') as fo: + for chunk in resp.iter_content(2**14): + try: + fo.write(chunk) + except IOError: + raise RuntimeError("Failed to write to %r." % pp) + if md5: + h.update(chunk) + n += len(chunk) + if size: + getLogger('fetch.update').info(n) + except IOError: + raise RuntimeError("Could not open %r for writing. " + "Permissions problem or missing directory?" % pp) - fi.close() + if size: getLogger('fetch.stop').info(None) - if h.hexdigest() != info['md5']: - raise RuntimeError("MD5 sums mismatch for download: %s (%s != %s)" % (fn, h.hexdigest(), info['md5'])) - try: - os.rename(pp, path) - except OSError: - raise RuntimeError("Could not rename %r to %r." % (pp, path)) + + if md5 and h.hexdigest() != md5: + raise RuntimeError("MD5 sums mismatch for download: %s (%s != %s)" % (url, h.hexdigest(), md5)) + + try: + os.rename(pp, dst_path) + except OSError as e: + raise RuntimeError("Could not rename %r to %r: %r" % (pp, + dst_path, e)) + + if urlstxt: try: with open(join(dst_dir, 'urls.txt'), 'a') as fa: fa.write('%s\n' % url) except IOError: pass - return - - raise RuntimeError("Could not locate '%s'" % url) - - -def download(url, dst_path): - try: - u = connectionhandled_urlopen(url) - except IOError: - raise RuntimeError("Could not open '%s'" % url) - except ValueError as e: - raise RuntimeError(e) - - size = get_http_value(u, 'Content-Length') - if size: - size = int(size) - fn = basename(dst_path) - getLogger('fetch.start').info((fn[:14], size)) - - n = 0 - fo = open(dst_path, 'wb') - while True: - chunk = u.read(16384) - if not chunk: - break - fo.write(chunk) - n += len(chunk) - if size: - getLogger('fetch.update').info(n) - fo.close() - - u.close() - if size: - getLogger('fetch.stop').info(None) - class TmpDownload(object): """
TLS does not appear to be verified As far as I can tell conda is just using urllib2 which doesn't verify SSL at all in Python 2.x and in Python 3.x it doesn't do it by default. This means that even recipes which use a https link without a md5 hash there is a simple MITM code execution attack. <!--- @huboard:{"order":158.5,"custom_state":""} -->
How can we fix it? Do we need to add several more dependencies to conda? How can it be enabled in Python 3? And why doesn't it do it by default? So there are a few options here, the lowest impact but easiest to get wrong is to backport the ssl stuff from Python 3 into Python 2 and include your own root certificates. This is what pip did in version 1.3-1.4 and it was done incorrectly. My recommendation would be to either use urllib3 directly or to use requests. Pip went the requests route which allows the entire Python community to sort of centralize it's cross platform TLS verification. Python 3 doesn't do it by default because it doesn't have any root certificates to verify against, I believe that Christian Heimes is hoping to fix this for 3.4 (or has already..). OK. Hopefully SNI is not needed here, as I found that it required three additional packages and a patch to requests. SNI has pretty bad support outside of browsers. It is a nice to have but not a requirement. The difference between SNI and not SNI is that HTTPS urls will require a dedicated IP address per certificate (but a certificate can contain multiple host names) whereas SNI allows you to have multiple certificates attached to one IP address. The other thing about missing SNI is that it'll "fail closed" instead of "fail open", so if someone has a repo or url that needs SNI they'll get an error message at any attempt to use that repo or url instead of it being silently insecure. FWIW it appears that the default continiuum repos are also HTTP only which should change as well, they should be available via HTTPS and conda should default to using HTTPS for them. Otherwise I can inject arbitrary package contents to people installing from those repositories if I have a successful MITM. I agree with @dstufft that standardising on requests is a good idea - the main reason is that the inclusion of the cert bundle addresses the fact that Python prior to 3.4 can't consistently access the system certs, and the Python Security Response Team will be keeping a close eye on that cert bundle now that it has a security impact on CPython itself (due to the pip bootstrapping in PEP 453). @asmeurer Asked me on twitter if urllib3 was fine to solve this. I took a look and urllib3 does _not_ ship it's own certificates. I would recommend that Conda does _not_ try to get into the business of shipping certificates. You have to make sure you're on top of whenever they get updated, parsing them can be dificult to do properly etc. It's a tricky business to get correct. I would recommend if you can that you switch to requests and try to keep it updated sot hat you get any new certificates automatically. However if you do want to use urllib3, I recommend using the certifi package to handle certs. Let's just use requests. Will hot-swapping `urllib2` with `requests.packages.urllib3` work? I know requests is better API-wise, but we already have the code there for urllib, so this would again be a one-line fix. `requests.packages.urllib3` is equivalent to just using `urllib3` so all of the above still apples. requests just includes an unmodified copy of urllib3 as part of it's source. OK, I'm looking at requests. What is the best way to do caching with requests? Will it be easy to port https://github.com/conda/conda/blob/master/conda/fetch.py#L71? If not, is there an easy way to do it without adding an additional dependency like https://github.com/Lukasa/httpcache or https://github.com/ionrock/cachecontrol? Or is using one of those the best way to go? Oh hey, this is an opportune time for that question, as I'm just looking at ripping out pip's custom download cache and replace it with a generic HTTP cache. I've recently submitted a few pull requests to CacheControl and I would suggest using it if you can. It's a good library and with the PRs i've submitted I was able to "drop it" into pip's requests based code without any trouble. However if you want to keep maintaining your existing cache, I did a quick once over of a port of that code to requests http://bpaste.net/show/Y5IJFRpQEwjZxswCPGwR/ I removed the error handling just because I'm lazy. Pip ticket in case you're wondering: pypa/pip#1732 Thanks. That will save me a lot of time I'm sure. We only use this to cache the repo metadata. Packages themselves are cached manually, using the md5 which is stored in the repodata. I'll probably just work off your modification for now. A good motivation for moving to CacheControl would probably be if it ends up being faster than the current method somehow. I'm not sure if that's possible, but for me, with about 10 channels, it takes several seconds to load the repo metadata with every command. @srossross may also have ideas about this. There is more than this. We do need proper error handling (we don't want users to ever see a traceback from conda, unless there is a bug), and also it needs to be able to handle proxies (I'm hoping this is easy with requests), because quite a few users of conda are stuck behind corporate firewalls. Yea I just left out error handling because I'm lazy :) I'm not sure if CacheControl would be faster than the current code, it'd likely mostly just be shifting logic around so you don't have to handle it yourself. Requests does make proxies very easy! In fact by default it will respect `HTTP_PROXY` and `HTTPS_PROXY` environment variables so you get proxies for "free" though that. In pip we also have a command line flag that lets people do it that way too.http://docs.python-requests.org/en/latest/user/advanced/#proxies. Although if those corporate firewalls are ISA based I think you have to install some client or something to make it work. You'll most likely find your HTTP handling code shrink because requests handles a lot of that stuff out of the box. One thing that's odd about requests is that `requests.get('http://repo.continuum.io/pkgs/free/osx-64/repodata.json.bz2')` returns a `str` rather than `bytes` in Python 3. Do you know any way to fix this? Yeah, I'm pretty sure the real way to improve speed is to have some API on the binstar side that conda could use to get the merged repodata for several channels with one request. That's something that @srossross and I have discussed. Sorry, that's `resp.text`. Maybe there is some other attribute of the Response object I should be using. It should return a Response object, which has a `text` attribute which will be the content of the request decoded with whatever encoding it detects the text of the response is in, and a `content` attribute which is just the (mostly raw) bytes from the wire. I say mostly raw because it'll automatically do gzip decoding even for `resp.content` if the server has the `Content-Encoding: gzip` header. Oh, I see, it's `resp.content`. I guess it makes sense that "text" would be a str, even if it isn't really text :) Is there a similar header for bz2? Also if you want to do like progress bar, you can do: ``` python resp = requests.get("https:///", stream=True) chunk = b"" for i, chunk in enumerate(resp.iter_content(4096)): print("Chunk #{}".format(i)) downloaded += chunk ``` The above will open a connection, but _not_ download the entire response body, but will instead download a 4096 byte chunk for each loop iteration. OK, I haven't gotten to the pkg downloading code yet. That's next. We hardly need a progress bar for fetching the repodata. Thanks for the advice so far. Not by default, HTTP connections typically only use deflate or gzip (both of those will be decoded automatically). Anything else won't be. Although if you wanted it handled automatically you could probably make requests do it by making your own transport adapter that passed one into the urllib3 HTTPReponse I think. Also if you're doing multiple connections to the same host, you'll want to use a requests session. ``` python import requests session = requests.session() session.get("https://....") ``` The benefit is that you'll get connection pooling and keep alive connections between HTTP requests (so you won't have to do the TLS handshake for each one, things will generally be much faster etc). You can also use requests sessions to share some settings to prevent you from having to pass them into each function call. (See http://docs.python-requests.org/en/latest/api/#sessionapi) I didn't notice a speed difference using session, but I'll use it anyway.
2014-04-23T22:43:45
conda/conda
707
conda__conda-707
[ "670" ]
ad6c5ffe86bb2eac4add2c4be7b8987f0f14c453
diff --git a/conda/lock.py b/conda/lock.py --- a/conda/lock.py +++ b/conda/lock.py @@ -19,7 +19,7 @@ import os from os.path import join import glob - +from time import sleep LOCKFN = '.conda_lock' @@ -36,15 +36,28 @@ def __init__(self, path): self.remove = True def __enter__(self): - files = glob.glob(self.pattern) - if files and not files[0].endswith(self.end): - # Keep the string "LOCKERROR" in this string so that external - # programs can look for it. - raise RuntimeError("""\ -LOCKERROR: It looks like conda is already doing something. -The lock %s was found. Wait for it to finish before continuing. -If you are sure that conda is not running, remove it and try again. -You can also use: $ conda clean --lock""" % self.lock_path) + retries = 10 + # Keep the string "LOCKERROR" in this string so that external + # programs can look for it. + lockstr = ("""\ + LOCKERROR: It looks like conda is already doing something. + The lock %s was found. Wait for it to finish before continuing. + If you are sure that conda is not running, remove it and try again. + You can also use: $ conda clean --lock""" % self.lock_path) + sleeptime = 1 + while retries: + files = glob.glob(self.pattern) + if files and not files[0].endswith(self.end): + print(lockstr) + print("Sleeping for %s seconds" % sleeptime) + sleep(sleeptime) + sleeptime *= 2 + retries -= 1 + else: + break + else: + print("Exceeded max retries, giving up") + raise RuntimeError(lockstr) if not files: try:
Add ability to keep retrying with a lock error The yum installer (IIRC) has a nice feature that it will keep trying every 10 seconds or so if there is a lock error. This could be useful for conda.
2014-05-02T16:20:55
conda/conda
739
conda__conda-739
[ "731" ]
27441fe05630c37e7225f275ee041411f995aae5
diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -244,7 +244,10 @@ def get_allowed_channels(): def get_proxy_servers(): res = rc.get('proxy_servers') - if res is None or isinstance(res, dict): + if res is None: + import requests + return requests.utils.getproxies() + if isinstance(res, dict): return res sys.exit("Error: proxy_servers setting not a mapping") diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -372,3 +372,51 @@ def parse_multipart_files(request): buf.seek(0) return buf + +# Taken from urllib3 (actually +# https://github.com/shazow/urllib3/pull/394). Once it is fully upstreamed to +# requests.packages.urllib3 we can just use that. + + +def unparse_url(U): + """ + Convert a :class:`.Url` into a url + + The input can be any iterable that gives ['scheme', 'auth', 'host', + 'port', 'path', 'query', 'fragment']. Unused items should be None. + + This function should more or less round-trip with :func:`.parse_url`. The + returned url may not be exactly the same as the url inputted to + :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls + with a blank port). + + + Example: :: + + >>> Url = parse_url('http://google.com/mail/') + >>> unparse_url(Url) + 'http://google.com/mail/' + >>> unparse_url(['http', 'username:password', 'host.com', 80, + ... '/path', 'query', 'fragment']) + 'http://username:[email protected]:80/path?query#fragment' + """ + scheme, auth, host, port, path, query, fragment = U + url = '' + + # We use "is not None" we want things to happen with empty strings (or 0 port) + if scheme is not None: + url = scheme + '://' + if auth is not None: + url += auth + '@' + if host is not None: + url += host + if port is not None: + url += ':' + str(port) + if path is not None: + url += path + if query is not None: + url += '?' + query + if fragment is not None: + url += '#' + fragment + + return url diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -15,12 +15,13 @@ from logging import getLogger from os.path import basename, isdir, join import sys -from multiprocessing.pool import ThreadPool +import getpass +# from multiprocessing.pool import ThreadPool from conda import config from conda.utils import memoized -from conda.connection import CondaSession -from conda.compat import itervalues, get_http_value +from conda.connection import CondaSession, unparse_url +from conda.compat import itervalues, get_http_value, input from conda.lock import Locked import requests @@ -73,20 +74,34 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): headers["If-Modified-Since"] = cache["_mod"] try: - resp = session.get(url + 'repodata.json.bz2', headers=headers) + resp = session.get(url + 'repodata.json.bz2', headers=headers, proxies=session.proxies) resp.raise_for_status() if resp.status_code != 304: cache = json.loads(bz2.decompress(resp.content).decode('utf-8')) - except ValueError: - raise RuntimeError("Invalid index file: %srepodata.json.bz2" % url) + except ValueError as e: + raise RuntimeError("Invalid index file: %srepodata.json.bz2: %s" % + (url, e)) except requests.exceptions.HTTPError as e: + if e.response.status_code == 407: # Proxy Authentication Required + handle_proxy_407(url, session) + # Try again + return fetch_repodata(url, cache_dir=cache_dir, use_cache=use_cache, session=session) msg = "HTTPError: %s: %s\n" % (e, url) log.debug(msg) raise RuntimeError(msg) except requests.exceptions.ConnectionError as e: + # requests isn't so nice here. For whatever reason, https gives this + # error and http gives the above error. Also, there is no status_code + # attribute here. We have to just check if it looks like 407. See + # https://github.com/kennethreitz/requests/issues/2061. + if "407" in str(e): # Proxy Authentication Required + handle_proxy_407(url, session) + # Try again + return fetch_repodata(url, cache_dir=cache_dir, use_cache=use_cache, session=session) + msg = "Connection error: %s: %s\n" % (e, url) stderrlog.info('Could not connect to %s\n' % url) log.debug(msg) @@ -102,10 +117,31 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): return cache or None +def handle_proxy_407(url, session): + """ + Prompts the user for the proxy username and password and modifies the + proxy in the session object to include it. + """ + # We could also use HTTPProxyAuth, but this does not work with https + # proxies (see https://github.com/kennethreitz/requests/issues/2061). + scheme = requests.packages.urllib3.util.url.parse_url(url).scheme + username, passwd = get_proxy_username_and_pass(scheme) + session.proxies[scheme] = add_username_and_pass_to_url(session.proxies[scheme], username, passwd) + +def add_username_and_pass_to_url(url, username, passwd): + urlparts = list(requests.packages.urllib3.util.url.parse_url(url)) + urlparts[1] = username + ':' + passwd + return unparse_url(urlparts) + +def get_proxy_username_and_pass(scheme): + username = input("\n%s proxy username: " % scheme) + passwd = getpass.getpass("Password:") + return username, passwd + @memoized def fetch_index(channel_urls, use_cache=False, unknown=False): log.debug('channel_urls=' + repr(channel_urls)) - pool = ThreadPool(5) + # pool = ThreadPool(5) index = {} stdoutlog.info("Fetching package metadata: ") session = CondaSession() @@ -171,15 +207,29 @@ def download(url, dst_path, session=None, md5=None, urlstxt=False): with Locked(dst_dir): try: - resp = session.get(url, stream=True) + resp = session.get(url, stream=True, proxies=session.proxies) resp.raise_for_status() - except IOError: - raise RuntimeError("Could not open '%s'" % url) except requests.exceptions.HTTPError as e: + if e.response.status_code == 407: # Proxy Authentication Required + handle_proxy_407(url, session) + # Try again + return download(url, dst_path, session=session, md5=md5, urlstxt=urlstxt) msg = "HTTPError: %s: %s\n" % (e, url) log.debug(msg) raise RuntimeError(msg) + except requests.exceptions.ConnectionError as e: + # requests isn't so nice here. For whatever reason, https gives this + # error and http gives the above error. Also, there is no status_code + # attribute here. We have to just check if it looks like 407. See + # https://github.com/kennethreitz/requests/issues/2061. + if "407" in str(e): # Proxy Authentication Required + handle_proxy_407(url, session) + # Try again + return download(url, dst_path, session=session, md5=md5, urlstxt=urlstxt) + except IOError as e: + raise RuntimeError("Could not open '%s': %s" % (url, e)) + size = resp.headers.get('Content-Length') if size: size = int(size)
conda does not prompt for proxy username and password ``` [ COMPLETE ] |#################################################| 100% The batch file cannot be found. C:\Code>conda update conda Fetching package metadata: .Error: HTTPError: 407 Client Error: Proxy Authentication Required: http://repo.continuum.io/pkgs/pro/win-64/ ```
Do you have proxy settings set in your `.condarc` or using the `HTTP_PROXY` environment variable? no. I used to have HTTP_PROXY set but it was automatically removed by a company pushed OS update. To avoid reliance on it I enter the proxy id and pw at the prompt. OK. I guess the new requests code regressed in that it no longer asks for it at a prompt. The workaround for now is to just add it to your .condarc (http://conda.pydata.org/docs/config.html), or to set that environment variable. I'm trying to understand how the code worked before. Did you always have the proxy server (and port) itself set, and only the username and password was prompted? I honestly don't recall entering the proxy info anywhere. The only thing I was ever required to enter was user and pw. > On May 20, 2014, at 5:39 PM, Aaron Meurer [email protected] wrote: > > I'm trying to understand how the code worked before. Did you always have the proxy server (and port) itself set, and only the username and password was prompted? > > \ > Reply to this email directly or view it on GitHub. I'm still getting this error after entering the proxy info in condarc The issue really seems to be with the repo. Why am I seeing the "pro" repo? I am using the free distribution of Anaconda. Could this be the problem? ``` C:\>conda update conda Fetching package metadata: .Error: HTTPError: 407 Client Error: Proxy Authentication Required: http://repo.continuum.io/pkgs/pro/win-64/ ``` No, the pro repos are there for everyone, and do not require any authentication on the open internet. Ok. I am completely lost since I don't know much about conda. If there is anything that can be tested to provide more information please let me know. Well I am a little surprised that adding the proxy to .condarc didn't work. Are you sure you used the exact format `http://[username]:[password]@[server]:[port]` (note that the `http://` part is required)? Also, does it work if you use the `HTTP_PROXY` environment variable, like ``` HTTP_PROXY=yourproxy conda update conda ``` Oh you're on Windows. I don't know if that syntax works on Windows. You may need to ``` set HTTP_PROXY=yourproxy conda update conda ``` setting HTTP_PROXY works. OK, but setting the http proxy in .condarc to the exact same thing does not work? That's definitely a bug then. exact same thing.
2014-05-23T15:50:51
conda/conda
804
conda__conda-804
[ "802" ]
037a783f85eb5edaf5ea59bdb5e456bed92587b3
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -143,10 +143,10 @@ def install(args, parser, command='install'): common.ensure_override_channels_requires_channel(args) channel_urls = args.channel or () + specs = [] if args.file: - specs = common.specs_from_url(args.file) + specs.extend(common.specs_from_url(args.file)) elif getattr(args, 'all', False): - specs = [] linked = ci.linked(prefix) for pkg in linked: name, ver, build = pkg.rsplit('-', 2) @@ -155,8 +155,7 @@ def install(args, parser, command='install'): specs.append('%s >=%s,<3' % (name, ver)) else: specs.append('%s >=%s' % (name, ver)) - else: - specs = common.specs_from_args(args.packages) + specs.extend(common.specs_from_args(args.packages)) if command == 'install' and args.revision: get_revision(args.revision)
`conda create --file deps.txt pkg1 pkg2 ... pkgn` doesn't work ``` $ echo "scipy" > deps.txt $ conda create -n test08 --file deps.txt sympy Fetching package metadata: .. Solving package specifications: . Package plan for installation in environment /home/mateusz/py/envs/test08: The following packages will be linked: package | build ---------------------------|----------------- numpy-1.8.1 | py27_0 hard-link openssl-1.0.1h | 0 hard-link python-2.7.8 | 0 hard-link readline-6.2 | 2 hard-link scipy-0.14.0 | np18py27_0 hard-link sqlite-3.8.4.1 | 0 hard-link system-5.8 | 1 hard-link tk-8.5.15 | 0 hard-link zlib-1.2.7 | 0 hard-link Proceed ([y]/n)? n ```
2014-07-10T14:40:10
conda/conda
834
conda__conda-834
[ "803", "803" ]
997b70c012fc5be64cc9df8cdabfd860a12c8230
diff --git a/conda/cli/main_run.py b/conda/cli/main_run.py --- a/conda/cli/main_run.py +++ b/conda/cli/main_run.py @@ -7,6 +7,7 @@ from __future__ import print_function, division, absolute_import import sys +import logging from conda.cli import common @@ -17,6 +18,7 @@ def configure_parser(sub_parsers): description = descr, help = descr) common.add_parser_prefix(p) + common.add_parser_quiet(p) common.add_parser_json(p) p.add_argument( 'package', @@ -47,6 +49,9 @@ def execute(args, parser): prefix = common.get_prefix(args) + if args.quiet: + logging.disable(logging.CRITICAL) + if args.package.endswith('.tar.bz2'): if app_is_installed(args.package, prefixes=[prefix]): fn = args.package @@ -65,20 +70,38 @@ def execute(args, parser): if name == args.package: installed = [conda.resolve.Package(pkg + '.tar.bz2', conda.install.is_linked(prefix, pkg))] + break - if not installed: - error_message = "App {} not installed.".format(args.package) - common.error_and_exit(error_message, json=args.json, - error_type="AppNotInstalled") + if installed: + package = max(installed) + fn = package.fn - package = max(installed) - fn = package.fn + try: + subprocess = launch(fn, prefix=prefix, + additional_args=args.arguments, + background=args.json) + if args.json: + common.stdout_json(dict(fn=fn, pid=subprocess.pid)) + elif not args.quiet: + print("Started app. Some apps may take a while to finish loading.") + except TypeError: + execute_command(args.package, prefix, args.arguments, args.json) + except Exception as e: + common.exception_and_exit(e, json=args.json) + else: + # Try interpreting it as a command + execute_command(args.package, prefix, args.arguments, args.json) +def execute_command(cmd, prefix, additional_args, json=False): + from conda.misc import execute_in_environment try: - subprocess = launch(fn, prefix=prefix, additional_args=args.arguments) - if args.json: - common.stdout_json(dict(fn=fn, pid=subprocess.pid)) + process = execute_in_environment( + cmd, prefix=prefix, additional_args=additional_args, inherit=not json) + if not json: + sys.exit(process.wait()) else: - print("Started app. Some apps may take a while to finish loading.") - except Exception as e: - common.exception_and_exit(e, json=args.json) + common.stdout_json(dict(cmd=cmd, pid=process.pid)) + except OSError: + error_message = "App {} not installed.".format(cmd) + common.error_and_exit(error_message, json=json, + error_type="AppNotInstalled") diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -199,21 +199,29 @@ def install_local_packages(prefix, paths, verbose=False): execute_actions(actions, verbose=verbose) -def launch(fn, prefix=config.root_dir, additional_args=None): +def environment_for_conda_environment(prefix=config.root_dir): + # prepend the bin directory to the path + fmt = r'%s\Scripts' if sys.platform == 'win32' else '%s/bin' + binpath = fmt % abspath(prefix) + path = r'%s;%s' if sys.platform == 'win32' else '%s:%s' + path = path % (binpath, os.getenv('PATH')) + env = {'PATH': path} + # copy existing environment variables, but not anything with PATH in it + for k, v in iteritems(os.environ): + if k != 'PATH': + env[k] = v + return binpath, env + + +def launch(fn, prefix=config.root_dir, additional_args=None, background=False): info = install.is_linked(prefix, fn[:-8]) if info is None: return None if not info.get('type') == 'app': - raise Exception('Not an application: %s' % fn) + raise TypeError('Not an application: %s' % fn) - # prepend the bin directory to the path - fmt = r'%s\Scripts;%s' if sys.platform == 'win32' else '%s/bin:%s' - env = {'PATH': fmt % (abspath(prefix), os.getenv('PATH'))} - # copy existing environment variables, but not anything with PATH in it - for k, v in iteritems(os.environ): - if k != 'PATH': - env[k] = v + binpath, env = environment_for_conda_environment(prefix) # allow updating environment variables from metadata if 'app_env' in info: env.update(info['app_env']) @@ -229,7 +237,44 @@ def launch(fn, prefix=config.root_dir, additional_args=None): cwd = abspath(expanduser('~')) if additional_args: args.extend(additional_args) - return subprocess.Popen(args, cwd=cwd, env=env, close_fds=False) + if sys.platform == 'win32' and background: + return subprocess.Popen(args, cwd=cwd, env=env, close_fds=False, + creationflags=subprocess.CREATE_NEW_CONSOLE) + else: + return subprocess.Popen(args, cwd=cwd, env=env, close_fds=False) + + +def execute_in_environment(cmd, prefix=config.root_dir, additional_args=None, + inherit=True): + """Runs ``cmd`` in the specified environment. + + ``inherit`` specifies whether the child inherits stdio handles (for JSON + output, we don't want to trample this process's stdout). + """ + binpath, env = environment_for_conda_environment(prefix) + + if sys.platform == 'win32' and cmd == 'python': + # python is located one directory up on Windows + cmd = join(binpath, '..', cmd) + else: + cmd = join(binpath, cmd) + + args = [cmd] + if additional_args: + args.extend(additional_args) + + if inherit: + stdin, stdout, stderr = None, None, None + else: + stdin, stdout, stderr = subprocess.PIPE, subprocess.PIPE, subprocess.PIPE + + if sys.platform == 'win32' and not inherit: + return subprocess.Popen(args, env=env, close_fds=False, + stdin=stdin, stdout=stdout, stderr=stderr, + creationflags=subprocess.CREATE_NEW_CONSOLE) + else: + return subprocess.Popen(args, env=env, close_fds=False, + stdin=stdin, stdout=stdout, stderr=stderr) def make_icon_url(info):
conda command-line tool provides a convenience command to run the Python executable from a specified conda environment I often want to run the Python interpreter from a specific conda environment while knowing only the name of that environment. I know that `conda -e` gives the path to each conda environment, from which I can derive the path of an environment-specific Python interpreter or the `activate` shell script, but this is inconvenient extra step. It would be convenient to have a conda command like `conda intepreter -n ${environment} -- [args]` that invokes the environment-specific Python interpreter, inherits STDIN and command-line arguments, and returns exit code of Python. Ideally, it would be a drop-in replacement for directly running the Python interpreter, as documented https://docs.python.org/2/tutorial/interpreter.html. My shell-fu is weak, but I think that something like `"exec /path/to/environment/bin/python "$@"` might work. conda command-line tool provides a convenience command to run the Python executable from a specified conda environment I often want to run the Python interpreter from a specific conda environment while knowing only the name of that environment. I know that `conda -e` gives the path to each conda environment, from which I can derive the path of an environment-specific Python interpreter or the `activate` shell script, but this is inconvenient extra step. It would be convenient to have a conda command like `conda intepreter -n ${environment} -- [args]` that invokes the environment-specific Python interpreter, inherits STDIN and command-line arguments, and returns exit code of Python. Ideally, it would be a drop-in replacement for directly running the Python interpreter, as documented https://docs.python.org/2/tutorial/interpreter.html. My shell-fu is weak, but I think that something like `"exec /path/to/environment/bin/python "$@"` might work.
Maybe the new conda run command could be used to do this. Maybe the new conda run command could be used to do this.
2014-07-28T20:50:17
conda/conda
909
conda__conda-909
[ "907" ]
e082781cad83e0bc6a41a2870b605f4ee08bbd4d
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -155,11 +155,20 @@ def rm_rf(path, max_retries=5): shutil.rmtree(path) return except OSError as e: - log.debug("Unable to delete %s (%s): retrying after %s " - "seconds" % (path, e, i)) + msg = "Unable to delete %s\n%s\n" % (path, e) + if on_win and e.args[0] == 5: + try: + subprocess.check_call(['cmd', '/c', 'rd', '/s', '/q', path]) + return + except subprocess.CalledProcessError as e1: + msg += '%s\n' % e1 + log.debug(msg + "Retrying after %s seconds..." % i) time.sleep(i) # Final time. pass exceptions to caller. - shutil.rmtree(path) + if on_win and e.args[0] == 5: + subprocess.check_call(['cmd', '/c', 'rd', '/s', '/q', path]) + else: + shutil.rmtree(path) def rm_empty_dir(path): """
Use rmtree workaround for write-protected files on Windows See https://stackoverflow.com/questions/1889597/deleting-directory-in-python/1889686#1889686. Alternately we can use rd /s.
2014-09-11T17:31:02
conda/conda
1,138
conda__conda-1138
[ "897" ]
7305bf1990c6f6d47fc7f6f7b3f7844ec1948388
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -191,13 +191,13 @@ def install(args, parser, command='install'): "prefix %s" % prefix) for pkg in linked: name, ver, build = pkg.rsplit('-', 2) - if name in getattr(args, '_skip', []): + if name in getattr(args, '_skip', ['anaconda']): continue if name == 'python' and ver.startswith('2'): # Oh Python 2... specs.append('%s >=%s,<3' % (name, ver)) else: - specs.append('%s >=%s' % (name, ver)) + specs.append('%s' % name) specs.extend(common.specs_from_args(args.packages, json=args.json)) if command == 'install' and args.revision: @@ -345,7 +345,7 @@ def install(args, parser, command='install'): else: # Not sure what to do here pass - args._skip = getattr(args, '_skip', []) + args._skip = getattr(args, '_skip', ['anaconda']) args._skip.extend([i.split()[0] for i in e.pkgs]) return install(args, parser, command=command) else:
Only try updating outdated packages with update --all conda update --all tends to fail a lot because it requires that the whole environment become satisfiable, and without downgrading any packages. Perhaps a better solution would be to only try installing those packages that are known to be outdated. Another idea would be to relax the downgrade restriction, and just have it essentially "reinstall" the environment. This could lead to some surprises when it does downgrade things, but it would also reduce the number of unsatisfiable packages issues, as those seem to usually come from the version specification.
2015-02-09T21:39:08
conda/conda
1,231
conda__conda-1231
[ "1230" ]
50000e443ff4d60904faf59c1ea04cf269ec42c3
diff --git a/conda/cli/main_clean.py b/conda/cli/main_clean.py --- a/conda/cli/main_clean.py +++ b/conda/cli/main_clean.py @@ -8,6 +8,7 @@ from argparse import RawDescriptionHelpFormatter import os import sys +from collections import defaultdict from os.path import join, getsize, isdir from os import lstat, walk, listdir @@ -102,29 +103,29 @@ def rm_lock(locks, verbose=True): def find_tarballs(): - pkgs_dir = config.pkgs_dirs[0] - - rmlist = [] - for fn in os.listdir(pkgs_dir): - if fn.endswith('.tar.bz2') or fn.endswith('.tar.bz2.part'): - rmlist.append(fn) - - if not rmlist: - return pkgs_dir, rmlist, 0 + pkgs_dirs = defaultdict(list) + for pkgs_dir in config.pkgs_dirs: + if not isdir(pkgs_dir): + continue + for fn in os.listdir(pkgs_dir): + if fn.endswith('.tar.bz2') or fn.endswith('.tar.bz2.part'): + pkgs_dirs[pkgs_dir].append(fn) totalsize = 0 - for fn in rmlist: - size = getsize(join(pkgs_dir, fn)) - totalsize += size + for pkgs_dir in pkgs_dirs: + for fn in pkgs_dirs[pkgs_dir]: + size = getsize(join(pkgs_dir, fn)) + totalsize += size - return pkgs_dir, rmlist, totalsize + return pkgs_dirs, totalsize -def rm_tarballs(args, pkgs_dir, rmlist, totalsize, verbose=True): +def rm_tarballs(args, pkgs_dirs, totalsize, verbose=True): if verbose: - print('Cache location: %s' % pkgs_dir) + for pkgs_dir in pkgs_dirs: + print('Cache location: %s' % pkgs_dir) - if not rmlist: + if not any(pkgs_dirs[i] for i in pkgs_dirs): if verbose: print("There are no tarballs to remove") return @@ -133,12 +134,15 @@ def rm_tarballs(args, pkgs_dir, rmlist, totalsize, verbose=True): print("Will remove the following tarballs:") print() - maxlen = len(max(rmlist, key=lambda x: len(str(x)))) - fmt = "%-40s %10s" - for fn in rmlist: - size = getsize(join(pkgs_dir, fn)) - print(fmt % (fn, human_bytes(size))) - print('-' * (maxlen + 2 + 10)) + for pkgs_dir in pkgs_dirs: + print(pkgs_dir) + print('-'*len(pkgs_dir)) + fmt = "%-40s %10s" + for fn in pkgs_dirs[pkgs_dir]: + size = getsize(join(pkgs_dir, fn)) + print(fmt % (fn, human_bytes(size))) + print() + print('-' * 51) # From 40 + 1 + 10 in fmt print(fmt % ('Total:', human_bytes(totalsize))) print() @@ -147,79 +151,82 @@ def rm_tarballs(args, pkgs_dir, rmlist, totalsize, verbose=True): if args.json and args.dry_run: return - for fn in rmlist: - if verbose: - print("removing %s" % fn) - os.unlink(os.path.join(pkgs_dir, fn)) + for pkgs_dir in pkgs_dirs: + for fn in pkgs_dirs[pkgs_dir]: + if verbose: + print("removing %s" % fn) + os.unlink(os.path.join(pkgs_dir, fn)) def find_pkgs(): # TODO: This doesn't handle packages that have hard links to files within # themselves, like bin/python3.3 and bin/python3.3m in the Python package - pkgs_dir = config.pkgs_dirs[0] warnings = [] - rmlist = [] - pkgs = [i for i in listdir(pkgs_dir) if isdir(join(pkgs_dir, i)) and - # Only include actual packages - isdir(join(pkgs_dir, i, 'info'))] - for pkg in pkgs: - breakit = False - for root, dir, files in walk(join(pkgs_dir, pkg)): - if breakit: - break - for fn in files: - try: - stat = lstat(join(root, fn)) - except OSError as e: - warnings.append((fn, e)) - continue - if stat.st_nlink > 1: - # print('%s is installed: %s' % (pkg, join(root, fn))) - breakit = True + pkgs_dirs = defaultdict(list) + for pkgs_dir in config.pkgs_dirs: + pkgs = [i for i in listdir(pkgs_dir) if isdir(join(pkgs_dir, i)) and + # Only include actual packages + isdir(join(pkgs_dir, i, 'info'))] + for pkg in pkgs: + breakit = False + for root, dir, files in walk(join(pkgs_dir, pkg)): + if breakit: break - else: - rmlist.append(pkg) - - if not rmlist: - return pkgs_dir, rmlist, warnings, 0, [] + for fn in files: + try: + stat = lstat(join(root, fn)) + except OSError as e: + warnings.append((fn, e)) + continue + if stat.st_nlink > 1: + # print('%s is installed: %s' % (pkg, join(root, fn))) + breakit = True + break + else: + pkgs_dirs[pkgs_dir].append(pkg) totalsize = 0 - pkgsizes = [] - for pkg in rmlist: - pkgsize = 0 - for root, dir, files in walk(join(pkgs_dir, pkg)): - for fn in files: - # We don't have to worry about counting things twice: by - # definition these files all have a link count of 1! - size = lstat(join(root, fn)).st_size - totalsize += size - pkgsize += size - pkgsizes.append(pkgsize) - - return pkgs_dir, rmlist, warnings, totalsize, pkgsizes - - -def rm_pkgs(args, pkgs_dir, rmlist, warnings, totalsize, pkgsizes, + pkgsizes = defaultdict(list) + for pkgs_dir in pkgs_dirs: + for pkg in pkgs_dirs[pkgs_dir]: + pkgsize = 0 + for root, dir, files in walk(join(pkgs_dir, pkg)): + for fn in files: + # We don't have to worry about counting things twice: by + # definition these files all have a link count of 1! + size = lstat(join(root, fn)).st_size + totalsize += size + pkgsize += size + pkgsizes[pkgs_dir].append(pkgsize) + + return pkgs_dirs, warnings, totalsize, pkgsizes + + +def rm_pkgs(args, pkgs_dirs, warnings, totalsize, pkgsizes, verbose=True): if verbose: - print('Cache location: %s' % pkgs_dir) - for fn, exception in warnings: - print(exception) + for pkgs_dir in pkgs_dirs: + print('Cache location: %s' % pkgs_dir) + for fn, exception in warnings: + print(exception) - if not rmlist: + if not any(pkgs_dirs[i] for i in pkgs_dirs): if verbose: print("There are no unused packages to remove") return if verbose: print("Will remove the following packages:") - print() - maxlen = len(max(rmlist, key=lambda x: len(str(x)))) - fmt = "%-40s %10s" - for pkg, pkgsize in zip(rmlist, pkgsizes): - print(fmt % (pkg, human_bytes(pkgsize))) - print('-' * (maxlen + 2 + 10)) + for pkgs_dir in pkgs_dirs: + print(pkgs_dir) + print('-' * len(pkgs_dir)) + print() + fmt = "%-40s %10s" + for pkg, pkgsize in zip(pkgs_dirs[pkgs_dir], pkgsizes[pkgs_dir]): + print(fmt % (pkg, human_bytes(pkgsize))) + print() + print('-' * 51) # 40 + 1 + 10 in fmt print(fmt % ('Total:', human_bytes(totalsize))) print() @@ -228,10 +235,11 @@ def rm_pkgs(args, pkgs_dir, rmlist, warnings, totalsize, pkgsizes, if args.json and args.dry_run: return - for pkg in rmlist: - if verbose: - print("removing %s" % pkg) - rm_rf(join(pkgs_dir, pkg)) + for pkgs_dir in pkgs_dirs: + for pkg in pkgs_dirs[pkgs_dir]: + if verbose: + print("removing %s" % pkg) + rm_rf(join(pkgs_dir, pkg)) def rm_index_cache(): @@ -314,13 +322,15 @@ def execute(args, parser): rm_lock(locks, verbose=not args.json) if args.tarballs: - pkgs_dir, rmlist, totalsize = find_tarballs() + pkgs_dirs, totalsize = find_tarballs() + first = sorted(pkgs_dirs)[0] if pkgs_dirs else '' json_result['tarballs'] = { - 'pkgs_dir': pkgs_dir, - 'files': rmlist, + 'pkgs_dir': first, # Backwards compabitility + 'pkgs_dirs': dict(pkgs_dirs), + 'files': pkgs_dirs[first], # Backwards compatibility 'total_size': totalsize } - rm_tarballs(args, pkgs_dir, rmlist, totalsize, verbose=not args.json) + rm_tarballs(args, pkgs_dirs, totalsize, verbose=not args.json) if args.index_cache: json_result['index_cache'] = { @@ -329,15 +339,17 @@ def execute(args, parser): rm_index_cache() if args.packages: - pkgs_dir, rmlist, warnings, totalsize, pkgsizes = find_pkgs() + pkgs_dirs, warnings, totalsize, pkgsizes = find_pkgs() + first = sorted(pkgs_dirs)[0] if pkgs_dirs else '' json_result['packages'] = { - 'pkgs_dir': pkgs_dir, - 'files': rmlist, + 'pkgs_dir': first, # Backwards compatibility + 'pkgs_dirs': dict(pkgs_dirs), + 'files': pkgs_dirs[first], # Backwards compatibility 'total_size': totalsize, 'warnings': warnings, - 'pkg_sizes': dict(zip(rmlist, pkgsizes)) + 'pkg_sizes': {i: dict(zip(pkgs_dirs[i], pkgsizes[i])) for i in pkgs_dirs}, } - rm_pkgs(args, pkgs_dir, rmlist, warnings, totalsize, pkgsizes, + rm_pkgs(args, pkgs_dirs, warnings, totalsize, pkgsizes, verbose=not args.json) if args.source_cache:
conda clean -t fails with FileNotFoundError ``` [root@localhost conda-recipes]# conda clean -t An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/root/anaconda/bin/conda", line 5, in <module> sys.exit(main()) File "/home/aaronmeurer/conda/conda/cli/main.py", line 202, in main args_func(args, p) File "/home/aaronmeurer/conda/conda/cli/main.py", line 207, in args_func args.func(args, p) File "/home/aaronmeurer/conda/conda/cli/main_clean.py", line 317, in execute pkgs_dir, rmlist, totalsize = find_tarballs() File "/home/aaronmeurer/conda/conda/cli/main_clean.py", line 108, in find_tarballs for fn in os.listdir(pkgs_dir): FileNotFoundError: [Errno 2] No such file or directory: '/root/.conda/envs/.pkgs' ```
2015-03-30T19:30:39
conda/conda
1,318
conda__conda-1318
[ "1317" ]
d6704ec38705aa3181aabff5759d0365cd0e59b0
diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py --- a/conda/cli/main_remove.py +++ b/conda/cli/main_remove.py @@ -190,6 +190,9 @@ def execute(args, parser): return + if not args.json: + common.confirm_yn(args) + if args.json and not args.quiet: with json_progress_bars(): plan.execute_actions(actions, index, verbose=not args.quiet)
conda remove --dry-run actually removes the package Is there anything set around here: https://github.com/conda/conda/blob/ded940c3fa845bbb86b3492e4a7c883c1bcec10b/conda/cli/main_remove.py#L196 to actually exit before removing the package if --dry-run is set but --json is not? I'm just running 3.11.0 and haven't grabbed and functionally tested master to see if this is still a problem.
2015-05-04T20:08:26
conda/conda
1,463
conda__conda-1463
[ "1452" ]
3ea1dc2f9a91b05509b80e6fd8d6ee08299967dd
diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -185,6 +185,10 @@ def handle_proxy_407(url, session): # We could also use HTTPProxyAuth, but this does not work with https # proxies (see https://github.com/kennethreitz/requests/issues/2061). scheme = requests.packages.urllib3.util.url.parse_url(url).scheme + if scheme not in session.proxies: + sys.exit("""Could not find a proxy for %r. See +http://conda.pydata.org/docs/config.html#configure-conda-for-use-behind-a-proxy-server +for more information on how to configure proxies.""" % scheme) username, passwd = get_proxy_username_and_pass(scheme) session.proxies[scheme] = add_username_and_pass_to_url( session.proxies[scheme], username, passwd)
https proxy username/password I have installed anaconda using the command "bash Anaconda-2.3.0-Linux-x86_64.sh" and gave path of bin/conda to .bashrc and default it asks for bin path prepending which I gave, after closing and then running terminal I ran: conda create -n dato-env python=2.7 which requires https proxy unsername and password for metadata, following is the error: Password: An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: ``` https://github.com/conda/conda/issues ``` Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/home/mayank/anaconda/bin/conda", line 5, in <module> sys.exit(main()) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 201, in main args_func(args, p) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 208, in args_func args.func(args, p) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/common.py", line 612, in inner return func(args, parser) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 50, in execute install.install(args, parser, 'create') File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 255, in install offline=args.offline) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/cli/common.py", line 549, in get_index_trap return get_index(_args, *_kwargs) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/api.py", line 42, in get_index unknown=unknown) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/utils.py", line 119, in **call** value = self.func(_args, *_kw) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 255, in fetch_index reversed(channel_urls)) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 254, in <lambda> use_cache=use_cache, session=session)), File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 65, in func res = f(_args, *_kwargs) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 154, in fetch_repodata handle_proxy_407(url, session) File "/home/mayank/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 184, in handle_proxy_407 session.proxies[scheme], username, passwd) KeyError: 'https' Can you please help in this regard
Can you paste the output of `conda info` here? Sure. Output of conda info: Current conda install: ``` platform : linux-64 conda version : 3.14.1 ``` conda-build version : 1.14.1 python version : 2.7.10.final.0 requests version : 2.7.0 root environment : /home/mayank/anaconda (writable) default environment : /home/mayank/anaconda envs directories : /home/mayank/anaconda/envs package cache : /home/mayank/anaconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None is foreign system : False
2015-07-27T18:35:38
conda/conda
1,496
conda__conda-1496
[ "1495" ]
8d095e771947121c32edef476efc333e2cfeb60b
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -19,7 +19,7 @@ import conda from conda.compat import urlparse, StringIO -from conda.config import get_proxy_servers +from conda.config import get_proxy_servers, ssl_verify import requests @@ -82,6 +82,7 @@ def __init__(self, *args, **kwargs): self.headers['User-Agent'] = "conda/%s %s" % ( conda.__version__, self.headers['User-Agent']) + self.verify = ssl_verify class S3Adapter(requests.adapters.BaseAdapter): diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -97,8 +97,7 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): try: resp = session.get(url + 'repodata.json.bz2', - headers=headers, proxies=session.proxies, - verify=config.ssl_verify) + headers=headers, proxies=session.proxies) resp.raise_for_status() if resp.status_code != 304: cache = json.loads(bz2.decompress(resp.content).decode('utf-8')) @@ -323,8 +322,7 @@ def download(url, dst_path, session=None, md5=None, urlstxt=False, retries = RETRIES with Locked(dst_dir): try: - resp = session.get(url, stream=True, proxies=session.proxies, - verify=config.ssl_verify) + resp = session.get(url, stream=True, proxies=session.proxies) resp.raise_for_status() except requests.exceptions.HTTPError as e: if e.response.status_code == 407: # Proxy Authentication Required
Set the default CondaSession.verify default from the config setting Currently, the .condarc config setting must be explicitly used when making a request with a CondaSession object. This means that anyone who wants to use CondaSession must check the .condarc ssl_verify value and appropriately interpret it, etc. (For example, see https://github.com/conda/conda/blob/47e300b0e2cd5aad1dfe18d26eada5995b058004/conda/fetch.py#L101) I think it would be much cleaner for CondaSession itself to set the default verify value in its **init**: `self.verify = <code to get the .condarc ssl_verify setting`. See https://github.com/kennethreitz/requests/blob/8b5e457b756b2ab4c02473f7a42c2e0201ecc7e9/requests/sessions.py#L314 to see that this is correct. This change would mean that we don't need the verify argument here: https://github.com/conda/conda/blob/47e300b0e2cd5aad1dfe18d26eada5995b058004/conda/fetch.py#L101, and would also solve this issue: https://github.com/conda/conda-build/issues/523
Sounds good to me.
2015-08-05T17:57:52
conda/conda
1,541
conda__conda-1541
[ "1535" ]
a003d2809ec13f826f0692c9515a2f1291fae56f
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -272,6 +272,7 @@ def update_prefix(path, new_prefix, placeholder=prefix_placeholder, if new_data == data: return st = os.lstat(path) + os.remove(path) # Remove file before rewriting to avoid destroying hard-linked cache. with open(path, 'wb') as fo: fo.write(new_data) os.chmod(path, stat.S_IMODE(st.st_mode))
`conda.install.update_prefix` is modifying cached pkgs in Windows Since files are hardlinks, it looks like conda's prefix replacement mechanism is breaking its own files. File contents inside package: ``` python x = r'/opt/anaconda1anaconda2anaconda3\Scripts', ``` File contents after installing in 'env1': ``` python x = r'C:\Miniconda\envs\env1\Scripts', ``` File contents after installing in 'NOTENV1': ``` python x = r'C:\Miniconda\envs\env1\Scripts', ``` Note that the second install fails, because the first one modified the cached files in `C:\Miniconda\pkgs`. Reading @asmeurer comments in #679, I agree that the correct behavior in this case would be to delete the file being modified and re-create it to avoid this issue.
2015-08-20T12:16:12
conda/conda
1,562
conda__conda-1562
[ "1561" ]
113e9451512b87d0bf0ef3ecdd19ca78fb25c047
diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -309,7 +309,7 @@ def add_dependents(fn1, max_only=False): if not found: raise NoPackagesFound("Could not find some dependencies " - "for %s: %s" % (ms, ', '.join(notfound)), notfound) + "for %s: %s" % (ms, ', '.join(notfound)), [ms.spec] + notfound) add_dependents(root_fn, max_only=max_only) return res @@ -426,7 +426,7 @@ def get_dists(self, specs, max_only=False): dists[pkg.fn] = pkg found = True if not found: - raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), notfound) + raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), [spec] + notfound) return dists
recursion problem or infinite loop in dependency solver I am executing this command: ``` bash /opt/wakari/miniconda/bin/conda update --dry-run -c https://conda.anaconda.org/wakari/channel/release:0.8.0 -p /opt/wakari/wakari-server --all ``` And it appears to loop "forever" (well, for a few minutes, at least", stating again and again: ``` bash Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping Solving package specifications: Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping Solving package specifications: Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping Solving package specifications: Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping Solving package specifications: Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping Solving package specifications: ``` (you get the point), and then when I finally `CTRL-C` to abort, the stack-trace suggests a recursion problem: ``` python Solving package specifications: Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping ^CTraceback (most recent call last): File "/opt/wakari/miniconda/bin/conda", line 5, in <module> sys.exit(main()) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 194, in main args_func(args, p) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 201, in args_func args.func(args, p) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main_update.py", line 38, in execute install.install(args, parser, 'update') File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install return install(args, parser, command=command) ... REPEATED MANY TIMES ... File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install return install(args, parser, command=command) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install return install(args, parser, command=command) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 337, in install minimal_hint=args.alt_hint) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/plan.py", line 402, in install_actions config.track_features, minimal_hint=minimal_hint): File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 726, in solve for pkg in self.get_pkgs(ms, max_only=max_only): File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/utils.py", line 142, in __call__ res = cache[key] = self.func(*args, **kw) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 261, in get_pkgs pkgs = [Package(fn, self.index[fn]) for fn in self.find_matches(ms)] File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 168, in __init__ self.norm_version = normalized_version(self.version) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 28, in normalized_version return verlib.NormalizedVersion(version) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 93, in __init__ self._parse(s, error_on_huge_major_num) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 110, in _parse block = self._parse_numdots(groups['version'], s, False, 2) File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 159, in _parse_numdots if len(n) > 1 and n[0] == '0': KeyboardInterrupt ```
This is with conda 3.16.0: ``` bash /opt/wakari/miniconda/bin/conda -V conda 3.16.0 ``` I see the problem. It's trying to ignore `wakari-server` but it really should be ignoring `wakari-enterprise-server-conf`.
2015-08-31T16:25:35
conda/conda
1,563
conda__conda-1563
[ "1557" ]
9e9becd30eeb6e56c1601521f5edb7b16a29abd7
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -169,6 +169,8 @@ def install(args, parser, command='install'): if any(pkg.split('=')[0] == default_pkg for pkg in args.packages): default_packages.remove(default_pkg) args.packages.extend(default_packages) + else: + default_packages = [] common.ensure_override_channels_requires_channel(args) channel_urls = args.channel or () @@ -244,7 +246,7 @@ def install(args, parser, command='install'): offline=args.offline) if newenv and args.clone: - if args.packages: + if set(args.packages) - set(default_packages): common.error_and_exit('did not expect any arguments for --clone', json=args.json, error_type="ValueError")
create_default_packages rules out --clone Hi all, In case of the .condarc file defining the 'create_default_packages' options, the conda --clone command gives a confusing error messages: alain@alain-K53E:~$ conda create --name flowersqq --clone snowflakes Fetching package metadata: .... Error: did not expect any arguments for --clone alain@alain-K53E:~$ Here my settings: lain@alain-K53E:~$ conda info Current conda install: ``` platform : linux-32 conda version : 3.16.0 conda-build version : 1.16.0 python version : 2.7.10.final.0 requests version : 2.7.0 root environment : /home/alain/miniconda (writable) default environment : /home/alain/miniconda envs directories : /home/alain/test/conda-envs package cache : /home/alain/test/conda-envs/.pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-32/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-32/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /home/alain/.condarc_env is foreign system : False ``` alain@alain-K53E:~$ alain@alain-K53E:~$ cat /home/alain/.condarc_env channels: - defaults # Directories in which environments are located. envs_dirs: - ~/test/conda-envs create_default_packages: - python - pip binstar_upload: False binstar_personal: True alain@alain-K53E:~$ And here the workaround for me (luckily i was able to browse the source code: https://github.com/algorete/apkg/blob/master/conda/cli/install.py, this gave me a hint, but i do not really understand..) alain@alain-K53E:~$ conda create --name flowersqq --clone snowflakes --no-default-packages Fetching package metadata: .... src_prefix: '/home/alain/test/conda-envs/snowflakes' dst_prefix: '/home/alain/test/conda-envs/flowersqq' Packages: 14 Files: 0 Linking packages ... [ COMPLETE ]|#################################################################################################| 100% alain@alain-K53E:~$ Kind Regards Alain P.S: I could understand that changing the .condrc file to include default packages _after_ having created an env which did not define the create_default_packages could confuse the '--clone', but the problem seems always present.
2015-08-31T19:55:34
conda/conda
1,613
conda__conda-1613
[ "1118" ]
acf392df41d6c4ecf311733b38869d83fa19239f
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -196,12 +196,14 @@ def install(args, parser, command='install'): common.check_specs(prefix, specs, json=args.json, create=(command == 'create')) - # handle tar file containing conda packages + num_cp = sum(s.endswith('.tar.bz2') for s in args.packages) if num_cp: if num_cp == len(args.packages): depends = misc.install_local_packages(prefix, args.packages, verbose=not args.quiet) + if args.no_deps: + depends = [] specs = list(set(depends)) args.unknown = True else: @@ -209,10 +211,14 @@ def install(args, parser, command='install'): "cannot mix specifications with conda package filenames", json=args.json, error_type="ValueError") + + # handle tar file containing conda packages if len(args.packages) == 1: tar_path = args.packages[0] if tar_path.endswith('.tar'): depends = install_tar(prefix, tar_path, verbose=not args.quiet) + if args.no_deps: + depends = [] specs = list(set(depends)) args.unknown = True
conda install --no-deps still installing deps when installing tarball When running the following command: `conda install --no-deps ./matplotlib-1.4.0-np18py27_0.tar.bz2` You would assume that no dependencies are installed, but conda seems to install the dependencies anyway.
fwiw: This seemed to work with conda 3.7.0 That's because conda used to never install the dependencies of a tarball. This feature was added, but the `--no-deps` flag was neglected. @ilanschnell this is similar to the issue I was describing with `--offline` installations breaking because of the dependency resolution happening after tarball installs. Didn't you say you had a fix in mind for how to deal with that? Would that also solve this problem? Yes, I have described the fix I had in mind here: https://github.com/conda/conda/issues/1075 Just fixing this issue should be much simpler than fixing that, though. We just need to make it respect the command line flag. What is the status here?
2015-09-14T17:37:43
conda/conda
1,618
conda__conda-1618
[ "1594" ]
1b100cde07dac3769e1dbffcb05e11574b9a416b
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -27,19 +27,19 @@ from __future__ import print_function, division, absolute_import -import time -import os -import json import errno +import json +import logging +import os +import shlex import shutil import stat -import sys import subprocess +import sys import tarfile +import time import traceback -import logging -import shlex -from os.path import abspath, basename, dirname, isdir, isfile, islink, join +from os.path import abspath, basename, dirname, isdir, isfile, islink, join, relpath try: from conda.lock import Locked @@ -143,13 +143,14 @@ def _remove_readonly(func, path, excinfo): func(path) -def rm_rf(path, max_retries=5): +def rm_rf(path, max_retries=5, trash=True): """ Completely delete path max_retries is the number of times to retry on failure. The default is 5. This only applies to deleting a directory. + If removing path fails and trash is True, files will be moved to the trash directory. """ if islink(path) or isfile(path): # Note that we have to check if the destination is a link because @@ -180,6 +181,15 @@ def rm_rf(path, max_retries=5): if not isdir(path): return + if trash: + try: + move_path_to_trash(path) + if not isdir(path): + return + except OSError as e2: + raise + msg += "Retry with onerror failed (%s)\n" % e2 + log.debug(msg + "Retrying after %s seconds..." % i) time.sleep(i) # Final time. pass exceptions to caller. @@ -497,14 +507,14 @@ def is_linked(prefix, dist): except IOError: return None -def delete_trash(prefix): +def delete_trash(prefix=None): from conda import config for pkg_dir in config.pkgs_dirs: trash_dir = join(pkg_dir, '.trash') try: log.debug("Trying to delete the trash dir %s" % trash_dir) - rm_rf(trash_dir, max_retries=1) + rm_rf(trash_dir, max_retries=1, trash=False) except OSError as e: log.debug("Could not delete the trash dir %s (%s)" % (trash_dir, e)) @@ -512,11 +522,23 @@ def move_to_trash(prefix, f, tempdir=None): """ Move a file f from prefix to the trash - tempdir should be the name of the directory in the trash + tempdir is a deprecated parameter, and will be ignored. + + This function is deprecated in favor of `move_path_to_trash`. + """ + return move_path_to_trash(join(prefix, f)) + +def move_path_to_trash(path): + """ + Move a path to the trash """ + # Try deleting the trash every time we use it. + delete_trash() + from conda import config for pkg_dir in config.pkgs_dirs: + import tempfile trash_dir = join(pkg_dir, '.trash') try: @@ -525,26 +547,23 @@ def move_to_trash(prefix, f, tempdir=None): if e1.errno != errno.EEXIST: continue - if tempdir is None: - import tempfile - trash_dir = tempfile.mkdtemp(dir=trash_dir) - else: - trash_dir = join(trash_dir, tempdir) + trash_dir = tempfile.mkdtemp(dir=trash_dir) + trash_dir = join(trash_dir, relpath(os.path.dirname(path), config.root_dir)) try: - try: - os.makedirs(join(trash_dir, dirname(f))) - except OSError as e1: - if e1.errno != errno.EEXIST: - continue - shutil.move(join(prefix, f), join(trash_dir, f)) + os.makedirs(trash_dir) + except OSError as e2: + if e2.errno != errno.EEXIST: + continue + try: + shutil.move(path, trash_dir) except OSError as e: - log.debug("Could not move %s to %s (%s)" % (f, trash_dir, e)) + log.debug("Could not move %s to %s (%s)" % (path, trash_dir, e)) else: return True - log.debug("Could not move %s to trash" % f) + log.debug("Could not move %s to trash" % path) return False # FIXME This should contain the implementation that loads meta, not is_linked() @@ -556,11 +575,6 @@ def link(pkgs_dir, prefix, dist, linktype=LINK_HARD, index=None): Set up a package in a specified (environment) prefix. We assume that the package has been extracted (using extract() above). ''' - if on_win: - # Try deleting the trash every time we link something. - delete_trash(prefix) - - index = index or {} log.debug('pkgs_dir=%r, prefix=%r, dist=%r, linktype=%r' % (pkgs_dir, prefix, dist, linktype)) @@ -595,7 +609,7 @@ def link(pkgs_dir, prefix, dist, linktype=LINK_HARD, index=None): log.error('failed to unlink: %r' % dst) if on_win: try: - move_to_trash(prefix, f) + move_path_to_trash(dst) except ImportError: # This shouldn't be an issue in the installer anyway pass @@ -685,7 +699,7 @@ def unlink(prefix, dist): if on_win and os.path.exists(join(prefix, f)): try: log.debug("moving to trash") - move_to_trash(prefix, f) + move_path_to_trash(dst) except ImportError: # This shouldn't be an issue in the installer anyway pass
`conda.install.rm_rf` can't delete old environments in Windows + Python 2.7 This issue hit me when trying to use `--force` option in `conda env create` (I added this in #102), and it revealed a possible problem with how conda handles links in Windows + Python 2.7. # Symptom Trying to delete an environment (not active) from within Python fails because the original file being linked is locked by Windows. # Context - Windows - Python 2.7 (`os.islink` does not work here, which might affect the `rm_rf` function from `conda.install`) # Reproducing This command line is enough to reproduce the problem: ``` bat $ conda create -n test pyyaml && python -c "import yaml;from conda.install import rm_rf;rm_rf('C:\\Miniconda\\envs\\test')" Fetching package metadata: ...... # # To activate this environment, use: # > activate test # Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Miniconda\lib\site-packages\conda\install.py", line 204, in rm_rf shutil.rmtree(path) File "C:\Miniconda\lib\shutil.py", line 247, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Miniconda\lib\shutil.py", line 247, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Miniconda\lib\shutil.py", line 252, in rmtree onerror(os.remove, fullname, sys.exc_info()) File "C:\Miniconda\lib\shutil.py", line 250, in rmtree os.remove(fullname) WindowsError: [Error 5] Acesso negado: 'C:\\Miniconda\\envs\\test\\Lib\\site-packages\\yaml.dll' ``` Note that when I import `pyyaml`, I'm locking file `C:\\Miniconda\\Lib\\site-packages\\yaml.dll` (root environment), but that also prevents me from deleting `C:\\Miniconda\\envs\\test\\Lib\\site-packages\\yaml.dll` (another hard link). # Solution? Maybe we should add some improved support for detecting and unlinking hardlinks in Windows with Python 2.7, and handle those cases individually instead of trying to `shutil.rmtree` everything. Possibly from [jarako.windows](https://bitbucket.org/jaraco/jaraco.windows/src/default/jaraco/windows/filesystem/__init__.py#cl-76) or [ntfs/fs.py](https://github.com/sid0/ntfs/blob/master/ntfsutils/fs.py#L88)
A possible solution would to force all conda requirements ( python, pycosat, pyyaml, conda, openssl, requests) to be copied in Windows (never linked). This might also be enough to remove some code in `install.py` that already has a different behavior when linking python (just need to do the same for the other ones) I think it should work to put the trash stuff in `rm_rf`. Curiously, `conda env remove` has no trouble removing the same environment... hmm... @nicoddemus it might not be going through a path that imports `yaml` @asmeurer moving trash to other folders is allowed when the file is 'in use'? This problem is already semi-solved, except that it's not been wired up in all parts of conda yet. See #1133 and for conda-build see https://github.com/conda/conda-build/pull/521 I say semi because you could theoretically run out of disk space before the environments actually get removed. But that's certainly an edge case. @campos-ddc Yes, that's allowed (you can easily test it on your machine).
2015-09-15T18:13:42
conda/conda
1,668
conda__conda-1668
[ "1667" ]
c13df56c2a6b4e494bfffbb695df63d34e28ad5f
diff --git a/conda/cli/common.py b/conda/cli/common.py --- a/conda/cli/common.py +++ b/conda/cli/common.py @@ -180,6 +180,16 @@ def add_parser_use_index_cache(p): help="Use cache of channel index files.", ) + +def add_parser_no_use_index_cache(p): + p.add_argument( + "--no-use-index-cache", + action="store_false", + default=True, + dest="use_index_cache", + help="Use cache of channel index files.", + ) + def add_parser_copy(p): p.add_argument( '--copy', diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py --- a/conda/cli/main_remove.py +++ b/conda/cli/main_remove.py @@ -68,6 +68,8 @@ def configure_parser(sub_parsers, name='remove'): common.add_parser_channels(p) common.add_parser_prefix(p) common.add_parser_quiet(p) + # Putting this one first makes it the default + common.add_parser_no_use_index_cache(p) common.add_parser_use_index_cache(p) common.add_parser_use_local(p) common.add_parser_offline(p)
conda remove shouldn't fetch the package metadata It only needs it to print the channel location. It should either get that locally, or at least just use the index cache.
2015-10-01T19:07:14
conda/conda
1,735
conda__conda-1735
[ "1734" ]
02c652c00ebad8c17747509185d007057d2b0374
diff --git a/conda/utils.py b/conda/utils.py --- a/conda/utils.py +++ b/conda/utils.py @@ -5,8 +5,10 @@ import hashlib import collections from functools import partial -from os.path import abspath, isdir, join +from os.path import abspath, isdir import os +import tempfile + log = logging.getLogger(__name__) stderrlog = logging.getLogger('stderrlog') @@ -43,13 +45,10 @@ def can_open_all_files_in_prefix(prefix, files): def try_write(dir_path): assert isdir(dir_path) try: - try: - with open(join(dir_path, '.conda-try-write'), mode='wb') as fo: - fo.write(b'This is a test file.\n') - return True - finally: - # XXX: If this raises an exception it will also return False - os.unlink(join(dir_path, '.conda-try-write')) + with tempfile.TemporaryFile(prefix='.conda-try-write', + dir=dir_path) as fo: + fo.write(b'This is a test file.\n') + return True except (IOError, OSError): return False
Race condition for root environment detection Periodically, when two conda processes are running at the same time, it is possible to see a race condition on determining whether the root environment is writable. Notice how the following produces two different configs from the same setup: ``` $ conda info & conda info Current conda install: platform : osx-64 conda version : 3.18.3 conda-build version : 1.18.0 python version : 2.7.10.final.0 requests version : 2.8.1 root environment : /Users/pelson/miniconda (read only) default environment : /Users/pelson/miniconda envs directories : /Users/pelson/.conda/envs /Users/pelson/envs /Users/pelson/miniconda/envs package cache : /Users/pelson/.conda/envs/.pkgs /Users/pelson/envs/.pkgs /Users/pelson/miniconda/pkgs ... Current conda install: platform : osx-64 conda version : 3.18.3 conda-build version : 1.18.0 python version : 2.7.10.final.0 requests version : 2.8.1 root environment : /Users/pelson/miniconda (writable) default environment : /Users/pelson/miniconda envs directories : /Users/pelson/miniconda/envs package cache : /Users/pelson/miniconda/pkgs ... ``` The offending line is in https://github.com/conda/conda/blob/master/conda/config.py#L135-L143 and https://github.com/conda/conda/blob/master/conda/utils.py#L43-L54. My assumption is that the `.conda-try-write` is being removed by the other process, and the exception is being raised in the `finally` block.
2015-10-24T05:46:05
conda/conda
1,807
conda__conda-1807
[ "1751" ]
f46c73c3cb6353a409449fdba08fdbd0856bdb35
diff --git a/conda/cli/main_clean.py b/conda/cli/main_clean.py --- a/conda/cli/main_clean.py +++ b/conda/cli/main_clean.py @@ -151,9 +151,13 @@ def rm_tarballs(args, pkgs_dirs, totalsize, verbose=True): for pkgs_dir in pkgs_dirs: for fn in pkgs_dirs[pkgs_dir]: - if verbose: - print("removing %s" % fn) - os.unlink(os.path.join(pkgs_dir, fn)) + if os.access(os.path.join(pkgs_dir, fn), os.W_OK): + if verbose: + print("Removing %s" % fn) + os.unlink(os.path.join(pkgs_dir, fn)) + else: + if verbose: + print("WARNING: cannot remove, file permissions: %s" % fn) def find_pkgs(): diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -138,6 +138,13 @@ def _remove_readonly(func, path, excinfo): os.chmod(path, stat.S_IWRITE) func(path) +def warn_failed_remove(function, path, exc_info): + if exc_info[1].errno == errno.EACCES: + log.warn("Cannot remove, permission denied: {0}".format(path)) + elif exc_info[1].errno == errno.ENOTEMPTY: + log.warn("Cannot remove, not empty: {0}".format(path)) + else: + log.warn("Cannot remove, unknown reason: {0}".format(path)) def rm_rf(path, max_retries=5, trash=True): """ @@ -152,12 +159,15 @@ def rm_rf(path, max_retries=5, trash=True): # Note that we have to check if the destination is a link because # exists('/path/to/dead-link') will return False, although # islink('/path/to/dead-link') is True. - os.unlink(path) + if os.access(path, os.W_OK): + os.unlink(path) + else: + log.warn("Cannot remove, permission denied: {0}".format(path)) elif isdir(path): for i in range(max_retries): try: - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=False, onerror=warn_failed_remove) return except OSError as e: msg = "Unable to delete %s\n%s\n" % (path, e) @@ -189,7 +199,7 @@ def rm_rf(path, max_retries=5, trash=True): log.debug(msg + "Retrying after %s seconds..." % i) time.sleep(i) # Final time. pass exceptions to caller. - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=False, onerror=warn_failed_remove) def rm_empty_dir(path): """
diff --git a/tests/test_install.py b/tests/test_install.py --- a/tests/test_install.py +++ b/tests/test_install.py @@ -8,7 +8,7 @@ from conda import install -from conda.install import PaddingError, binary_replace, update_prefix +from conda.install import PaddingError, binary_replace, update_prefix, warn_failed_remove from .decorators import skip_if_no_mock from .helpers import mock @@ -140,6 +140,11 @@ def generate_mock_isfile(self, value): with patch.object(install, 'isfile', return_value=value) as isfile: yield isfile + @contextmanager + def generate_mock_os_access(self, value): + with patch.object(install.os, 'access', return_value=value) as os_access: + yield os_access + @contextmanager def generate_mock_unlink(self): with patch.object(install.os, 'unlink') as unlink: @@ -173,25 +178,27 @@ def generate_mock_check_call(self): yield check_call @contextmanager - def generate_mocks(self, islink=True, isfile=True, isdir=True, on_win=False): + def generate_mocks(self, islink=True, isfile=True, isdir=True, on_win=False, os_access=True): with self.generate_mock_islink(islink) as mock_islink: with self.generate_mock_isfile(isfile) as mock_isfile: - with self.generate_mock_isdir(isdir) as mock_isdir: - with self.generate_mock_unlink() as mock_unlink: - with self.generate_mock_rmtree() as mock_rmtree: - with self.generate_mock_sleep() as mock_sleep: - with self.generate_mock_log() as mock_log: - with self.generate_mock_on_win(on_win): - with self.generate_mock_check_call() as check_call: - yield { - 'islink': mock_islink, - 'isfile': mock_isfile, - 'isdir': mock_isdir, - 'unlink': mock_unlink, - 'rmtree': mock_rmtree, - 'sleep': mock_sleep, - 'log': mock_log, - 'check_call': check_call, + with self.generate_mock_os_access(os_access) as mock_os_access: + with self.generate_mock_isdir(isdir) as mock_isdir: + with self.generate_mock_unlink() as mock_unlink: + with self.generate_mock_rmtree() as mock_rmtree: + with self.generate_mock_sleep() as mock_sleep: + with self.generate_mock_log() as mock_log: + with self.generate_mock_on_win(on_win): + with self.generate_mock_check_call() as check_call: + yield { + 'islink': mock_islink, + 'isfile': mock_isfile, + 'isdir': mock_isdir, + 'os_access': mock_os_access, + 'unlink': mock_unlink, + 'rmtree': mock_rmtree, + 'sleep': mock_sleep, + 'log': mock_log, + 'check_call': check_call, } def generate_directory_mocks(self, on_win=False): @@ -219,6 +226,13 @@ def test_calls_unlink_on_true_islink(self): install.rm_rf(some_path) mocks['unlink'].assert_called_with(some_path) + @skip_if_no_mock + def test_does_not_call_unlink_on_os_access_false(self): + with self.generate_mocks(os_access=False) as mocks: + some_path = self.generate_random_path + install.rm_rf(some_path) + self.assertFalse(mocks['unlink'].called) + @skip_if_no_mock def test_does_not_call_isfile_if_islink_is_true(self): with self.generate_mocks() as mocks: @@ -259,7 +273,8 @@ def test_calls_rmtree_at_least_once_on_isdir_true(self): with self.generate_directory_mocks() as mocks: some_path = self.generate_random_path install.rm_rf(some_path) - mocks['rmtree'].assert_called_with(some_path) + mocks['rmtree'].assert_called_with( + some_path, onerror=warn_failed_remove, ignore_errors=False) @skip_if_no_mock def test_calls_rmtree_only_once_on_success(self): @@ -342,7 +357,7 @@ def test_tries_extra_kwarg_on_windows(self): install.rm_rf(random_path) expected_call_list = [ - mock.call(random_path), + mock.call(random_path, ignore_errors=False, onerror=warn_failed_remove), mock.call(random_path, onerror=install._remove_readonly) ] mocks['rmtree'].assert_has_calls(expected_call_list)
conda clean -pt as non-root user with root anaconda install I have installed root miniconda at /opt/anaconda. When running ``` conda clean -pt ``` as a lesser user than root, I am seeing errors indicating conda is not checking permissions before attempting to delete package dirs: ``` conda clean -pt Cache location: /opt/anaconda/pkgs Will remove the following tarballs: /opt/anaconda/pkgs ------------------ conda-3.18.3-py27_0.tar.bz2 175 KB conda-env-2.4.4-py27_0.tar.bz2 24 KB itsdangerous-0.24-py27_0.tar.bz2 16 KB markupsafe-0.23-py27_0.tar.bz2 30 KB flask-0.10.1-py27_1.tar.bz2 129 KB jinja2-2.8-py27_0.tar.bz2 263 KB anaconda-build-0.12.0-py27_0.tar.bz2 69 KB flask-wtf-0.8.4-py27_1.tar.bz2 12 KB flask-ldap-login-0.3.0-py27_1.tar.bz2 13 KB --------------------------------------------------- Total: 730 KB removing conda-3.18.3-py27_0.tar.bz2 An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/opt/anaconda/envs/anaconda.org/bin/conda", line 5, in <module> sys.exit(main()) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 195, in main args_func(args, p) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 202, in args_func args.func(args, p) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main_clean.py", line 331, in execute rm_tarballs(args, pkgs_dirs, totalsize, verbose=not args.json) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main_clean.py", line 156, in rm_tarballs os.unlink(os.path.join(pkgs_dir, fn)) OSError: [Errno 13] Permission denied: '/opt/anaconda/pkgs/conda-3.18.3-py27_0.tar.bz2' ```
Hi @csoja - this issue is blocking some key Build System stability fixes. LMK if this can be prioritized (along with #1752 above) @stephenakearns and @PeterDSteinberg and @csoja this issue is also now preventing us from moving forward with the anaconda-cluster build scripts. @csoja - I know you're strapped for resources and may have a new person taking a look at this. Can we bring it up in the platform meeting to discuss a possible solution
2015-11-11T20:20:17
conda/conda
1,808
conda__conda-1808
[ "1752" ]
f46c73c3cb6353a409449fdba08fdbd0856bdb35
diff --git a/conda/cli/main_clean.py b/conda/cli/main_clean.py --- a/conda/cli/main_clean.py +++ b/conda/cli/main_clean.py @@ -151,9 +151,13 @@ def rm_tarballs(args, pkgs_dirs, totalsize, verbose=True): for pkgs_dir in pkgs_dirs: for fn in pkgs_dirs[pkgs_dir]: - if verbose: - print("removing %s" % fn) - os.unlink(os.path.join(pkgs_dir, fn)) + if os.access(os.path.join(pkgs_dir, fn), os.W_OK): + if verbose: + print("Removing %s" % fn) + os.unlink(os.path.join(pkgs_dir, fn)) + else: + if verbose: + print("WARNING: cannot remove, file permissions: %s" % fn) def find_pkgs(): @@ -163,6 +167,9 @@ def find_pkgs(): pkgs_dirs = defaultdict(list) for pkgs_dir in config.pkgs_dirs: + if not os.path.exists(pkgs_dir): + print("WARNING: {0} does not exist".format(pkgs_dir)) + continue pkgs = [i for i in listdir(pkgs_dir) if isdir(join(pkgs_dir, i)) and # Only include actual packages isdir(join(pkgs_dir, i, 'info'))] diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -138,6 +138,13 @@ def _remove_readonly(func, path, excinfo): os.chmod(path, stat.S_IWRITE) func(path) +def warn_failed_remove(function, path, exc_info): + if exc_info[1].errno == errno.EACCES: + log.warn( "WARNING: cannot remove, permission denied: %s" % path ) + elif exc_info[1].errno == errno.ENOTEMPTY: + log.warn( "WARNING: cannot remove, not empty: %s" % path ) + else: + log.warn( "WARNING: cannot remove, unknown reason: %s" % path ) def rm_rf(path, max_retries=5, trash=True): """ @@ -152,12 +159,15 @@ def rm_rf(path, max_retries=5, trash=True): # Note that we have to check if the destination is a link because # exists('/path/to/dead-link') will return False, although # islink('/path/to/dead-link') is True. - os.unlink(path) + if os.access(path, os.W_OK): + os.unlink(path) + else: + log.warn("WARNING: cannot remove, permission denied: %s" % path) elif isdir(path): for i in range(max_retries): try: - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=False, onerror=warn_failed_remove) return except OSError as e: msg = "Unable to delete %s\n%s\n" % (path, e) @@ -189,7 +199,7 @@ def rm_rf(path, max_retries=5, trash=True): log.debug(msg + "Retrying after %s seconds..." % i) time.sleep(i) # Final time. pass exceptions to caller. - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=False, onerror=warn_failed_remove) def rm_empty_dir(path): """
diff --git a/tests/test_install.py b/tests/test_install.py --- a/tests/test_install.py +++ b/tests/test_install.py @@ -8,7 +8,7 @@ from conda import install -from conda.install import PaddingError, binary_replace, update_prefix +from conda.install import PaddingError, binary_replace, update_prefix, warn_failed_remove from .decorators import skip_if_no_mock from .helpers import mock @@ -140,6 +140,11 @@ def generate_mock_isfile(self, value): with patch.object(install, 'isfile', return_value=value) as isfile: yield isfile + @contextmanager + def generate_mock_os_access(self, value): + with patch.object(install.os, 'access', return_value=value) as os_access: + yield os_access + @contextmanager def generate_mock_unlink(self): with patch.object(install.os, 'unlink') as unlink: @@ -173,25 +178,27 @@ def generate_mock_check_call(self): yield check_call @contextmanager - def generate_mocks(self, islink=True, isfile=True, isdir=True, on_win=False): + def generate_mocks(self, islink=True, isfile=True, isdir=True, on_win=False, os_access=True): with self.generate_mock_islink(islink) as mock_islink: with self.generate_mock_isfile(isfile) as mock_isfile: - with self.generate_mock_isdir(isdir) as mock_isdir: - with self.generate_mock_unlink() as mock_unlink: - with self.generate_mock_rmtree() as mock_rmtree: - with self.generate_mock_sleep() as mock_sleep: - with self.generate_mock_log() as mock_log: - with self.generate_mock_on_win(on_win): - with self.generate_mock_check_call() as check_call: - yield { - 'islink': mock_islink, - 'isfile': mock_isfile, - 'isdir': mock_isdir, - 'unlink': mock_unlink, - 'rmtree': mock_rmtree, - 'sleep': mock_sleep, - 'log': mock_log, - 'check_call': check_call, + with self.generate_mock_os_access(os_access) as mock_os_access: + with self.generate_mock_isdir(isdir) as mock_isdir: + with self.generate_mock_unlink() as mock_unlink: + with self.generate_mock_rmtree() as mock_rmtree: + with self.generate_mock_sleep() as mock_sleep: + with self.generate_mock_log() as mock_log: + with self.generate_mock_on_win(on_win): + with self.generate_mock_check_call() as check_call: + yield { + 'islink': mock_islink, + 'isfile': mock_isfile, + 'isdir': mock_isdir, + 'os_access': mock_os_access, + 'unlink': mock_unlink, + 'rmtree': mock_rmtree, + 'sleep': mock_sleep, + 'log': mock_log, + 'check_call': check_call, } def generate_directory_mocks(self, on_win=False): @@ -219,6 +226,13 @@ def test_calls_unlink_on_true_islink(self): install.rm_rf(some_path) mocks['unlink'].assert_called_with(some_path) + @skip_if_no_mock + def test_does_not_call_unlink_on_os_access_false(self): + with self.generate_mocks(os_access=False) as mocks: + some_path = self.generate_random_path + install.rm_rf(some_path) + self.assertFalse(mocks['unlink'].called) + @skip_if_no_mock def test_does_not_call_isfile_if_islink_is_true(self): with self.generate_mocks() as mocks: @@ -259,7 +273,8 @@ def test_calls_rmtree_at_least_once_on_isdir_true(self): with self.generate_directory_mocks() as mocks: some_path = self.generate_random_path install.rm_rf(some_path) - mocks['rmtree'].assert_called_with(some_path) + mocks['rmtree'].assert_called_with( + some_path, onerror=warn_failed_remove, ignore_errors=False) @skip_if_no_mock def test_calls_rmtree_only_once_on_success(self): @@ -342,7 +357,7 @@ def test_tries_extra_kwarg_on_windows(self): install.rm_rf(random_path) expected_call_list = [ - mock.call(random_path), + mock.call(random_path, ignore_errors=False, onerror=warn_failed_remove), mock.call(random_path, onerror=install._remove_readonly) ] mocks['rmtree'].assert_has_calls(expected_call_list)
conda clean -pt with empty package cache and non-root user I have a root miniconda install at /opt/anaconda. I ran ``` conda clean -pt ``` successfully as root then immediately tried running the same command as a lesser user. I got this error even though the package cache was empty: ``` Cache location: There are no tarballs to remove An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/opt/anaconda/envs/anaconda.org/bin/conda", line 5, in <module> sys.exit(main()) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 195, in main args_func(args, p) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 202, in args_func args.func(args, p) File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main_clean.py", line 340, in execute pkgs_dirs, warnings, totalsize, pkgsizes = find_pkgs() File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main_clean.py", line 166, in find_pkgs pkgs = [i for i in listdir(pkgs_dir) if isdir(join(pkgs_dir, i)) and OSError: [Errno 2] No such file or directory: '/home/user5/envs/.pkgs' ```
Appears somewhat related to #1751. Fixing #1751 and #1752 is necessary for the future needs of anaconda-build.
2015-11-11T21:17:30
conda/conda
1,944
conda__conda-1944
[ "1285" ]
4db6b4e58c6efa70e461dd68a90d812d4a634619
diff --git a/conda/cli/main_clean.py b/conda/cli/main_clean.py --- a/conda/cli/main_clean.py +++ b/conda/cli/main_clean.py @@ -65,6 +65,95 @@ def configure_parser(sub_parsers): p.set_defaults(func=execute) +# work-around for python bug on Windows prior to python 3.2 +# https://bugs.python.org/issue10027 +# Adapted from the ntfsutils package, Copyright (c) 2012, the Mozilla Foundation +class CrossPlatformStLink(object): + _st_nlink = None + + def __call__(self, path): + return self.st_nlink(path) + + @classmethod + def st_nlink(cls, path): + if cls._st_nlink is None: + cls._initialize() + return cls._st_nlink(path) + + @classmethod + def _standard_st_nlink(cls, path): + return lstat(path).st_nlink + + @classmethod + def _windows_st_nlink(cls, path): + st_nlink = cls._standard_st_nlink(path) + if st_nlink != 0: + return st_nlink + else: + # cannot trust python on Windows when st_nlink == 0 + # get value using windows libraries to be sure of its true value + # Adapted from the ntfsutils package, Copyright (c) 2012, the Mozilla Foundation + GENERIC_READ = 0x80000000 + FILE_SHARE_READ = 0x00000001 + OPEN_EXISTING = 3 + hfile = cls.CreateFile(path, GENERIC_READ, FILE_SHARE_READ, None, + OPEN_EXISTING, 0, None) + if hfile is None: + from ctypes import WinError + raise WinError() + info = cls.BY_HANDLE_FILE_INFORMATION() + rv = cls.GetFileInformationByHandle(hfile, info) + cls.CloseHandle(hfile) + if rv == 0: + from ctypes import WinError + raise WinError() + return info.nNumberOfLinks + + @classmethod + def _initialize(cls): + if os.name != 'nt': + cls._st_nlink = cls._standard_st_nlink + else: + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858 + import ctypes + from ctypes import POINTER, WinError + from ctypes.wintypes import DWORD, HANDLE, BOOL + + cls.CreateFile = ctypes.windll.kernel32.CreateFileW + cls.CreateFile.argtypes = [ctypes.c_wchar_p, DWORD, DWORD, ctypes.c_void_p, + DWORD, DWORD, HANDLE] + cls.CreateFile.restype = HANDLE + + # http://msdn.microsoft.com/en-us/library/windows/desktop/ms724211 + cls.CloseHandle = ctypes.windll.kernel32.CloseHandle + cls.CloseHandle.argtypes = [HANDLE] + cls.CloseHandle.restype = BOOL + + class FILETIME(ctypes.Structure): + _fields_ = [("dwLowDateTime", DWORD), + ("dwHighDateTime", DWORD)] + + class BY_HANDLE_FILE_INFORMATION(ctypes.Structure): + _fields_ = [("dwFileAttributes", DWORD), + ("ftCreationTime", FILETIME), + ("ftLastAccessTime", FILETIME), + ("ftLastWriteTime", FILETIME), + ("dwVolumeSerialNumber", DWORD), + ("nFileSizeHigh", DWORD), + ("nFileSizeLow", DWORD), + ("nNumberOfLinks", DWORD), + ("nFileIndexHigh", DWORD), + ("nFileIndexLow", DWORD)] + cls.BY_HANDLE_FILE_INFORMATION = BY_HANDLE_FILE_INFORMATION + + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa364952 + cls.GetFileInformationByHandle = ctypes.windll.kernel32.GetFileInformationByHandle + cls.GetFileInformationByHandle.argtypes = [HANDLE, POINTER(BY_HANDLE_FILE_INFORMATION)] + cls.GetFileInformationByHandle.restype = BOOL + + cls._st_nlink = cls._windows_st_nlink + + def find_lock(): from os.path import join @@ -164,7 +253,8 @@ def find_pkgs(): # TODO: This doesn't handle packages that have hard links to files within # themselves, like bin/python3.3 and bin/python3.3m in the Python package warnings = [] - + + cross_platform_st_nlink = CrossPlatformStLink() pkgs_dirs = defaultdict(list) for pkgs_dir in config.pkgs_dirs: if not os.path.exists(pkgs_dir): @@ -180,11 +270,11 @@ def find_pkgs(): break for fn in files: try: - stat = lstat(join(root, fn)) + st_nlink = cross_platform_st_nlink(join(root, fn)) except OSError as e: warnings.append((fn, e)) continue - if stat.st_nlink > 1: + if st_nlink > 1: # print('%s is installed: %s' % (pkg, join(root, fn))) breakit = True break
conda clean -p breaks hard linking of new installs @asmeurer Following on from conda/conda#68: On Windows 8 (and probably equally on all other windows versions), `conda clean -p` removes all extracted packaged from the `pkgs` directory even if they are hard linked in some environments. While all existing environments will continue to function, creation of a new environment with the same packages causes conda to extract the packages again and to hard link to the newly extracted files. This massively increases disk usage and results in the opposite of what a user running `conda clean` was attempting to achieve. The problem lies in `main_clean.py` and the fact that on Windows `lstat(file).st_nlink` always returns 0, even if `file` is hard linked. (This seems to have been fixed from python 3.2 onwards: https://bugs.python.org/issue10027) As a stop gap measure `conda clean -p` should be prevented from being run on windows until a better solution can be found. ``` C:\>conda list # packages in environment at C:\Anaconda: # conda 3.10.1 py27_0 conda-env 2.1.4 py27_0 menuinst 1.0.4 py27_0 psutil 2.2.1 py27_0 pycosat 0.6.1 py27_0 python 2.7.9 1 pyyaml 3.11 py27_0 requests 2.6.0 py27_0 ```
Yep, pretty annoying issue. > The problem lies in main_clean.py and the fact that on Windows lstat(file).st_nlink always returns 0, even if file is hard linked. (This seems to have been fixed from python 3.2 onwards: https://bugs.python.org/issue10027) If it's really the case then WinAPI **GetFileInformationByHandle** should be used. The nNumberOfLinks field of the BY_HANDLE_FILE_INFORMATION structure is exactly what we want. **ntfsutils** has very nice implementation of the thing here http://pydoc.net/Python/ntfsutils/0.1.3/ntfsutils.fs/ , I guess it can be borrowed. You know, `if getfileinfo(path).nNumberOfLinks > 1: ...`
2016-01-08T15:05:30
conda/conda
2,108
conda__conda-2108
[ "2093" ]
d637298bb13b5434a989174ebe9acea3d7a0e2a0
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -101,7 +101,9 @@ def send(self, request, stream=None, timeout=None, verify=None, cert=None, import boto except ImportError: stderrlog.info('\nError: boto is required for S3 channels. ' - 'Please install it with: conda install boto\n') + 'Please install it with `conda install boto`\n' + 'Make sure to run `source deactivate` if you ' + 'are in a conda environment.\n') resp.status_code = 404 return resp
confusing error message when boto is missing If one tries to install from an s3 channel (e.g., `conda install foo -c s3://bar/baz/conda`) while in an environment, this message shows up: `Error: boto is required for S3 channels. Please install it with: conda install boto`. Installing `boto` in the environment doesn't actually solve the problem, however, because `boto` has to be installed into the main set of packages (e.g., `source deactivate; conda install boto`). Perhaps a simple edit to the error message would address this. (e.g., `Error: boto is required for S3 channels. Please install it with: conda install boto. Make sure to run "source deactivate" if you are in an environment.`)
2016-02-19T22:10:29
conda/conda
2,226
conda__conda-2226
[ "2224" ]
c91a2ecf8ccc7fe4c4545373dc89b0b22fcddba5
diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -1014,8 +1014,13 @@ def clean(sol): dashlist(', '.join(diff) for diff in diffs), '\n ... and others' if nsol > 10 else '')) + def stripfeat(sol): + return sol.split('[')[0] stdoutlog.info('\n') - return list(map(sorted, psolutions)) if returnall else sorted(psolutions[0]) + if returnall: + return [sorted(map(stripfeat, psol)) for psol in psolutions] + else: + return sorted(map(stripfeat, psolutions[0])) except: stdoutlog.info('\n') raise
conda 4.0.2 failure during dependency resolution This command fails in Linux and OS X ``` conda create -n testconda anaconda accelerate tornado=4.0.2 ``` with this traceback: ``` Traceback (most recent call last): File "/Users/ewelch/miniconda/bin/conda", line 6, in <module> sys.exit(main()) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 139, in main args_func(args, p) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 146, in args_func args.func(args, p) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 49, in execute install.install(args, parser, 'create') File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 334, in install update_deps=args.update_deps) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/plan.py", line 435, in install_actions smh = r.dependency_sort(must_have) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 730, in dependency_sort depends = lookup(value) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 725, in lookup return set(ms.name for ms in self.ms_depends(value + '.tar.bz2')) File "/Users/ewelch/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 574, in ms_depends deps = [MatchSpec(d) for d in self.index[fn].get('depends', [])] KeyError: u'anaconda-2.1.0-np19py27_0.tar..tar.bz2' ``` Here is my `conda info`: ``` platform : osx-64 conda version : 4.0.2 conda-build version : 1.18.1 python version : 2.7.11.final.0 requests version : 2.9.1 root environment : /Users/ewelch/miniconda (writable) default environment : /Users/ewelch/miniconda envs directories : /Users/ewelch/miniconda/envs package cache : /Users/ewelch/miniconda/pkgs channel URLs : https://conda.binstar.org/javascript/osx-64/ https://conda.binstar.org/javascript/noarch/ https://conda.binstar.org/wakari/osx-64/ https://conda.binstar.org/wakari/noarch/ https://repo.continuum.io/pkgs/free/osx-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/osx-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /Users/ewelch/.condarc is foreign system : False ``` I can circumvent the exception by using the following diff. I don't propose that this is the solution (I don't know the code well enough), but I hope it's a useful starting point: ``` diff diff --git a/conda/plan.py b/conda/plan.py index a7fd836..519dedf 100644 --- a/conda/plan.py +++ b/conda/plan.py @@ -412,7 +412,7 @@ def install_actions(prefix, index, specs, force=False, only_names=None, pkgs = r.install(specs, [d + '.tar.bz2' for d in linked], update_deps=update_deps) for fn in pkgs: - dist = fn[:-8] + dist = fn[:fn.rindex('.tar.bz2')] name = install.name_dist(dist) if not name or only_names and name not in only_names: continue ``` The reason this fix works is that the filename, `fn`, is `anaconda-2.1.0-np19py27_0.tar.bz2[mkl]`, and the code assumes it ends in `.tar.bz2`.
@mcg1969 First time I'm seeing this. Guessing this problem would still exist in the `4.0.x` branch? @eriknw Thanks for the awesome report and digging in with a workable patch. Yes, the problem still exists in the `4.0.x` branch. Thanks Eric! I will look at this in the morning A quick bifurcation reveals this commit is the culprit: 7d1f930 I'd say that just revealed the bug, it didn't cause it. Odd. I can't reproduce it in my test notebook. Erik, can you do a `--debug` run and post the output here? Nevermind, I have it. Did I tell anyone I hate `with_features_depends` with a white hot burning hate? I do you know. Great, good luck. If we're looking for a commit to blame, this one is highly suspect to me: https://github.com/conda/conda/commit/b5232f08ba4c3f5041aed70d54af3d25607102e8#diff-52a8935af92ea699b0cbb5feb84c19a2R445 The `for` loop linked above assigns names that include features, which will create names like `anaconda-2.1.0-np19py27_0.tar.bz2[mkl]`. This breaks the assumption (revealed in the diff in the OP) that the key ends with `".tar.bz2"`. After we make it through 4.0, I'd like to consider either clarification or alternatives to how we currently use features. I think @mcg1969 would +1. Oh, and we need a data model and real package objects. This string parsing thing is beyond ridiculous. `4.?` I'm 100% with you. Here's the story. `with_features_depends` is a pain in the butt to deal with. Basically, it takes two (or more) different packages---one with features, one without---and combines them together into one metadata blob. To cleanly handle both, I create two separate packages in the index. The `[mkl]` suffix is the featured version. For some reason I've lost the code that ensures these feature suffixes don't make it out into the wild. Of course, with a proper data model, where we trade Package object pointers instead of filenames pretending to be pointers, we won't have this problem. These two "virtual" packages will have the same _internal_ filename, but will be unique in the eyes of the solver.
2016-03-10T06:31:15
conda/conda
2,291
conda__conda-2291
[ "2284" ]
c3d54a1bd6a15dcea2ce900b0900c369bb848907
diff --git a/conda/cli/activate.py b/conda/cli/activate.py --- a/conda/cli/activate.py +++ b/conda/cli/activate.py @@ -124,10 +124,13 @@ def main(): if rootpath: path = path.replace(translate_stream(rootpath, win_path_to_cygwin), "") else: - path = translate_stream(path, win_path_to_unix) + if sys.platform == 'win32': + path = translate_stream(path, win_path_to_unix) + if rootpath: + rootpath = translate_stream(rootpath, win_path_to_unix) # Clear the root path if it is present if rootpath: - path = path.replace(translate_stream(rootpath, win_path_to_unix), "") + path = path.replace(rootpath, "") elif sys.argv[1] == '..deactivate': diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -66,11 +66,12 @@ def win_path_to_unix(path, root_prefix=""): Does not add cygdrive. If you need that, set root_prefix to "/cygdrive" """ - import re - path_re = '[a-zA-Z]:[/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;/\\\\]*' - converted_paths = [root_prefix + "/" + _path.replace("\\", "/").replace(":", "") - for _path in re.findall(path_re, path)] - return ":".join(converted_paths) + path_re = '(?<![:/^a-zA-Z])([a-zA-Z]:[\/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;\/\\\\]+?(?![a-zA-Z]:))' + translation = lambda found_path: root_prefix + "/" + found_path.groups()[0].replace("\\", "/")\ + .replace(":", "") + translation = re.sub(path_re, translation, path) + translation = translation.replace(";/", ":/") + return translation on_win = bool(sys.platform == "win32") diff --git a/conda/utils.py b/conda/utils.py --- a/conda/utils.py +++ b/conda/utils.py @@ -81,10 +81,12 @@ def win_path_to_unix(path, root_prefix=""): Does not add cygdrive. If you need that, set root_prefix to "/cygdrive" """ - path_re = '(?<![:/])([a-zA-Z]:[\/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;\/\\\\]+?(?![a-zA-Z]:))' + path_re = '(?<![:/^a-zA-Z])([a-zA-Z]:[\/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;\/\\\\]+?(?![a-zA-Z]:))' translation = lambda found_path: root_prefix + "/" + found_path.groups()[0].replace("\\", "/")\ - .replace(":", "").replace(";", ":") - return re.sub(path_re, translation, path) + .replace(":", "") + translation = re.sub(path_re, translation, path) + translation = translation.replace(";/", ":/") + return translation def unix_path_to_win(path, root_prefix=""): @@ -100,7 +102,7 @@ def unix_path_to_win(path, root_prefix=""): translation = lambda found_path: found_path.group(0)[len(root_prefix)+1] + ":" + \ found_path.group(0)[len(root_prefix)+2:].replace("/", "\\") translation = re.sub(path_re, translation, path) - translation = re.sub(":([a-zA-Z]):", lambda match: ";" + match.group(0)[1] + ":", translation) + translation = re.sub(":?([a-zA-Z]):\\\\", lambda match: ";" + match.group(0)[1] + ":\\", translation) return translation
diff --git a/tests/test_activate.py b/tests/test_activate.py --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -226,12 +226,12 @@ def _format_vars(shell): def test_path_translation(): - test_cygwin_path = "/usr/bin:/cygdrive/z/documents (x86)/code/conda/tests/envskhkzts/test1:/cygdrive/z/documents/code/conda/tests/envskhkzts/test1/cmd" - test_unix_path = "/usr/bin:/z/documents (x86)/code/conda/tests/envskhkzts/test1:/z/documents/code/conda/tests/envskhkzts/test1/cmd" - test_win_path = "z:\\documents (x86)\\code\\conda\\tests\\envskhkzts\\test1;z:\\documents\\code\\conda\\tests\\envskhkzts\\test1\\cmd" + test_cygwin_path = "test dummy text /usr/bin:/cygdrive/z/documents (x86)/code/conda/tests/envskhkzts/test1:/cygdrive/z/documents/code/conda/tests/envskhkzts/test1/cmd more dummy text" + test_unix_path = "test dummy text /usr/bin:/z/documents (x86)/code/conda/tests/envskhkzts/test1:/z/documents/code/conda/tests/envskhkzts/test1/cmd more dummy text" + test_win_path = "test dummy text /usr/bin;z:\\documents (x86)\\code\\conda\\tests\\envskhkzts\\test1;z:\\documents\\code\\conda\\tests\\envskhkzts\\test1\\cmd more dummy text" assert_equals(test_win_path, unix_path_to_win(test_unix_path)) - assert_equals(test_unix_path.replace("/usr/bin:", ""), win_path_to_unix(test_win_path)) - assert_equals(test_cygwin_path.replace("/usr/bin:", ""), win_path_to_cygwin(test_win_path)) + assert_equals(test_unix_path, win_path_to_unix(test_win_path)) + assert_equals(test_cygwin_path, win_path_to_cygwin(test_win_path)) assert_equals(test_win_path, cygwin_path_to_win(test_cygwin_path))
activate on master is broken in OSX @msarahan I'm on master, and I get: ``` $ source activate koo path:usage: conda [-h] [-V] [--debug] command ... conda: error: argument command: invalid choice: '..changeps1' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'run', 'config', 'init', 'clean', 'package', 'bundle') prepending /Users/ilan/python/envs/koo and /Users/ilan/python/envs/koo/cmd and /Users/ilan/python/envs/koo/bin to PATH -bash: awk: command not found -bash: dirname: command not found Traceback (most recent call last): File "/Users/ilan/python/bin/conda", line 4, in <module> from conda.cli.main import main File "/Users/ilan/conda/conda/__init__.py", line 19, in <module> __version__ = get_version(__file__, __name__) File "/Users/ilan/python/lib/python2.7/site-packages/auxlib/packaging.py", line 93, in get_version if is_git_repo(here): File "/Users/ilan/python/lib/python2.7/site-packages/auxlib/packaging.py", line 70, in is_git_repo return call(('git', 'rev-parse'), cwd=path) == 0 File "/Users/ilan/python/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "/Users/ilan/python/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/Users/ilan/python/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception ``` It is true that the new activate scripts depend on `awk` and `dirname`?
> the new activate scripts The usage of awk and dirname are not new: https://github.com/conda/conda-env/blame/develop/bin/activate#L32 That's conda-env, of course, but that's where the scripts that are now in conda came from. Something else is going wrong. It might be a bug in the path translation stuff. It is supposed to just be a pass-through on *nix to *nix, but I did see some issues like this in fixing the tests. I'll look into it and see if I can improve the tests to catch whatever is happening here.
2016-03-19T19:56:18
conda/conda
2,355
conda__conda-2355
[ "2345" ]
f8cfd1e9998ed2503480d1a26f932f337838731f
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -515,7 +515,12 @@ def try_hard_link(pkgs_dir, prefix, dist): if not isdir(prefix): os.makedirs(prefix) _link(src, dst, LINK_HARD) - return True + # Some file systems (at least BeeGFS) do not support hard-links + # between files in different directories. Depending on the + # file system configuration, a symbolic link may be created + # instead. If a symbolic link is created instead of a hard link, + # return False. + return not os.path.islink(dst) except OSError: return False finally:
BeeGFS hard-links [BeeGFS](http://www.beegfs.com), a parallel cluster file system, [does not support](https://groups.google.com/forum/#!topic/fhgfs-user/cTJcqGZceVA) `hard-links` between files in differents directories. Depending on the [configuration](https://groups.google.com/forum/#!topic/fhgfs-user/pvQSo0QWicw), either an error is issued, or a `symbolic-link` is created. If a `symbolic-link` is created instead of a `hard-link`, it can cause problem, for example: ``` pkgs/bin/mpicc pkgs/lib/libopen-pal.so envs/bin/mpicc envs/lib/libopen-pal.so ``` Here, when `envs/bin/mpicc` is executed, it is actually `pkgs/bin/mpicc` that is executed, and the library `$PREFIX/../lib/libopen-pal.so` actually loaded is `pkgs/lib/libopen-pal.so,` which is different from `envs/lib/libopen-pal.so` for which conda has fixed hard-coded prefix path, and as a final consequence `mpicc` fails to find its configuration file. #805 is another (closed) related to `BeeGFS`. Would we need a new conda options to turn hard-link into copy?
2016-04-14T06:23:18
conda/conda
2,445
conda__conda-2445
[ "2444" ]
33e1e45b8aee9df5377931619deacfb250be3986
diff --git a/conda/cli/main_info.py b/conda/cli/main_info.py --- a/conda/cli/main_info.py +++ b/conda/cli/main_info.py @@ -148,7 +148,7 @@ def execute(args, parser): import conda.config as config from conda.resolve import Resolve from conda.cli.main_init import is_initialized - from conda.api import get_index, get_package_versions + from conda.api import get_index if args.root: if args.json: @@ -158,21 +158,19 @@ def execute(args, parser): return if args.packages: - if args.json: - results = defaultdict(list) - for arg in args.packages: - for pkg in get_package_versions(arg): - results[arg].append(pkg._asdict()) - common.stdout_json(results) - return index = get_index() r = Resolve(index) - specs = map(common.arg2spec, args.packages) - - for spec in specs: - versions = r.get_pkgs(spec) - for pkg in sorted(versions): - pretty_package(pkg) + if args.json: + common.stdout_json({ + package: [p._asdict() + for p in sorted(r.get_pkgs(common.arg2spec(package)))] + for package in args.packages + }) + else: + for package in args.packages: + versions = r.get_pkgs(common.arg2spec(package)) + for pkg in sorted(versions): + pretty_package(pkg) return options = 'envs', 'system', 'license'
diff --git a/tests/test_info.py b/tests/test_info.py --- a/tests/test_info.py +++ b/tests/test_info.py @@ -1,6 +1,8 @@ from __future__ import print_function, absolute_import, division +import json from conda import config +from conda.cli import main_info from tests.helpers import run_conda_command, assert_in, assert_equals @@ -32,3 +34,21 @@ def test_info(): assert_in(conda_info_out, conda_info_all_out) assert_in(conda_info_e_out, conda_info_all_out) assert_in(conda_info_s_out, conda_info_all_out) + + +def test_info_package_json(): + out, err = run_conda_command("info", "--json", "numpy=1.11.0=py35_0") + assert err == "" + + out = json.loads(out) + assert set(out.keys()) == {"numpy=1.11.0=py35_0"} + assert len(out["numpy=1.11.0=py35_0"]) == 1 + assert isinstance(out["numpy=1.11.0=py35_0"], list) + + out, err = run_conda_command("info", "--json", "numpy") + assert err == "" + + out = json.loads(out) + assert set(out.keys()) == {"numpy"} + assert len(out["numpy"]) > 1 + assert isinstance(out["numpy"], list)
conda info --json and package lookup If you set the `--json` flag for `conda info` when searching for packages, you sometimes get nothing: ``` bash $ conda info numpy=1.11.0=py35_0 Fetching package metadata: .... numpy 1.11.0 py35_0 ------------------- file name : numpy-1.11.0-py35_0.tar.bz2 name : numpy version : 1.11.0 build number: 0 build string: py35_0 channel : defaults size : 6.1 MB date : 2016-03-28 license : BSD md5 : 1900998c19c5e310687013f95374bba2 installed environments: dependencies: mkl 11.3.1 python 3.5* $ conda info --json numpy=1.11.0=py35_0 {} ``` Things work fine for `conda info --json numpy`, so it's something with the spec format. conda info: ``` platform : linux-64 conda version : 4.0.5 conda-build version : not installed python version : 2.7.11.final.0 requests version : 2.9.1 root environment : /opt/conda (writable) default environment : /opt/conda envs directories : /opt/conda/envs package cache : /opt/conda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None is foreign system : False ```
2016-05-08T06:59:02
conda/conda
2,472
conda__conda-2472
[ "2389" ]
91847aab60b571a5d89b5e2a582612b3cd383f7e
diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -113,7 +113,6 @@ def get_rc_path(): def load_condarc(path): if not path or not isfile(path): - print("no path!") return {} with open(path) as f: return yaml_load(f) or {}
When no condarc is found "no path!" is printed Why was https://github.com/conda/conda/blob/master/conda/config.py#L115 added? Is this a debug statement which never got removed?
Yes, sorry. I'll fix. I just ran into this. Aside: is there good guidance for users looking to use conda outside of Anaconda (e.g. with some custom repo of packages but not really using anything in defaults)?
2016-05-12T17:25:57
conda/conda
2,482
conda__conda-2482
[ "2449" ]
cf91f160c171832055fe5a9189609c7e8ae090dc
diff --git a/conda/cli/activate.py b/conda/cli/activate.py --- a/conda/cli/activate.py +++ b/conda/cli/activate.py @@ -147,13 +147,13 @@ def main(): # this should throw an error and exit if the env or path can't be found. try: - binpath = binpath_from_arg(sys.argv[2], shelldict=shelldict) + prefix = prefix_from_arg(sys.argv[2], shelldict=shelldict) except ValueError as e: sys.exit(getattr(e, 'message', e)) # Make sure an env always has the conda symlink try: - conda.install.symlink_conda(shelldict['path_from'](binpath[0]), root_dir, shell) + conda.install.symlink_conda(prefix, root_dir, shell) except (IOError, OSError) as e: if e.errno == errno.EPERM or e.errno == errno.EACCES: msg = ("Cannot activate environment {0}, not have write access to conda symlink"
conda v4.1.0rc1 doesn't link conda or activate into created env The trace below should demonstrate the problem. As an aside, notice that PS1 is also mixed up: two round brackets and no space after '$' sign. ``` bash ijstokes@petawawa ~ $ which conda /Users/ijstokes/anaconda/bin/conda ijstokes@petawawa ~ $ conda -V conda 4.1.0rc1 ijstokes@petawawa ~ $ conda create -n testenv bokeh notebook Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata ........... Solving package specifications ............ Package plan for installation in environment /Users/ijstokes/anaconda/envs/testenv: The following packages will be downloaded: package | build ---------------------------|----------------- functools32-3.2.3.2 | py27_0 15 KB markupsafe-0.23 | py27_0 22 KB jsonschema-2.5.1 | py27_0 55 KB singledispatch-3.4.0.3 | py27_0 12 KB ipython-4.2.0 | py27_0 930 KB ------------------------------------------------------------ Total: 1.0 MB The following NEW packages will be INSTALLED: appnope: 0.1.0-py27_0 backports: 1.0-py27_0 backports_abc: 0.4-py27_0 bokeh: 0.11.1-py27_0 configparser: 3.5.0b2-py27_1 decorator: 4.0.9-py27_0 entrypoints: 0.2-py27_1 functools32: 3.2.3.2-py27_0 futures: 3.0.5-py27_0 get_terminal_size: 1.0.0-py27_0 ipykernel: 4.3.1-py27_0 ipython: 4.2.0-py27_0 ipython_genutils: 0.1.0-py27_0 jinja2: 2.8-py27_0 jsonschema: 2.5.1-py27_0 jupyter_client: 4.2.2-py27_0 jupyter_core: 4.1.0-py27_0 markupsafe: 0.23-py27_0 mistune: 0.7.2-py27_1 mkl: 11.3.1-0 nbconvert: 4.2.0-py27_0 nbformat: 4.0.1-py27_0 notebook: 4.2.0-py27_0 numpy: 1.11.0-py27_0 openssl: 1.0.2h-0 path.py: 8.2.1-py27_0 pexpect: 4.0.1-py27_0 pickleshare: 0.5-py27_0 pip: 8.1.1-py27_1 ptyprocess: 0.5-py27_0 pygments: 2.1.3-py27_0 python: 2.7.11-0 python-dateutil: 2.5.2-py27_0 pyyaml: 3.11-py27_1 pyzmq: 15.2.0-py27_0 readline: 6.2-2 requests: 2.9.1-py27_0 setuptools: 20.7.0-py27_0 simplegeneric: 0.8.1-py27_0 singledispatch: 3.4.0.3-py27_0 six: 1.10.0-py27_0 sqlite: 3.9.2-0 ssl_match_hostname: 3.4.0.2-py27_1 terminado: 0.5-py27_1 tk: 8.5.18-0 tornado: 4.3-py27_0 traitlets: 4.2.1-py27_0 wheel: 0.29.0-py27_0 yaml: 0.1.6-0 zlib: 1.2.8-0 Proceed ([y]/n)? y Fetching packages ... functools32-3. 100% |############################################################################| Time: 0:00:00 245.53 kB/s markupsafe-0.2 100% |############################################################################| Time: 0:00:00 267.15 kB/s jsonschema-2.5 100% |############################################################################| Time: 0:00:01 55.12 kB/s singledispatch 100% |############################################################################| Time: 0:00:00 204.19 kB/s ipython-4.2.0- 100% |############################################################################| Time: 0:00:02 352.48 kB/s Extracting packages ... [ COMPLETE ]|###############################################################################################| 100% Linking packages ... [ COMPLETE ]|###############################################################################################| 100% # # To activate this environment, use: # $ source activate testenv # # To deactivate this environment, use: # $ source deactivate # ijstokes@petawawa ~ $ source activate testenv prepending /Users/ijstokes/anaconda/envs/testenv/bin to PATH ((testenv)) ijstokes@petawawa ~ $conda info -a -bash: conda: command not found ((testenv)) ijstokes@petawawa ~ $source activate root -bash: activate: No such file or directory ```
``` ((conda-test)) ls -al $CONDA_ENV_PATH/bin/bin total 24 drwxr-xr-x 5 kfranz staff 170B May 13 09:52 ./ drwxr-xr-x 32 kfranz staff 1.1K May 13 09:52 ../ lrwxr-xr-x 1 kfranz staff 19B May 13 09:52 activate@ -> /conda/bin/activate lrwxr-xr-x 1 kfranz staff 16B May 13 09:52 conda@ -> /conda/bin/conda lrwxr-xr-x 1 kfranz staff 21B May 13 09:52 deactivate@ -> /conda/bin/deactivate ``` CC @msarahan FYI. Will fix this one today too.
2016-05-13T21:25:31
conda/conda
2,514
conda__conda-2514
[ "2161" ]
c759a16871f6b20df533e850d3d17ee71d412671
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -91,6 +91,8 @@ def __init__(self, *args, **kwargs): proxies = get_proxy_servers() if proxies: self.proxies = proxies + self.trust_env = False # disable .netrc file + # also disables REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE env variables # Configure retries if retries:
Disable .netrc authentication Anaconda-Server/support#23 When a user has a `~/.netrc` file present, `requests` will use that file to populate the `Authorization` header (using HTTP Basic auth). When authorization fails, conda falls into an infinite loop retrying. To fix this problem in `anaconda-client`, I disabled `.netrc` authorization by adding a `NullAuth` to the `requests.Session`. https://github.com/Anaconda-Server/anaconda-client/pull/298
2016-05-19T07:44:09
conda/conda
2,526
conda__conda-2526
[ "2525" ]
995d6e35a01e46a485784e1c26de9f616f397e4b
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -44,12 +44,10 @@ from os.path import (abspath, basename, dirname, isdir, isfile, islink, join, relpath, normpath) -from conda.compat import iteritems, iterkeys -from conda.config import url_channel, pkgs_dirs, root_dir -from conda.utils import url_path - try: from conda.lock import Locked + from conda.utils import win_path_to_unix, url_path + from conda.config import remove_binstar_tokens, pkgs_dirs, url_channel except ImportError: # Make sure this still works as a standalone script for the Anaconda # installer. @@ -63,9 +61,6 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, traceback): pass -try: - from conda.utils import win_path_to_unix -except ImportError: def win_path_to_unix(path, root_prefix=""): """Convert a path or ;-separated string of paths into a unix representation @@ -78,14 +73,23 @@ def translation(found_path): return root_prefix + "/" + found return re.sub(path_re, translation, path).replace(";/", ":/") -# Make sure the script stays standalone for the installer -try: - from conda.config import remove_binstar_tokens -except ImportError: + def url_path(path): + path = abspath(path) + if sys.platform == 'win32': + path = '/' + path.replace(':', '|').replace('\\', '/') + return 'file://%s' % path + # There won't be any binstar tokens in the installer anyway def remove_binstar_tokens(url): return url + # A simpler version of url_channel will do + def url_channel(url): + return None, 'defaults' + + # We don't use the package cache or trash logic in the installer + pkgs_dirs = [] + on_win = bool(sys.platform == "win32") if on_win: @@ -419,13 +423,15 @@ def create_meta(prefix, dist, info_dir, extra_info): meta = json.load(fi) # add extra info, add to our intenral cache meta.update(extra_info) - load_linked_data(prefix, dist, meta) # write into <env>/conda-meta/<dist>.json meta_dir = join(prefix, 'conda-meta') if not isdir(meta_dir): os.makedirs(meta_dir) with open(join(meta_dir, _dist2filename(dist, '.json')), 'w') as fo: json.dump(meta, fo, indent=2, sort_keys=True) + # only update the package cache if it is loaded for this prefix. + if prefix in linked_data_: + load_linked_data(prefix, dist, meta) def mk_menus(prefix, files, remove=False): @@ -493,7 +499,8 @@ def run_script(prefix, dist, action='post-link', env_prefix=None): def read_url(dist): - return package_cache().get(dist, {}).get('urls', (None,))[0] + res = package_cache().get(dist, {}).get('urls', (None,)) + return res[0] if res else None def read_icondata(source_dir): @@ -595,7 +602,11 @@ def add_cached_package(pdir, url, overwrite=False, urlstxt=False): cache, so that subsequent runs will correctly identify the package. """ package_cache() - dist = url.rsplit('/', 1)[-1] + if '/' in url: + dist = url.rsplit('/', 1)[-1] + else: + dist = url + url = None if dist.endswith('.tar.bz2'): fname = dist dist = dist[:-8] @@ -614,7 +625,7 @@ def add_cached_package(pdir, url, overwrite=False, urlstxt=False): if not (xpkg or xdir): return url = remove_binstar_tokens(url) - channel, schannel = url_channel(url) + _, schannel = url_channel(url) prefix = '' if schannel == 'defaults' else schannel + '::' xkey = xpkg or (xdir + '.tar.bz2') fname_table_[xkey] = fname_table_[url_path(xkey)] = prefix @@ -622,7 +633,7 @@ def add_cached_package(pdir, url, overwrite=False, urlstxt=False): rec = package_cache_.get(fkey) if rec is None: rec = package_cache_[fkey] = dict(files=[], dirs=[], urls=[]) - if url not in rec['urls']: + if url and url not in rec['urls']: rec['urls'].append(url) if xpkg and xpkg not in rec['files']: rec['files'].append(xpkg) @@ -656,10 +667,10 @@ def package_cache(): for url in data.split()[::-1]: if '/' in url: add_cached_package(pdir, url) - for fn in os.listdir(pdir): - add_cached_package(pdir, '<unknown>/' + fn) except IOError: - continue + pass + for fn in os.listdir(pdir): + add_cached_package(pdir, fn) del package_cache_['@'] return package_cache_ @@ -699,7 +710,7 @@ def fetched(): """ Returns the (set of canonical names) of all fetched packages """ - return set(dist for dist, rec in iteritems(package_cache()) if rec['files']) + return set(dist for dist, rec in package_cache().items() if rec['files']) def is_fetched(dist): @@ -735,7 +746,7 @@ def extracted(): """ return the (set of canonical names) of all extracted packages """ - return set(dist for dist, rec in iteritems(package_cache()) if rec['dirs']) + return set(dist for dist, rec in package_cache().items() if rec['dirs']) def is_extracted(dist): @@ -874,7 +885,7 @@ def linked(prefix): """ Return the set of canonical names of linked packages in prefix. """ - return set(iterkeys(linked_data(prefix))) + return set(linked_data(prefix).keys()) def is_linked(prefix, dist): @@ -918,6 +929,7 @@ def move_path_to_trash(path): """ # Try deleting the trash every time we use it. delete_trash() + from conda.config import root_dir for pkg_dir in pkgs_dirs: import tempfile @@ -1149,14 +1161,15 @@ def main(): pkgs_dir = join(prefix, 'pkgs') if opts.verbose: print("prefix: %r" % prefix) + pkgs_dirs.append(pkgs_dir) if opts.file: idists = list(yield_lines(join(prefix, opts.file))) else: - idists = sorted(extracted(pkgs_dir)) + idists = sorted(extracted()) linktype = (LINK_HARD - if try_hard_link(pkgs_dir, prefix, idists[0]) else + if idists and try_hard_link(pkgs_dir, prefix, idists[0]) else LINK_COPY) if opts.verbose: print("linktype: %s" % link_name_map[linktype]) @@ -1164,7 +1177,7 @@ def main(): for dist in idists: if opts.verbose: print("linking: %s" % dist) - link(pkgs_dir, prefix, dist, linktype) + link(prefix, dist, linktype) messages(prefix)
conda.install imports other conda modules I just noted https://github.com/conda/conda/blob/master/conda/install.py#L47, however, it has always been a policy that `conda.install` has to be standalone, see: https://github.com/conda/conda/blob/master/conda/install.py#L22 The problem is that all our installers depend on this, that is, they use `conda.install` as a module for bootstrapping. This means that currently (even though we can build installers) they are broken.
CC @kalefranz @csoja Hmm. This is a more vexing challenge. @mingwandroid, I think some functions of yours are in here, too? Here's what I'm seeing: - `iteritems` and `iterkeys` from `conda.compat` are easily removed. - `url_path` from `conda.utils` can be duplicated. - `pkgs_dirs`: this is needed by the `package_cache` function. `install.main` can populate that value if it is needed. So we can try to import it from conda.config; if that fails we set it to the empty list and let `main` populate that list. - `root_dir`: this is used by `move_path_to_trash`, which the standalone installer doesn't need. That leaves `url_channel`. That one will be a little complicated but I believe we can replace it with a sensible default. Wow @mcg1969 you beat me to digging into all of this. It's like there are three of you. @mingwandroid: according to `config.py`, "root_dir should only be used for testing", but it looks like it's used in `move_path_to_trash`. Checking now .. @mingwandroid I don't think the standalone installer relies on any of that logic, so you shouldn't need to participate in the fix here. I just found that when investigating how to remove the `root_dir` import. I tracked down the `move_path_to_trash` usage of `config.root_dir` to a very old commit. It seems that the specific layout is maintained to make things easier to debug, and I don't personally have a problem with _not_ doing that. ``` Revision: 56539db682df784a02c71c7768fa88104c90ae11 Author: Diogo de Campos <[email protected]> Date: 15/09/2015 21:36:37 Message: move_to_trash will always try to delete old trash Files moved to trash will keep the same directory structure relative to conda root dir. This makes it easier to debug and find out where files are coming from. ---- Modified: conda/install.py ```
2016-05-20T23:42:21
conda/conda
2,529
conda__conda-2529
[ "2527" ]
ff8d814b6a8b075e8a2c4bab5b23691b21d0e902
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -85,10 +85,9 @@ def remove_binstar_tokens(url): # A simpler version of url_channel will do def url_channel(url): - return None, 'defaults' + return url.rsplit('/', 2)[0] + '/' if url and '/' in url else None, 'defaults' - # We don't use the package cache or trash logic in the installer - pkgs_dirs = [] + pkgs_dirs = [join(sys.prefix, 'pkgs')] on_win = bool(sys.platform == "win32") @@ -423,13 +422,14 @@ def create_meta(prefix, dist, info_dir, extra_info): meta = json.load(fi) # add extra info, add to our intenral cache meta.update(extra_info) + if 'url' not in meta: + meta['url'] = read_url(dist) # write into <env>/conda-meta/<dist>.json meta_dir = join(prefix, 'conda-meta') if not isdir(meta_dir): os.makedirs(meta_dir) with open(join(meta_dir, _dist2filename(dist, '.json')), 'w') as fo: json.dump(meta, fo, indent=2, sort_keys=True) - # only update the package cache if it is loaded for this prefix. if prefix in linked_data_: load_linked_data(prefix, dist, meta) @@ -821,12 +821,15 @@ def load_linked_data(prefix, dist, rec=None): rec = json.load(fi) except IOError: return None - _, schannel = url_channel(rec.get('url')) else: linked_data(prefix) + url = rec.get('url') + channel, schannel = url_channel(url) + if 'fn' not in rec: + rec['fn'] = url.rsplit('/', 1)[-1] if url else dname + '.tar.bz2' + rec['channel'] = channel rec['schannel'] = schannel cprefix = '' if schannel == 'defaults' else schannel + '::' - rec['fn'] = dname + '.tar.bz2' linked_data_[prefix][str(cprefix + dname)] = rec return rec @@ -1159,9 +1162,9 @@ def main(): prefix = opts.prefix pkgs_dir = join(prefix, 'pkgs') + pkgs_dirs[0] = [pkgs_dir] if opts.verbose: print("prefix: %r" % prefix) - pkgs_dirs.append(pkgs_dir) if opts.file: idists = list(yield_lines(join(prefix, opts.file)))
diff --git a/tests/test_install.py b/tests/test_install.py --- a/tests/test_install.py +++ b/tests/test_install.py @@ -448,5 +448,20 @@ def test_misc(self): self.assertEqual(duplicates_to_remove(li, [d1, d2]), []) +def test_standalone_import(): + import sys + import conda.install + tmp_dir = tempfile.mkdtemp() + fname = conda.install.__file__.rstrip('co') + shutil.copyfile(fname, join(tmp_dir, basename(fname))) + opath = [tmp_dir] + opath.extend(s for s in sys.path if basename(s) not in ('conda', 'site-packages')) + opath, sys.path = sys.path, opath + try: + import install + finally: + sys.path = opath + + if __name__ == '__main__': unittest.main()
Add test for conda/install.py imports https://github.com/conda/conda/pull/2526#issuecomment-220751869 Since this type of bug was introduced by at least three people independently, I think it would be good to add a test for this. The test could be something along the lines of: ``` tmp_dir = tempfile.mkdtemp() shutil.copyfile(conda.install.__file__, tmp_dir) sys.path = [tmp_dir] # we also need the standard library here import install ``` Basically, put the `install` module into an empty directory, and test if it can be imported by itself.
Perhaps it would be sufficient to scan for `(from|import)\s+(conda|[.])`?
2016-05-21T21:58:02
conda/conda
2,534
conda__conda-2534
[ "2531" ]
4d7286cddf091c0bcf8bd105ad847dd9f57c1ed7
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -624,7 +624,8 @@ def add_cached_package(pdir, url, overwrite=False, urlstxt=False): xdir = None if not (xpkg or xdir): return - url = remove_binstar_tokens(url) + if url: + url = remove_binstar_tokens(url) _, schannel = url_channel(url) prefix = '' if schannel == 'defaults' else schannel + '::' xkey = xpkg or (xdir + '.tar.bz2')
conda search broken for me on master On master (`4d7286cddf091c0bcf8bd105ad847dd9f57c1ed7`), I now get: ``` $ conda search ... Traceback (most recent call last): File "/Users/ilan/python/bin/conda", line 6, in <module> sys.exit(conda.cli.main()) File "/Users/ilan/conda/conda/cli/main.py", line 120, in main args_func(args, p) File "/Users/ilan/conda/conda/cli/main.py", line 127, in args_func args.func(args, p) File "/Users/ilan/conda/conda/cli/main_search.py", line 118, in execute execute_search(args, parser) File "/Users/ilan/conda/conda/cli/main_search.py", line 155, in execute_search extracted = conda.install.extracted() File "/Users/ilan/conda/conda/install.py", line 749, in extracted return set(dist for dist, rec in package_cache().items() if rec['dirs']) File "/Users/ilan/conda/conda/install.py", line 673, in package_cache add_cached_package(pdir, fn) File "/Users/ilan/conda/conda/install.py", line 627, in add_cached_package url = remove_binstar_tokens(url) File "/Users/ilan/conda/conda/config.py", line 258, in remove_binstar_tokens return BINSTAR_TOKEN_PAT.sub(r'\1', url) TypeError: expected string or buffer ```
Hmm, I also get this when I do `conda install`. CC @kalefranz Guessing you'll be fine on py2 if you want to keep testing. Will definitely address it though ASAP. No idea how it happened or why tests passed with it. > On May 21, 2016, at 11:30 PM, Ilan Schnell [email protected] wrote: > > Hmm, I also get this when I do conda install. CC @kalefranz > > — > You are receiving this because you were mentioned. > Reply to this email directly or view it on GitHub I am on Python 2. Oh then try py3 > On May 22, 2016, at 12:41 AM, Ilan Schnell [email protected] wrote: > > I am on Python 2. > > — > You are receiving this because you were mentioned. > Reply to this email directly or view it on GitHub I've added a debug print statement to see what `url` is. The result is that `url` is `None`. So this is not a Python 2 / 3 problem. I think I know what it is
2016-05-22T16:58:15
conda/conda
2,547
conda__conda-2547
[ "2546" ]
c79c21f471ad19ec2588176e23b64816d5ff5e02
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -825,9 +825,11 @@ def load_linked_data(prefix, dist, rec=None): else: linked_data(prefix) url = rec.get('url') - channel, schannel = url_channel(url) if 'fn' not in rec: rec['fn'] = url.rsplit('/', 1)[-1] if url else dname + '.tar.bz2' + if not url and 'channel' in rec: + url = rec['url'] = rec['channel'] + rec['fn'] + channel, schannel = url_channel(url) rec['channel'] = channel rec['schannel'] = schannel cprefix = '' if schannel == 'defaults' else schannel + '::' diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -93,11 +93,9 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None): _, conflict = install.find_new_location(dist) if conflict: actions[RM_FETCHED].append(conflict) + channels[url_p + '/'] = (schannel, 0) actions[FETCH].append(dist) - if md5: - # Need to verify against the package index - verifies.append((dist + '.tar.bz2', md5)) - channels[url_p + '/'] = (schannel, 0) + verifies.append((dist + '.tar.bz2', md5)) actions[EXTRACT].append(dist) # unlink any installed package with that name @@ -106,19 +104,21 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None): actions[UNLINK].append(linked[name]) actions[LINK].append(dist) + # Pull the repodata for channels we are using + if channels: + index.update(fetch_index(channels, **fetch_args)) + # Finish the MD5 verification - if verifies: - index = fetch_index(channels, **fetch_args) - for fn, md5 in verifies: - info = index.get(fn) - if info is None: - sys.exit("Error: no package '%s' in index" % fn) - if 'md5' not in info: - sys.stderr.write('Warning: cannot lookup MD5 of: %s' % fn) - if info['md5'] != md5: - sys.exit( - 'MD5 mismatch for: %s\n spec: %s\n repo: %s' - % (fn, md5, info['md5'])) + for fn, md5 in verifies: + info = index.get(fn) + if info is None: + sys.exit("Error: no package '%s' in index" % fn) + if md5 and 'md5' not in info: + sys.stderr.write('Warning: cannot lookup MD5 of: %s' % fn) + if md5 and info['md5'] != md5: + sys.exit( + 'MD5 mismatch for: %s\n spec: %s\n repo: %s' + % (fn, md5, info['md5'])) execute_actions(actions, index=index, verbose=verbose) return actions
Another clone bug ``` kfranz@0283:~/continuum/conda *master ❯ conda create --clone root -n rootclone Source: '/conda' Destination: '/conda/envs/rootclone' The following packages cannot be cloned out of the root environment: - conda-team::conda-4.1.0rc2-py27_0 - conda-build-1.20.1-py27_0 Error: no URL found for package: <unknown>::gcc-4.8.5-3 ``` But /conda/conda-meta/gcc-4.8.5-3.json has, in part, ``` "channel": "https://repo.continuum.io/pkgs/free/osx-64/", ``` so the information is there. The logic here is located around line 273 of `conda/misc.py`.
2016-05-24T22:01:51
conda/conda
2,604
conda__conda-2604
[ "2596" ]
9721c8eb20421724336602e93fbd67bd2fefa7be
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -689,8 +689,9 @@ def package_cache(): add_cached_package(pdir, url) except IOError: pass - for fn in os.listdir(pdir): - add_cached_package(pdir, fn) + if isdir(pdir): + for fn in os.listdir(pdir): + add_cached_package(pdir, fn) del package_cache_['@'] return package_cache_
install.package_cache() broken with cache directory does not exist I just ran into this bug when building a package with `conda-build`. Before building the package, I cleaned out removed the cache directory `pkgs`. The trachback is as follows: ``` Traceback (most recent call last): File "/home/ilan/minonda/bin/conda-build", line 6, in <module> exec(compile(open(__file__).read(), __file__, 'exec')) File "/home/ilan/conda-build/bin/conda-build", line 5, in <module> sys.exit(main()) File "/home/ilan/conda-build/conda_build/main_build.py", line 140, in main args_func(args, p) File "/home/ilan/conda-build/conda_build/main_build.py", line 380, in args_func args.func(args, p) File "/home/ilan/conda-build/conda_build/main_build.py", line 367, in execute build.test(m) File "/home/ilan/conda-build/conda_build/build.py", line 613, in test rm_pkgs_cache(m.dist()) File "/home/ilan/conda-build/conda_build/build.py", line 386, in rm_pkgs_cache plan.execute_plan(rmplan) File "/home/ilan/conda/conda/plan.py", line 583, in execute_plan inst.execute_instructions(plan, index, verbose) File "/home/ilan/conda/conda/instructions.py", line 133, in execute_instructions cmd(state, arg) File "/home/ilan/conda/conda/instructions.py", line 65, in RM_FETCHED_CMD install.rm_fetched(arg) File "/home/ilan/conda/conda/install.py", line 749, in rm_fetched rec = package_cache().get(dist) File "/home/ilan/conda/conda/install.py", line 692, in package_cache for fn in os.listdir(pdir): OSError: [Errno 2] No such file or directory: '/home/ilan/minonda/pkgs' ``` The problem is that https://github.com/conda/conda/blob/master/conda/install.py#L692 assumes that the directory already exists, which might not be the case. CC @mcg1969
I think the best thing here is to surround 692-693 in a `try/except` block like the previous block of code. I'll do this ASAP
2016-06-06T13:55:49
conda/conda
2,631
conda__conda-2631
[ "2626" ]
38b4966d5c0cf16ebe310ce82ffef63c926f9f3f
diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -9,7 +9,7 @@ import sys from collections import defaultdict from os.path import (abspath, dirname, expanduser, exists, - isdir, isfile, islink, join, relpath) + isdir, isfile, islink, join, relpath, curdir) from .install import (name_dist, linked as install_linked, is_fetched, is_extracted, is_linked, linked_data, find_new_location, cached_url) @@ -35,8 +35,8 @@ def conda_installed_files(prefix, exclude_self_build=False): res.update(set(meta['files'])) return res - -url_pat = re.compile(r'(?P<url>.+)/(?P<fn>[^/#]+\.tar\.bz2)' +url_pat = re.compile(r'(?:(?P<url_p>.+)(?:[/\\]))?' + r'(?P<fn>[^/\\#]+\.tar\.bz2)' r'(:?#(?P<md5>[0-9a-f]{32}))?$') def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None): actions = defaultdict(list) @@ -55,12 +55,14 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None): m = url_pat.match(spec) if m is None: sys.exit('Could not parse explicit URL: %s' % spec) - url, md5 = m.group('url') + '/' + m.group('fn'), m.group('md5') - if not is_url(url): - if not isfile(url): - sys.exit('Error: file not found: %s' % url) - url = utils_url_path(url) - url_p, fn = url.rsplit('/', 1) + url_p, fn, md5 = m.group('url_p'), m.group('fn'), m.group('md5') + if not is_url(url_p): + if url_p is None: + url_p = curdir + elif not isdir(url_p): + sys.exit('Error: file not found: %s' % join(url_p, fn)) + url_p = utils_url_path(url_p).rstrip('/') + url = "{0}/{1}".format(url_p, fn) # See if the URL refers to a package in our cache prefix = pkg_path = dir_path = None
diff --git a/tests/test_misc.py b/tests/test_misc.py --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -15,13 +15,13 @@ def test_cache_fn_url(self): def test_url_pat_1(self): m = url_pat.match('http://www.cont.io/pkgs/linux-64/foo.tar.bz2' '#d6918b03927360aa1e57c0188dcb781b') - self.assertEqual(m.group('url'), 'http://www.cont.io/pkgs/linux-64') + self.assertEqual(m.group('url_p'), 'http://www.cont.io/pkgs/linux-64') self.assertEqual(m.group('fn'), 'foo.tar.bz2') self.assertEqual(m.group('md5'), 'd6918b03927360aa1e57c0188dcb781b') def test_url_pat_2(self): m = url_pat.match('http://www.cont.io/pkgs/linux-64/foo.tar.bz2') - self.assertEqual(m.group('url'), 'http://www.cont.io/pkgs/linux-64') + self.assertEqual(m.group('url_p'), 'http://www.cont.io/pkgs/linux-64') self.assertEqual(m.group('fn'), 'foo.tar.bz2') self.assertEqual(m.group('md5'), None)
Installing packages from files broken in master ``` ((p35)) Z:\msarahan\code\conda>conda install --force z:\msarahan\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 Could not parse explicit URL: z:\msarahan\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 ((p35)) Z:\msarahan\code\conda>conda install --offline z:\msarahan\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 Could not parse explicit URL: z:\msarahan\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 ((p35)) Z:\msarahan\code\conda>conda install --force ..\..\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 Could not parse explicit URL: ..\..\Downloads\numexpr-2.6.0-np110py35_0.tar.bz2 ``` z: is a mapped network drive - not sure if that makes any difference.
Looks like this only affects windows. Perhaps the `\`. Will dig further. https://github.com/conda/conda/blob/master/conda/misc.py#L57 Ok so the regex [here](https://github.com/conda/conda/blob/master/conda/misc.py#L39) needs to be more robust for backslashes I guess?
2016-06-09T05:42:02
conda/conda
2,670
conda__conda-2670
[ "2669" ]
53005336f9085426683d27f719d02f20c2a027ed
diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -218,26 +218,21 @@ def execute_config(args, parser): else: rc_path = user_rc_path - # Create the file if it doesn't exist - if not os.path.exists(rc_path): - has_defaults = ['channels', 'defaults'] in args.add - if args.add and 'channels' in list(zip(*args.add))[0] and not has_defaults: - # If someone adds a channel and their .condarc doesn't exist, make - # sure it includes the defaults channel, or else they will end up - # with a broken conda. - rc_text = """\ -channels: - - defaults -""" - else: - rc_text = "" + # read existing condarc + if os.path.exists(rc_path): + with open(rc_path, 'r') as fh: + rc_config = yaml_load(fh) else: - with open(rc_path, 'r') as rc: - rc_text = rc.read() - rc_config = yaml_load(rc_text) - if rc_config is None: rc_config = {} + # add `defaults` channel if creating new condarc file or channel key doesn't exist currently + if 'channels' not in rc_config: + # now check to see if user wants to modify channels at all + if any('channels' in item[0] for item in args.add): + # don't need to insert defaults if it's already in args + if not ['channels', 'defaults'] in args.add: + args.add.insert(0, ['channels', 'defaults']) + # Get if args.get is not None: if args.get == []:
Having trouble downloading from osx-64 on Travis CI _From @jakirkham on June 14, 2016 20:46_ Seems we are now having issues downloading on packages on Travis CI. See the snippet below and this [log](https://travis-ci.org/conda-forge/apache-libcloud-feedstock/jobs/137608834#L369-L376). Note none of the packages below are on conda-forge (there is `python`, but not 2.7). So, this seems to be a `defaults` channel issue. Log snippet below. ``` BUILD START: apache-libcloud-0.18.0-py27_1 Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata ....... WARNING: Could not find any versions of conda-build in the channels Solving package specifications .... Error: Packages missing in current osx-64 channels: - python 2.7* - setuptools ``` Also, see these PRs for examples - https://github.com/conda-forge/apache-libcloud-feedstock/pull/3 - https://github.com/conda-forge/colorlog-feedstock/pull/4 - https://github.com/conda-forge/python-feedstock/pull/20 cc @msarahan @danielfrg @frol @jjhelmus @vamega _Copied from original issue: Anaconda-Platform/support#45_
_From @jjhelmus on June 14, 2016 20:46_ What happens if you pin conda to version 4.0.8? _From @jakirkham on June 14, 2016 20:47_ It's a good question. The thing is I can't reproduce this locally (even with `conda` 4.1.0). So, if it is a `conda` bug, it is a pretty special one. _From @jjhelmus on June 14, 2016 20:50_ I'm trying in the conda-forge/python-feedstock#20. I think the windows issue that I'm seeing may be related: ``` BUILD END: python-3.5.1-0 TEST START: python-3.5.1-0 Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata ....... WARNING: Could not find any versions of conda-build in the channels Solving package specifications .... Error: Dependencies missing in current win-32 channels: - python 3.5.1 0 -> pip - python 3.5* -> pip Command exited with code 1 ``` _From @jakirkham on June 14, 2016 20:52_ So, there was an issue like that between `conda-build` and `conda-build-all` that affected staged-recipes, but I don't see why that would affect a feedstock as they don't use `conda-build-all` in the CIs. 😕 _From @mcg1969 on June 14, 2016 20:53_ That's a strange one. Folks are looking into it over here; and if we have to pull 4.1, we will. _From @jjhelmus on June 14, 2016 20:58_ Seems to be related to 4.1, downgrading to 4.0.8 fixes the osx issue for me. - [conda 4.0.8 python build](https://travis-ci.org/conda-forge/python-feedstock/builds/137630248). - [conda 4.1.0 python build](https://travis-ci.org/conda-forge/python-feedstock/builds/137621445). I don't have a Mac available to try reproducing this locally. _From @jakirkham on June 14, 2016 21:4_ So, we tried to downgrade, but it appears we [cannot](https://travis-ci.org/conda-forge/apache-libcloud-feedstock/jobs/137631775#L369-L370) if we are already on `conda` 4.1.0. In other words, this doesn't seem to be related to `conda-build`. _From @jakirkham on June 14, 2016 21:5_ Though I cannot reproduce this locally. So, it is something special about Travis CI and `conda` that we need to disentangle. _From @mcg1969 on June 14, 2016 21:9_ Thanks for the investigation. I can't reproduce locally, either. @kalefranz _From @jakirkham on June 14, 2016 21:15_ Can confirm that if we downgrade to 4.0.8 (on Travis CI). We do not experience this problem. See these [logs](https://travis-ci.org/conda-forge/apache-libcloud-feedstock/builds/137634752). _From @jakirkham on June 14, 2016 21:19_ We downgraded before it was upgraded to `conda` 4.1.0 (was on 4.0.5) and made sure it didn't upgrade to 4.1.0 (kept to 4.0.8). Of course, if it went to `conda` 4.1.0, there was no recourse as shown earlier. _From @jakirkham on June 14, 2016 21:31_ Sorry, that is probably even less clear. How about a diagram? ![conda](https://cloud.githubusercontent.com/assets/3019665/16060465/d7f630b4-3255-11e6-80c6-e227da5c057e.png) _From @mcg1969 on June 14, 2016 21:40_ @jakirkham @jjhelmus are you seeing failures on Linux too, or Mac only? Trying to figure out if we should pull both OSs. _From @jjhelmus on June 14, 2016 21:40_ I'm only seeing issues on Mac and Windows (both win-32 and win-64) _From @mcg1969 on June 14, 2016 21:42_ Ah, Windows too? Linux seems to be working fine? OK. https://travis-ci.org/conda-forge/python-feedstock/builds/137621445#L258 What happens if you update conda-build to latest? _From @jakirkham on June 14, 2016 21:50_ So, it seems unrelated to `conda-build` based on this [find](https://github.com/Anaconda-Platform/support/issues/45#issuecomment-226015810), @kalefranz. Basically, we cannot install things once `conda` 4.1.0 is installed on Travis CI. Hey guys, could you try adding this config to your setup... ``` anaconda config --set url https://api.anaconda.org ``` If that fixes things for you, we know where the bug is. _From @jakirkham on June 14, 2016 21:51_ I don't think so. Do we need to do this now? _From @mcg1969 on June 14, 2016 21:51_ We found one user that could reproduce a similar bug locally, and this was it. _From @jjhelmus on June 14, 2016 21:51_ Pulled out the [Python recipe](https://travis-ci.org/jjhelmus/conda_410_issue_debug) to try to make debugging easier _From @mcg1969 on June 14, 2016 21:52_ But we're going to hotfix this one _From @mcg1969 on June 14, 2016 21:53_ I don't think that's the problem in this case, @kalefranz, because their logs seem to show that they're already using https. _From @jakirkham on June 14, 2016 21:55_ Did the setting move locations or something? Is there some reason it might not pick it up after the upgrade? _From @mcg1969 on June 14, 2016 22:0_ I introduced a regression in https://github.com/conda/conda/pull/2564 when fixing the issues mentioned therein. Our local user was seeing a very similar behavior to yours here, but his `anaconda-client` configuration was pointing to `http://api.anaconda.org` instead of `https://api.anaconda.org`. Fixing his configuration corrected the problem (and we will be patching conda to fix the http/https issue). But since your logs suggest you're already using `https://api.anaconda.org`, I'm not seeing this as being a problem. I wonder though if you even need to install `anaconda-client`; are you relying on private Anaconda Cloud repos? _From @jjhelmus on June 14, 2016 22:1_ > https://travis-ci.org/conda-forge/python-feedstock/builds/137621445#L258 > > What happens if you update conda-build to latest? [No luck](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds/137646381) _From @mcg1969 on June 14, 2016 22:9_ We're zeroing in on the issue---different than the one above https://travis-ci.org/conda-forge/python-feedstock/builds/137621445#L256 Can you move that line AFTER the `conda config --add channels conda-forge` line? https://travis-ci.org/conda-forge/python-feedstock/builds/137621445#L259 So... ``` conda update --yes conda conda install --yes conda-build=1.20.0 jinja2 anaconda-client conda config --add channels conda-forge conda config --set show_channel_urls true ``` Just trying to isolate the problem... When the ~/.condarc file exists, but there's not a `channels` field, it seems `conda config --add channels conda-forge` _just_ adds the conda-forge channel instead of adding both conda-forge and defaults. When the file doesn't exist and it's newly created, the behavior is as expected. _From @jjhelmus on June 14, 2016 22:15_ That changed is queued in the [conda_410_issue_debug](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds) builds. _From @jjhelmus on June 14, 2016 22:16_ And that looks to be the [issue](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds/137650353) Cool! We'll get a patch out soon. 4.0.1. But at least you can go on with your CI with the order switched up if you want. Or just hold tight for a patch. _From @jjhelmus on June 14, 2016 22:33_ Yes, looks like if `conda config --set show_channel_urls true` is executed before `conda config --add channels conda-forge` then the resulting .condarc does not include the defaults channel, [build](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds/137651446): ``` show_channel_urls: true channels: - conda-forge ``` If the channel is added before setting show_channel_urls, then the .condarc does include the default channel, [build](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds/137651370): ``` channels: - conda-forge - defaults show_channel_urls: true ``` conda 4.0.8 did not have this behavior, [build](https://travis-ci.org/jjhelmus/conda_410_issue_debug/builds/137653591) Looking forward to the fix but glad to know the workaround. _From @jakirkham on June 14, 2016 22:40_ Great detective work guys. Glad we have narrowed this down. 👍
2016-06-14T23:09:46
conda/conda
2,685
conda__conda-2685
[ "2680" ]
dfabcc529bbf2d641c2f866382f70a5ea75b507c
diff --git a/conda/cli/activate.py b/conda/cli/activate.py --- a/conda/cli/activate.py +++ b/conda/cli/activate.py @@ -134,8 +134,11 @@ def main(): if rootpath: path = path.replace(shelldict['pathsep'].join(rootpath), "") + path = path.lstrip() # prepend our new entries onto the existing path and make sure that the separator is native path = shelldict['pathsep'].join(binpath + [path, ]) + # Clean up any doubled-up path separators + path = path.replace(shelldict['pathsep'] * 2, shelldict['pathsep']) # deactivation is handled completely in shell scripts - it restores backups of env variables. # It is done in shell scripts because they handle state much better than we can here. diff --git a/conda/utils.py b/conda/utils.py --- a/conda/utils.py +++ b/conda/utils.py @@ -410,7 +410,8 @@ def yaml_dump(string): "zsh": dict( unix_shell_base, exe="zsh", ), - # "fish": dict(unix_shell_base, exe="fish", - # shell_suffix=".fish", - # source_setup=""), + "fish": dict( + unix_shell_base, exe="fish", + pathsep=" ", + ), } diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -36,7 +36,9 @@ long_description = f.read() scripts = ['bin/activate', - 'bin/deactivate', ] + 'bin/deactivate', + 'bin/conda.fish', + ] if sys.platform == 'win32': # Powershell scripts should go here scripts.extend(['bin/activate.bat',
conda 4.1 breaks fish integrations The new version does not work with fish at all. While the .fish script is finally there in the bin directory, it does not seem to kick in, since the new activate.py command is messing with it. How is it supposed to work? This is the error I get: ``` $ conda activate myenv Traceback (most recent call last): File "/home/jrodriguez/.local/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/home/jrodriguez/.local/anaconda/lib/python3.5/site-packages/conda/cli/main.py", line 48, in main activate.main() File "/home/jrodriguez/.local/anaconda/lib/python3.5/site-packages/conda/cli/activate.py", line 119, in main shelldict = shells[shell] KeyError: 'myenv' ``` Meanwhile, I had to downgrade to conda 4.0 with `conda install conda=4.0`. Thank you!
I'd actually recommend downgrading to `4.0.8`. But we'll investigate this quickly! Working on it. This is because we have to explicitly name the shell when calling ..activate and such. Detecting the parent shell proved to be unreliable.
2016-06-15T16:50:37
conda/conda
2,695
conda__conda-2695
[ "2677" ]
065a09022cfa978c075eabe20b73f8df0e71a5df
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -90,8 +90,8 @@ def __init__(self, *args, **kwargs): proxies = get_proxy_servers() if proxies: self.proxies = proxies - self.trust_env = False # disable .netrc file - # also disables REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE env variables + self.auth = NullAuth() # disable .netrc file. for reference, see + # https://github.com/Anaconda-Platform/anaconda-client/pull/298 # Configure retries if retries: @@ -112,6 +112,22 @@ def __init__(self, *args, **kwargs): self.verify = ssl_verify + +class NullAuth(requests.auth.AuthBase): + '''force requests to ignore the ``.netrc`` + Some sites do not support regular authentication, but we still + want to store credentials in the ``.netrc`` file and submit them + as form elements. Without this, requests would otherwise use the + .netrc which leads, on some sites, to a 401 error. + https://github.com/kennethreitz/requests/issues/2773 + Use with:: + requests.get(url, auth=NullAuth()) + ''' + + def __call__(self, r): + return r + + class S3Adapter(requests.adapters.BaseAdapter): def __init__(self):
conda=4.1 no longer respects HTTP_PROXY My proxy variables are properly set: ``` $ set https_proxy HTTPS_PROXY=http://myproxy:8080 ``` `conda=4.0.8` successfully picks up my `%HTTPS_PROXY%` and installs `conda=4.1`: ``` $ conda install conda=4.1 Fetching package metadata: .......... Solving package specifications: ......... The following packages will be UPDATED: conda: 4.0.8-py27_0 defaults --> 4.1.0-py27_0 defaults ``` now trying to revert back to `conda=4.0`: ``` $ conda install conda=4.0 Fetching package metadata ......... Could not connect to https://repo.continuum.io/pkgs/free/win-64/ Connection error: HTTPSConnectionPool(host='repo.continuum.io', port=443): Max retries exceeded with url... ``` proxy settings no longer work. Configuring `proxy_servers` in `.condarc` restores connectivity.
Can also confirm this. Unfortunately it's not possible to specify no_proxy in the .condarc, so 4.1 is not working if you have a proxy and internal channels. Thanks for the report, folks; I'm sorry for the trouble here. I'm unfamiliar with the proxy handling code so we'll have to find someone here better equipped. As far as I can tell we've never explicitly checked HTTP_PROXY so I'm guessing that it's caused by `requests` (not blaming that module per se, just saying that we must have changed the way we are using it.) @kalefranz @msarahan any ideas? Something like this changed in Conda-build - not sure if it is instructive: https://github.com/conda/conda-build/pull/989 This seems to be a problem with the newer version of requests in conda 4.1.0. With an HTTPS_PROXY environment variable set: Using requests 2.9.0: ``` In [1]: import requests In [2]: requests.get('https://repo.continuum.io/pkgs/free/win-64', timeout=1, verify=False) C:\Miniconda2_2\lib\site-packages\requests\packages\urllib3\connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Out [2]: <Response [407]> ``` Using requests 2.10.0 ``` In [1]: import requests In [2]: requests.get('https://repo.continuum.io/pkgs/free/win-64', timeout=1, verify=False) requests\packages\urllib3\connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) <.............. times out> ``` The 407 response 'proxy authentication required' might be another clue I guess. Ah, so I'm not the only one. I created this ticket because I experienced the same thing: https://github.com/conda/conda/issues/2671. This current ticket is more eloquent than mine, so perhaps 2671 can be closed and this can take it's place? I have experienced the same thing. .condarc works, but env var HTTP_PROXY is not taken into account. conda 4.0.8 was fine in this regard. I'm looking into this now. Probably the last bug to fix for today's 4.1.1 release. Pretty sure this happened when I disabled `~/.netrc` files from requests. PR https://github.com/conda/conda/pull/2514 in response to issue https://github.com/conda/conda/issues/2161. The thread here for requests is relevant: https://github.com/kennethreitz/requests/issues/2773 Looks like I should have followed more closely @dsludwig's fix here: https://github.com/Anaconda-Platform/anaconda-client/pull/298
2016-06-15T22:01:51
conda/conda
2,701
conda__conda-2701
[ "2693" ]
210c4fd70ccc770d9660fbca62de92bad2dfeac8
diff --git a/conda/api.py b/conda/api.py --- a/conda/api.py +++ b/conda/api.py @@ -35,7 +35,8 @@ def get_index(channel_urls=(), prepend=True, platform=None, key = prefix + fn if key in index: # Copy the link information so the resolver knows this is installed - index[key]['link'] = info.get('link') + index[key] = index[key].copy() + index[key]['link'] = info.get('link') or True else: # only if the package in not in the repodata, use local # conda-meta (with 'depends' defaulting to []) diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -235,6 +235,8 @@ def add_unknown(index, priorities): if schannel2 != schannel: continue priority = priorities.get(schannel, maxp) + if 'link' in meta: + del meta['link'] meta.update({'fn': fname, 'url': url, 'channel': channel, 'schannel': schannel, 'priority': priority}) meta.setdefault('depends', []) diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -861,6 +861,7 @@ def load_linked_data(prefix, dist, rec=None): channel, schannel = url_channel(url) rec['channel'] = channel rec['schannel'] = schannel + rec['link'] = rec.get('link') or True cprefix = '' if schannel == 'defaults' else schannel + '::' linked_data_[prefix][str(cprefix + dname)] = rec return rec
Bizarre removal of python Full report at https://ci.appveyor.com/project/ContinuumAnalytics/conda-build/build/1.0.163#L18 ``` Package plan for installation in environment C:\Miniconda3-x64: The following packages will be downloaded: package | build ---------------------------|----------------- git-2.6.4 | 0 61.2 MB colorama-0.3.7 | py34_0 20 KB coverage-4.1 | py34_0 235 KB py-1.4.31 | py34_0 127 KB pytz-2016.4 | py34_0 171 KB six-1.10.0 | py34_0 17 KB clyent-1.2.2 | py34_0 15 KB pytest-2.9.2 | py34_0 283 KB python-dateutil-2.5.3 | py34_0 238 KB anaconda-client-1.4.0 | py34_0 156 KB pytest-cov-2.2.1 | py34_0 17 KB ------------------------------------------------------------ Total: 62.5 MB The following NEW packages will be INSTALLED: anaconda-client: 1.4.0-py34_0 clyent: 1.2.2-py34_0 colorama: 0.3.7-py34_0 coverage: 4.1-py34_0 git: 2.6.4-0 py: 1.4.31-py34_0 pytest: 2.9.2-py34_0 pytest-cov: 2.2.1-py34_0 python-dateutil: 2.5.3-py34_0 pytz: 2016.4-py34_0 six: 1.10.0-py34_0 The following packages will be REMOVED: python: 3.4.4-4 ``` CC @mcg1969 @kalefranz
2016-06-16T01:38:55
conda/conda
2,705
conda__conda-2705
[ "2703" ]
210c4fd70ccc770d9660fbca62de92bad2dfeac8
diff --git a/conda/cli/activate.py b/conda/cli/activate.py --- a/conda/cli/activate.py +++ b/conda/cli/activate.py @@ -163,7 +163,8 @@ def main(): conda.install.symlink_conda(prefix, root_dir, shell) except (IOError, OSError) as e: if e.errno == errno.EPERM or e.errno == errno.EACCES: - msg = ("Cannot activate environment {0}, not have write access to conda symlink" + msg = ("Cannot activate environment {0}.\n" + "User does not have write access for conda symlinks." .format(sys.argv[2])) sys.exit(msg) raise diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -573,13 +573,20 @@ def symlink_conda_hlp(prefix, root_dir, where, symlink_fn): for f in scripts: root_file = join(root_dir, where, f) prefix_file = join(prefix_where, f) - # try to kill stale links if they exist - if os.path.lexists(prefix_file): - os.remove(prefix_file) - # if they're in use, they won't be killed. Skip making new symlink. - if not os.path.lexists(prefix_file): - symlink_fn(root_file, prefix_file) - + try: + # try to kill stale links if they exist + if os.path.lexists(prefix_file): + os.remove(prefix_file) + # if they're in use, they won't be killed. Skip making new symlink. + if not os.path.lexists(prefix_file): + symlink_fn(root_file, prefix_file) + except (IOError, OSError) as e: + if (os.path.lexists(prefix_file) and + (e.errno == errno.EPERM or e.errno == errno.EACCES)): + log.debug("Cannot symlink {0} to {1}. Ignoring since link already exists." + .format(root_file, prefix_file)) + else: + raise # ========================== begin API functions =========================
activate symlink error when using source activate they get this symlink error > While trying to use the nfs installation with a user account that lacks the write permissions on the installation and the preconfigured environments, I'm getting an error: > > Cannot activate environment bash, not have write access to conda symlink > > Is this new, or I simply didn't notice the problem in the earlier versions? https://github.com/conda/conda/blob/4.1.x/conda/cli/activate.py#L158-L167 seems like its testing that it can create the symlink even if its already there, can anyone explain this functionality and why it would require permissions to write to the root environment?
Just noting this wouldn't have been a problem if I'd pushed forward with https://github.com/conda/conda/issues/2502
2016-06-16T03:19:30
conda/conda
2,706
conda__conda-2706
[ "2700" ]
2ddebf31b378a452f14b45696a8070d350809ed1
diff --git a/conda/cli/main_list.py b/conda/cli/main_list.py --- a/conda/cli/main_list.py +++ b/conda/cli/main_list.py @@ -115,8 +115,7 @@ def print_export_header(): def get_packages(installed, regex): pat = re.compile(regex, re.I) if regex else None - - for dist in sorted(installed, key=str.lower): + for dist in sorted(installed, key=lambda x: x.lower()): name = name_dist(dist) if pat and pat.search(name) is None: continue @@ -150,7 +149,7 @@ def list_packages(prefix, installed, regex=None, format='human', result.append(disp) except (AttributeError, IOError, KeyError, ValueError) as e: log.debug(str(e)) - result.append('%-25s %-15s %s' % dist2quad(dist)[:3]) + result.append('%-25s %-15s %15s' % dist2quad(dist)[:3]) return res, result diff --git a/conda/egg_info.py b/conda/egg_info.py --- a/conda/egg_info.py +++ b/conda/egg_info.py @@ -4,6 +4,7 @@ """ from __future__ import absolute_import, division, print_function +from io import open import os import re import sys @@ -46,7 +47,7 @@ def parse_egg_info(path): Parse an .egg-info file and return its canonical distribution name """ info = {} - for line in open(path): + for line in open(path, encoding='utf-8'): line = line.strip() m = pat.match(line) if m: @@ -79,7 +80,10 @@ def get_egg_info(prefix, all_pkgs=False): for path in get_egg_info_files(join(prefix, sp_dir)): f = rel_path(prefix, path) if all_pkgs or f not in conda_files: - dist = parse_egg_info(path) + try: + dist = parse_egg_info(path) + except UnicodeDecodeError: + dist = None if dist: res.add(dist) return res
conda list broken in 4.1? In case it helps I instrumented my `cp1252.py` ``` python class IncrementalDecoder(codecs.IncrementalDecoder): def decode(self, input, final=False): try: return codecs.charmap_decode(input,self.errors,decoding_table)[0] except Exception as exc: msg = ( "input = {}\n" "type(input) = {}\n" "errors = {}\n" "type(errors) = {}\n" "decoding_table = {}\n" "type(decoding_table) = {}\n" ) msg = msg.format( input, type(input), self.errors, type(self.errors), decoding_table, type(decoding_table), ) raise Exception(msg) from exc ``` ...with output below: ``` Traceback (most recent call last): File "C:\Python\Scripts\conda-script.py", line 5, in <module> sys.exit(main()) File "C:\Python\lib\site-packages\conda\cli\main.py", line 120, in main args_func(args, p) File "C:\Python\lib\site-packages\conda\cli\main.py", line 127, in args_func args.func(args, p) File "C:\Python\lib\site-packages\conda\cli\main_list.py", line 268, in execute show_channel_urls=args.show_channel_urls) File "C:\Python\lib\site-packages\conda\cli\main_list.py", line 178, in print_packages installed.update(get_egg_info(prefix)) File "C:\Python\lib\site-packages\conda\egg_info.py", line 82, in get_egg_info dist = parse_egg_info(path) File "C:\Python\lib\site-packages\conda\egg_info.py", line 49, in parse_egg_info for line in open(path): File "C:\Python\lib\encodings\cp1252.py", line 39, in decode raise Exception(msg) from exc Exception: input = b'#!/bin/sh\r\nif [ `basename $0` = "setuptools-20.3-py3.5.egg" ]\r\nthen exec python3.5 -c "import sys, os; sys.path.insert(0, os.path.abspath(\'$0\')); from setuptools.command.easy_install import bootstrap; sys.exit(bootstrap())" "$@"\r\nelse\r\n echo $0 is not the correct name for this egg file.\r\n echo Please rename it back to setuptools-20.3-py3.5.egg and try again.\r\n exec false\r\nfi\r\nPK\x03\x04\x14\x00\x00\x00\x08\x00|]>H\\O\xbaEi\x00\x00\x00~\x00\x00\x00\x0f\x00\x00\x00easy_install.py-\xcc1\x0e\x83@\x0cD\xd1~Oa\xb9\x814\x1c \x12e\x8a\xb4\\`d\x91EYim#\xd6\x14\xb9=\x101\xd54\xef3\xf3\xb4\x1b\xc57\xd3K\xda\xefm-\xa4V\x9a]U\xec\xc3\xcc)\x95\x85\x00\x13\xcd\x00\x8d#u\x80J1\xa0{&:\xb7l\xae\xd4r\xeck\xb8\xd76\xdct\xc8g\x0e\xe5\xee\x15]}\x0b\xba\xe0\x1f]\xa7\x7f\xa4\x03PK\x03\x04\x14\x00\x00\x00\x08\x00P\x96qH\x93\x06\xd72\x03\x00\x00\x00\x01\x00\x00\x00\x1d\x00\x00\x00EGG-INFO/dependency_links.txt\xe3\x02\x00PK\x03\x04\x14\x00\x00\x00\x08\x00P\x96qH1\x8f\x97\x14\x84\x02\x00\x00\x13\x0b\x00\x00\x19\x00\x00\x00EGG-INFO/entry_points.txt\x95V\xcd\x8e\xdb \x10\xbe\xf3\x14\xfb\x02\x9bCW\xbd \xf5\xda\xaa\xaa\xd4\xf6\x1e\xad\x10\xb6\')\x8a\r\x14p\x12\xf7\xe9;`\xf0\x12\xcb8\xf6\xc5\x0c\x9e\xef\x9b\x1f33\xe6X+iU\x0b\xcc\xd6Fhg\xdf\tp;0!\xad\xe3m\xfb\xf2\xe5\xc5\x82\xeb\xb5S\xaa\xb5\x87Zu\x1d\x97\xcd!G\xd0\x8e\x0b\xf9\xc0y};|\xde\xca#\xc7FX\xd7;\xf1\x81\xc2\x08x+\xb8]6\x11T4<I\xe5\xb9\x0c\xce\xe7e\xe8\xa4\xa6\x93\x14)Fwk\x14T\xd3I\x8a\x94\x9b\x90>\xf05Z\x84\xd0\x87\x1d\xa9z\xd16\x0c\xee%jR\xd3I\x8a\x14=\xac1\xf4@\x93@\x1a\xb8B\xab\xf42<*i\\\xf7\x9en\xbe!\xf8\x05Q>\xa9\x02/ji\x12\xc8\xaa\x9b\xe4!\x19\x8f+[w2G\xd1\xf9\x8b\xc9N+\xaau\x13\x08\xa0\x99<\x11c#\xac\x93#\x88\xce\xf6\xc4\xc0\x19O\x1f\xcc2;ii\x12\x88Q\x8e;(\xa0\x83\x8e\x8e\x0b\xb1\xfc\n\xaa\x18W\xd2\xd2$\x10\xeb\xcb\xb0\x00\xf6*\x1a\x9e\x04\xd5\x08/\xe0\x82\x8e\x8e\x0bqP\xb2\xe75\xd4?H\xaf[\xc5\x9be\xd4\xa8\xa3\xe3\x12\x91\xacQu!\xa3\x0c@3\xf9ad\x04\x1a\xbb\xc0pS\xc6\x0f\x0e\x9ceW0\x8e}r\xea\xcd\xa3}L3\xf3!un\xad\x87Yg\x84<\xe3\xe1c\xe4\rh\x90\r\xc8z\xc0\xbd\xbcld\x01?\x83a\x06\xac\xeaM\r[I\xd2\x99\x81i%\xe4bp\xf5\x1f\xa8/,\x07\x11\xb8\xd7m\xdf\x00\xd3\xbc\xbe\xa0G\xd6p\xc7\x8b\xcc\x1c\x84Lg\xb8\xc5\x08\xff\xf6\xc2@\xd9[\x80a\x0bl\xf2\x13s\xaa\xf0\xcd\xd45\xd1C9\xa1\x08\xe8\xc0\'$y\x07\x16\xbdL\xae\xca<i5\xd9\x9f\xf7S\xb3\t@\xc6\x1a\xda\x17\xbe\xaf+\xe6Kr\xde\xe8\x19AtZ\x19\xc7\xab\x16F\xb8\xe9\xa5\xdc\x01\xb7\xbd\x98\xcf\x85\x0c\xfd\x01\t\xe8\xe7\x07\xfc\x10~o!\xb4\xc8\x93\xa3M0\x96\xca\xef$\xee`6\x16\xf9D\xdeC\xfa\'4\xb3\xfc\xb4\x94F\x1e\x189\xa6i\x7f\xb8\x19\xfc\x06\x06[\xff\xf7\x8fo\xaf\xdf\x7f~\xfd\xf5\xe4\xdf\x14\xf0L_\xe2\xcfb\xde\xf5\x07W\xfaQO\x16\x14N\x98\xd1\n7\xe7h`\x0b\xef\xc6\x8dd\x11\xceT\xe5\xef\\xz\xb3\x01\xb2\xdb\x7f>&\xb6\x04\x11\x88\x9e$`\xa9\x0bw\xfbO}\xb3\xd9\xf7c\x1f)\xcdZ\x7f1\xd9LGF \xb0\x10;VBF\x89\xa3\x88;\xa1\xe4\xbb\xbf\xacX\xa8\xfb\xd0R\x1b.:XX\x0eK\x91kB\xfe\x03PK\x03\x04\x14\x00\x00\x00\x08\x00P\x96qH:p\x95\x8f~\x10\x00\x00c3\x00\x00\x11\x00\x00\x00EGG-INFO/PKG-INFO\xbd[\xedr\xdbF\x96\xfd\xef*\xbfC\xaf2U\x96T$\x18\xc7\xb1\'aMR\xab\xc8v\xa2LliCe\xbd\xbb5Uf\x13h\x92\xbd\x02\xd0\x184@\x8a\xa9y\xa1y\x8e}\xb1=\xf7v\x03hH\xa0D\xed\xee\xac\xff\x04"\xd0\xb7\xef\xe7\xb9\x1f\xdd\xf9\xa0*\x99\xc8J\x8e\xffU\x95V\x9b|*^F/\x9f?\xfb(35\x15VUuQ\x19\x93\xda\xe7\xcf\xda\xf7_}\x19\xbdz\xfelVg\x99,wS\xf1NZ\x9d\xeeDb\xb6yjd2\x12\x8bZ\xa7\xf8\x8f\xcem%\xd3t$\xeabU\xcaD\x8d\x84\xcc\x13Q\xe7\xfewq\xb5\xab\xd6&\x17\x85\x8co\xe4Ja\x83\x9fL\xa6\xc6\x05\x9e\xa7b]U\x85\x9dN&\x0b]-\xea\xf8FU\x91)W\x93bW\xc8I\xc8\xd2Y\r\x12\xe5\xb4!u\xc5\xa4t\xbe\x12\xee\x85\xaev\xcd7c\x95I\x9dNE\xa2mUW:\xb5c\xabW\xff\\\xf0:\xa2\xfd\xfc\xd9/:V\xb9\xc5\xde\xbf}\xfc\xf3\xc7\xcbO\x1f\x9f?{\xabl\\\xea\xa2b\xa1\xbf{\xf8\xdf\xf3g\xc2\xff\xbbp\xe2\x11\x17$\xefo\x96\x9ef\x01\xd3\xcd\x87\x07S\xec\x9e\xa2H\xc4&\xafT^\xd9\xe9T\x9c\x9e^\xcbE\xaa\x84Y\x8as\xff\xeb\xe9\xe9\xd0\xb2\xeei~\xbe\x96\xf9J\x89\x9f\xa0\x06S\xee\xc4\x9f\x1aE;M\xac\x8d\xadT\xc2\xba\xee\xd4<Y\xbb\x8f\xa3u\x95\xa5\xdf\xcf?GC\x84\xc7\xfb\xfe\xddS\x8c$}\xf2\x1fe\x1d\xd3\xb3}\x12\x95\xee\xe9z\xadD\xa9b\x93e*OT"\xb6r\'*#\x16\xc6T\xa0-\x8b\xc0y\x05v\x94\xf9N\xd8\x1d\xe4\xcb\x84\xb6\xf4a\xe3\xb0\x81v\xd4\xef\x9fyQT\xec\xe6\x9f\xd9|e\x9d\x0b]\x89\x9a\xadXa\xc7J\x96+U5\x1e\xa7\xf2\x8d.M\x0e\x0e\xaaH\xbc\xd5\xcb\xa5*\xf1\xd8Q4\x85*!0\xd6\xba\xad\xadX\xcb\x8d\x82\x17\xfa/{\x02T*^\xe7\xfa\xaf\xb5b\xf6d\x8c7E\xaa\xed\x1a\xfb\xea@I\x0b\xc4[,J\x037\xce\x11T\x16"\xab\xd4l\x85,\x15\xfe\xc8\x94P\xb7\x12\x0b\x1d\x15\xe2ugj\x01\xd5\x97d\xda!Ev\xce\tv\xfeZ\xeb\x12K\xbd|_Eo\x84)\x05\x8c\xa6\xcaH\\\x9b&\xa8{\xc0\xd0\n\x9bw\xcb\xbe\xa6e\xed_\xaf\x01\x02V\xb1\xfe\xe6\x81}8\xba\xc4\x12_\x06,\xbc\x8cn;\x92\x7f:\x08\x08&\xa5\xdcNZ\xba\xe3b\xf7\xd5\xd7\x93\xc0\x94\xfb|\x96\x1c\x08qz#\x8a\xd2l4[\xc0\x88`\x1d\xf9\x89$\x7f\xba\x01\xd0\xdd\xdc\xf1\xad\x8ewH\xd5\xd1$M\xd9J\xdc\xe4p.R:\xc5g\xa9R%\xad\x1a\xe4\x01\x11\xfd9\xd82@\xbef\xab\x88\x84\x8d\xb4\t%\x1a\xa2\xf4I\xe7\xf0h+\x8e\xaf\xcc\x16H\xbdV\xb0\xd2\xab\xd6x\'\xff+\xdcy\x0f2\x0b\x92\x0b\xaeQ\xa7\x95\x1d\x050^\x94j\xa3Mm\xc5\xc6\xe5\x07+\xde_\xfc:\xbb\x16\xc7V\xc1\xda\xbf5\xdf!\x06\xe6\x9fO\x06u\xe0 \xb2\xe1\xff\x1bq\xbc]\xebx\rW\x8b\xd3:!_$\x81fN\xa0\x13\x92H\xc92\xd5\xaa\xecv\x04\x02\xfa\xe5\x1d\xd5\xad\xae\xd6\xbd\xa5\x8d\xef*\xcaM\xd5\x0b+\nc\xad&\x03U\x9d_\xf3*\x93#\x924\xc5PG.\xd0*E,\xb0!\x123\n*\xa4\xb7\xf0%\x81F!\x11\xeb\x1c\xb5\xcd\xb7\xd3\xe9\x90\xe0\xf4\xef{q|\x91o\xcc\x8d\x1a\x7fR\x8b_\x15E\x7fu\x98\x13\x9cD\x1e\xf5\xc5\xdf\x84\x83o1\x88\x93\xff\x8e\xf0\xcfjPe\x0c\xe0 \x0c\xf8e\x81\xcf\x92L\xe7\x9av\xaa4\xe0\xa9(\xf5F\xa7\nI\x99\xb4M\xf0\x91\x01[\xe3\xb516\xd0H\xa05I\xe1]\x8eS\x13\xcb\xb4\xf9\x91q\xfe\xffKnd\x0e\xe2`h\xb3\x8b%K\xc0\xb8\xeb\x01\xe9U\xd4\x05\xc6\x88\xdf\xc62\xef\x10j\x0e\xf4\x9f7\x96\x0b\xc5\xacLG\xb6\x83pO\xb4q\xc6\x88\xa3\xc5c\xf0\xa8\xbf<d@w|\x05^\xd6 \xe6\x1f;o\xfd\xc7\xebP\x8c_\r\xbb\xce\x9e\x14{?\t\x10\xf67\x01\xfc\xe4\xec\x1a\xf1>\x1eQ\xb7\x1a\x84\x9b\xc5l\x0fY\x00\x9f\xe1\x92\xb0V\xa8~\xc8\xa6\x175\x17\x13K8+\xd3k\x18\xd3\x0e\x99\xa1\xdfA\xc0\xb9\xccc\xd5sS\xe1"\x15\x06\xab\x94s\x08fc\t\x89@\x17\x1e\x01\xfc\xde}\xf6+\xe0\x1b`\x08%-\n\x89\xbc#\x8aUm\xc6\x9b\xcfg,\x8d\xc5\xb7\xb6^$H\xa91\x97P\x0eJ\x1d\xb6`\xf5\x06\x01\xc3\xfb\x13\xf3=\x80\xed\xe8\xca$qP\xd2R!\xf5\xf2n\xf3\xf9\xd5\xd9\xf5O\xd8#(C\xc4FBU\x0br=x\x18\x14\x81\x95\xb9\xa9\x84LK%\x93 s\x00\xb7-\x97->@\x12\x9d\x0c\xc6\xf1\xc8\x07\xc5\xb0D"\xacL\xe6\xf3?\x80\x93\xe9\xd9\xd5\xd5\xdb\xb3\xeb\xb3\xbf8e\xfc\xa5]8h\x8b\x81\x04\xc6\xea\xd1K\xad\x92G\xb2\xd6\xbeT\xd5P"lC\x99\xd4\xcf\x02xO\xbe\xd13\x7f\xf3\xa1l\xa2~\x9cRm\x15\xb8[\xe3\x90w\x9c\xd8\xd5\x85l\x0c\xe8\x13\x80PR\x94\xa8\x85X\x94`\x00)\n;\x19\xe8\xaf\xec\x8a\xbb\xc0\xb20\xfa\x11B\xe0\x08\x1a\x96\x15{\xf1#*B6\xbdEzDQ7\xac\x99\xa15\x1fP\xd3\x8b_t^\xdf\xf6\x82\x86\x1d^9\xf8\'\x82\x83;\xbf\xdd#\xf6\x01\x95\xb1\x87\xc30\xb6\xc3\xdc\xfc@\x907K\xf7D\xf4CpH\x82\x1c\x06\x80b|\x89\xac\xd1$\x90!\x8a\x1f\r\xe7pYux@Y0W\xca\xe7\x04\x02^\xe6\xbd\xc9\x14\xacK[\xa3\xe4\xa7(\n\xb3h\x988\x82l@\x8b}K\xe2\xb4\xf6\x7f+\x9b\xad\x13\xf3\x80\x80g)\xd2_\xce\x19?\xdd\x8d\xc2\x12\x9c\xe4\\\xa8.\x03q;\x12BC!\xab\xf5?\xc2\x0e\x0f&\xf2\xce \xf8\x90\x1b\x1d\x93&\xd0s\xd3Y\x1d\x03\xe6\xc0+^\xbeU\x0b\r\xd8~\xc3\x1et\x0e\x90\xbb\x9c\x89\xd7\xbd\x88\xb7\'Ap\xcf\x89\xdd9K\x8d\x18\xe62\xc0\xec\x89\xf8\x91K\x13\x12\xd5\x12{\xbdt\xf5T\xac\xca\n\x80\x15\x93\xf7\x927\x80\x87\\\x82\xc1\xf9i\x14G\xd6\xa6\xd1\x12\x15a\xba\x8br\xec\x13\x82\x8ar\xd8\x9c\xc9*^3!j\xc0\xfd\xd2{j\x9b\x03\xaasJ\x07\x9a$\xf0\xb0\x1c2\xd7\xa4P\x12\x04/\xa9;\x8dM\x8d4\xcf\x19G\xa7\x92|\xd2 5@Y\x1c\xb6\xf7T\xa0sv\x894\xdd\xf5U\xd0%\xfa\xf1m\xb4\x8b~\xd7\xc5S5\x81\n}\xbe\xddn\xa3n\xe22\x1f\x90\xbfc(P\x04\xc4\xd7\xe1:\x82\x14\x14\xa2\xdc\xef\xba>K[\x8b\xd2gD\x8d\x96\xac\x1aw]\xd4+\xc8\xc3L9?\t\xbb\x05\'o\xb7\x9dkV.\x88\x8ex\xfd\xed\x83m\'\xb13\xe1\x1d\'\xaf\xbf\xfd\xc2\xd5F\xd5\xf8\xf57\xdf\xbc\xfc\xf6\xe5\xeb\xef\xa9\xc7\xe9J\xce\xa2\x80\x15\xa8\xa9l\r\x01v\xb2\xd1}0\x08\x82OZ ]\x8a\x86\xde>\x1aa\xe3qn\xc6\xf1Z\xc57\xe3P\xefOl!\x1dA\x1f\x80\xbd\xd0\x1c\x83=\x15\xd7\xa5: +\xb9n\x8d|\xe1\x83\x8c\x05\x02\xee\xdf\xc41\x96\xa6\x077\x9e\xfbk\xf7&\xc4\xa1Pd-\xd0\x0c;9\xa7+_\xa3\xb0U\xe7\xfc\xba\x19.\xc1\x0f\x82\xc4S*\xb8l\x1c|\xca\x98=\x9f\x13U\xfcEx1\x9f\x8f/\xbb\x17c\x83\xba%\xac\xe8\x1f2\n\xf3v \xec\x99G\xd2O\x80\xd3\xc9F\xa2`Mz\x03\xb4G\xb4\xba\xaf2\xca\x0c\x82F6\x04{5\x90\xe1A\'\xa2\xc8\xd6\x08Fh\xbak\xdc\xc9\x85ct\x90&\x0b\x06\x1d\xbet\xe5\x16\x91j\x1f}K!\xd8b\x06\xa9R\xddB\xfe\xd8\x01\x83\x85\x1d\xe3\xb0{\x94\xe5\x82<\x7fY\x9aL\xccg\xbdN\xe2jwu\x11\x8e&{\xf1\xef\x02\xb0C$\x84\\\xbf\xa4\xa2\xc2\xa4\xd53\x9b\x91G\x7fuQ\x18\x1a\x81u#`\xfe:\xdc\xd9i \xea\xab\xecQ\xbb\xf7\xc0\xf1\xf6\x0fM$uS$\x1f\xe3\xe3\xb1S\xd3w\x13l4\x19\x1a\xa0\x85#\x11\xf2\xd1\xf1\x185k\x01g\xf4\x83<)\x965\x08y>E\nAh\xda\x8e\xa6)h\xd3hBL=D\x0f\xdf9<\xde\xa1\x89\xf1>\x04\xc8\xcdk\x99\xa2\x94\xa3\xaa*Q\x95\xd4\xa9w\x88&pFB\xd9B\xc5\x9a\xb3\xc1\x9cM\xa8\xe2\xbe\xebAJ\xe7\x16}Oj]c\xcf\xdc\x8df^\xf7y\xe9F_\x0f\xcd\xa2\x83u}\x82\x01\x83\x8f\xf2\xf5\xe4\xad\xbep\xe4\xc6!\xb9qK\xee\xe1\xf0mj\xe8\xa1\xc9\xffpY\xd6k\xac\x9b\x80\xb2<\xa3@U\xb6D&AxU\xce&H\xe8\xff\t\xa9_XdL$K:=i\xb2\xde\xd5\x1dlq\xa7#\n0\x92\xa8[\x98F\x08tf\xa6\xabD\x91\x1fQ\xf6\x99\x8a\xf4\x86\x14\xc9\xd4\xe9{\xbc\xe6F\xb8\xf2\xe3R\xbb\xd7\xa8\x071\xd4\xe7#4\xc5\x83a>\x98\x1e\xbar\xa8\x11\x82\xa1\xa3\xd5\x99+\x92\x12\x85\n\xd7\x14\xae;\xf6\xbd\x05\xd5\x00AY3\x0fj\x01\x9a\xfan\x10\x0f<\xbbex\xe2\xe8\xf9\xa1)\x05(\x89\x98\xf9\xe7\x91\xefO\xc6\x03\xe4\xadW`P`}\x19\xbdAS\x08\xdc]S\xffD(\xdc\xee\x01\xac\xdd\xa27\xdd\xab\xd6\xfe\xce\x07\x1e\x8eM\x00\x18\x93D-%\xa0 \x02\xd8F\xab\xdf\xbfP\xab\xd5w\x01Z\x81\xf1\xfeF\x1d\x8fn\x13\xeca7y\xcf(\xce\xbavb!\xfc\xc2\xdcN\xdc\xe7\xca\x06;\x8fAf2\xb0\xd7\x97o\xf6\x14\x0fm\x9e\x19Nj\xc3\x13\x9c\xa6\xc9\xe71G\x00\xe2\xdb.s\x01\xd0\\w\xca#\x9cH\xdd*@\xa9\xa1\xb1I\x94Y\xdd3\xb9_P\x8e\xdclf\xd7\x0e\x03\xbb9\xf7R\xc9\n\xa5\x10Y\xf6\xe8,I&\xbf\xaa\xcc\xd0H\xd1\x8d\x82\xec\x91\xf7\xf2\x8e(M\xd8\x10_\xf0\xf7\\\r\x1b\xf7\x92&\x03[m\xdd\x98\xb0\xdb*\xccI\xa5x\xdbt\xed\x8a*\xdc\x95,\x93T\xd9\xc6\xc3\xeeE\xb9\xf7@dbE\xd3,A\xf4BO?m\xcb\x9cv\x1a\xa0\xe87\x9a>pF\x0cgln\xc8\xa3\xf1\x82\xe3 \xa8\xc5\x10\xdf\xa0\xaa+:\xb0u\xe7\xb7\xa0\xd1N\x85\x82\xc2Z\xf2\x08m\xe7\xa7 X\xb3\xb3\x11\xb5\x8f\xc1\xe7\xa0\x7f\xe2\x0e\r\x06\xb5\xe4\xabi\x8a\x19w\x92L&m\xe6*\xa4=\x81\x9a\x8e\x01\xa0T\xe3GU\xd8\xd1E\xe7\xb1&R\xcb\xbad\xde\xa8\xb3\xe7\xd1%@61\xb9j\xeb\xf8\xadDdS\t\xe4\'\x84)\xf5\x89l\xfcn\x97\x80n3/\x97\xa95\xedZ\xbf\x80,\xf6"\x1c&\xbe`c\xf4~\xa2*\xe2\x85\xef\xe5\x02\xd8cEZkb\xcd=\x0e\xbc9\xae\xf9|\xc9\xf6\x1b\xf5\x00i=\x8d\xce.O;\xba\xbdw\xf6z\xf7,\x9by\x1a\xcc\xc8\x87\xd3\xec\x9e~R\xa5\xea\x0e1\xbd{w(\xe9\xaa\x04\x82\xf4\x9a|\x86\x1fi\x7f\xe7X\xa5r\x05&5O\xc1\xf4 U\xb2\xe4\x06U.h\xbe\x17\xd8\xab\xd1\xd1\xbb\xd5\xca\x13\n\x04\x19\xac\xf5N\xc5\x9cfYa\xe5B\xa3\nD\xc2\xaa\xd6\x89\x1b@\xf3\x0cP\xd1x\xb9)\xb0\xee\xad\x0fr\xfb[\x979\x98\xc6\x8fDc\xe0\xf3\xe2f\xf5\xb9\x13\xee\x0c\xd9\xad\xddc\xe0\xeb\x0b\xdf\xc0\x8b\x19\xd7q\x1e\xaf\x02Q\xc35\xdd\xd3\xbf\xd0\xc9\x81+\xfa|C\xebuBM4%\x9d\x12^d\xd7\xa6N\x13\x8e\x0e\xf6\xa7\xce\xdd\xe6\xbd[\x15\x1dY\xbarA\xca\xa7B\x95\x0b\x8e\xf0,f[\xea\xaaB{|\x8c\xf8\xa46\x1e\x8c\x9e0R\x04\xf6ML\\\x137\\g\x05!V\xa4\xf5\x8aB}\xd4\xcdW{\x0e\x10*\x99l\x84\x0f\x0b>\x83\x85C\xd0\xc8\xd2m\xc8>\xd1\xab\x919\xd5\x97\xeeP\x9dg\xee\x9d=I\x86\xa6\x04\xab\x8b\x84b\xf0\xae@\xa6\xbc\x81\xb4\x01\x9b\xa7t\x16\xac\x92S\x9a\x97Q\x92t R\x92\xf2\xbaI\x0c\xb8\xa5\x11\xbfO/v\xd4\xe2\x87\xad\x17\x99\xae<[\xa6\xc7g8\x91a\x1bQ\x9fu\xa3\xca\x07\n\xee\xe1\x05\x87\x16\x13n\xc2\xd2\xa7x\x90\xbf\x1dVj\xc3d\x99\xac,\xdf0\xb9\xbf\xc9C\x11s\x18\xfd\xeeq\xcf\x16\x0fD\xd9a;\xf4\x08\xec\xd9\xe4I\xc8q\xd8\xb6a\xde\x18\xd8\xb5\x17\x97\xbdpl\x0b<\xfa\xb1W\xe1ih\x97~\x9c\xf4\x16O\x1enr\xee\xc1\xfay\xa9P\x98\xdf\xbf\xda3\x0c\xac\xa4\x1d\xc4\xfcJ\x93+%\n\xfb\xe5\xcd\xd5\n\xae\xdcV+\xaaP\xd8IXY\xfe\x986\xd49> \xb3\xa1\xfc\x0b\xbb\xf3\xd8\x8c\xe3Rq\xc2\\\xec\xc4\xd5Z\xa3\xce,\xc4;<\x13\x99\x1f\xccB\\\x14\x85Iue\x10\xcc\xf4\'\'m>\x9e#\xdcQn\xab\xa5.m\x15\x92\xedu\x11w\xd8p\xc0I\xe3\x86T\xfb\xf5<\r\xbb{\x15\xa8!\xd2g7\x03T\xe8\x05\xecTQ\x01\xb1\xa2;l\xebl0\xa8O\xc5\x05\xd0\xe8\x07\x1d\x13\xe8\xf4X\xce\x08E\xe9\x8e\xc4N\x1c\xb1\xf4\x14\x96 \r\x05VG-\xd0\x80\xf9p\xeb\xd0\x93F\xc14\xcf\xcfM\xdc\x9c\xc0\xf7U\xf4\xfbFK1c\x99\xf1f\xa5\xfa\x95#Z\xcbz\xd1(\x89\xf2\x07*E\xae\xf3\x082e\xfe\xc2\xb6i\x86zuR\xd1\'\xb5\x18\xcf.~\xf4y\xfa\xd3\xec\xc7\x8b\x90\x9a$e\xfa\xa3\xd2D\x15\xa9\xd9q\xb7\xe5\x8c\x95\xdbB\x97^\xd3\xb1A\x04\x15\x15\x17\xe9\xf8\x02\rma4\xb6\xe1\xea\\Q\xaa\xef\x91\x85\xa1h\xe8\x8e\x96a\xa574\xaa\x95\xe9\x8d\xa5\xde\xfajw\xee\x0f\xa0Tj\xd5\x96\x92\x82;\xf4!\'t\xbf\'5\x0f[{%?[0C!O\xd6cIhO\xe7\x10\x1d\x04\r[\xf3g\x9d\x89\xf7h\xd6hxA\x9d\x03\x97\xab\x90Jg\x0e \xd4\x92\xec\xc7\xf5)\xdd\xaf\x14\x12i2s\xe3nd\x19\xee\x07\xe8\xe8\xd7\xd4\xbd\x00\x904\xc3qo\xef\x9eb\x0f8*\xf2\xad#\xd6\x04_x\x1c\x1a\x92m\xdb\xa9mIC\xee2\xbc\x00\xb0G\xbe&\xf8~\x8e8\xfe\xe8\x96\x00c{\xc6A/\xf9\x96&\xb1i\x83\x1a\xed\x8eSq\x1cR\xe6\x84Cy\x8e\x01\x9f\x92V!\x14\x10\x02P\x10\xd7\x8a\x0b\xd0\x84\xed\xfb\x97\x04\x1c|\xf4\xca\xc3\xf6\xc2E\xe8`Mq\xb1G\x8e\x19\xc0\x89\'\xedp\xc0B\x96U\xdb\x89\xb5!\xe8\xe7\xa9\xa1(h\xf0\xe1A\xcb\x9aoQ,v\x0e\x15\n\xd5\x0b~\x17M\xe2\xacc\xc5\x8a\xf74\xec\x91\xfe\xbc\xc74\x17\xd5\x84l\x98$\x8f,\xa5m\x93\xef\xbd\xfbh@\xe25\xb4\x88\xd6V\\]|\x08\xe5\x8cD\xff8\x89Q\xe3rv\xf6\x9e\xee\t\xd1\xdd\x16:\x89\xf7\xa3\xe0\x0f\xfa\xa6G\xf3\xe8\xdc\x80\x8b\x1f\x801G\xe2Z\xeeRS\x9e\xf4\x9dv\xadt\xd9\xb9.\xf8\xa3\x8eUr\xbe\xcba\xb0B\xaf\xec\x10\xaf\xd4uCo\x03A3\x12\x8a\x02tAh\xa3\xdc\x07\xac\xd2\xa3\x18o\x8f \xcb\xf15\xe4\xbc\xc1w\xabzg\xff\xe9dO\x9eA{q#\xfeC\xcb\xe4\xbf\xfe\xdex`Q\x02\xect\xd1\xf3A\xfa\xbd\xeb\x19\x89\xd3\x9b\x91\xe0[i!\xb7\xdcnn4@ZV-\xfe4\xe1\xefq\xcd\x0fLF\xee\x08\xa8D\xa3L\xa9>W[\x9e\xb6\xe6fs\xb7\xb4\xf5\x8d^\x92\x90\xca\x1a0OP\x1c \x8a\xf7z$\x95\r\xb4[\xa6\x08\x8ay\xe6\x1dN\r~\x96\x16\xec\xfc\x1a\x89sc\xb2\x85\xf5\x92\x87{"\xe1\xc3oa\x9b;!\x18\xb9;@^\nZ\xd8~I\xfcC^S"\x1dt\xb7(B\xa2\xf7f~\xbd\x9b\xd9\xe2\xf8jwuv\xd2\xe6\xf3\x94\xae\x0f\xb47hZE\xee-hy`1\xd8\xa8\xedmC\xc3\xd9L\xd2\xdc\x9b\x06\x8eW\x07\xac\xe8\x9e\xde\xd1\xa0\x94\xae\x08\xf2i\xa9\x8c9\xa7\xfb\x11g\x10\xf1\xdd 4\xc6f\x0b4\x1f4\xab\xe2\x13F_|\x87\xc9(\xa6\x03\xd4\x12\xe6\xf1\x8dWX\xab\xb1\xc1\xd4m\xd1\xf6\\\xdd\x99W0`$m\xde\x95\xeb\x81~`\xe8\xf3\xae\xe6tG\xb5\xfe\xd8*\x9f\xb8[\xad\x13\x12dl\x96\xe3\xd8}\xde\xab\t\xff\xacvh\x80\x12\x14\xfc\xe7Wg\x1f\xfd\x1c\xb6=i\xe1\x80\xf5\x93"ri\xfc\'\xe3\x8b\xd2W M\xc8\x1c\\\xbb?O\xa5\xb5t\xfd\x07\xdd\xc9\xdb`\xb6:\x03\xb0\xa2u\x9bN\xc5k1\xa6\xb9[\xe2N*&3\x06\xfd\xfeBjL\x18l\xcfP\xc6pY=\x9dv\xdd\x83\xed\x7f\xec\xaf\xfe\xd3\'\x97\xb3\x0bB`\xe0,\xd6\xe2\xef\x0f\x17\xd7\xcd\xeb\xfe\x9a\xcb\xb6\x9c\x9b\xb9r\x8e\x17\xf3P\xbb\xa0\x9dI\xb8\xf0{?\'\xcch\xc5/2_\xd5\xa4\x89i\xfb\xbf.\xe0\xe9\xab\xe8\xcd\xd3\x97\xfc\xf1\xa9K^=yA\xf4?X\xf2\xf5\xd3\x97\xbc\xee/\xb96\x85\x8e\xe9\xcd\xcc,\xab-\x8d\x85B_\x98\x92\xd1\x16\xa5\xe4\xd9dG\xe8\x03|"Uv\x1f\xa5\xd6Pge\xbc\xd6\x1b\xe2\x86\xd66\xd8\xf4\xe8\xb2\x99\xbfi\x12^\x97\xa5\x02~p\xd9o\x15U\xf1\x9a\xb8\xf9oPK\x03\x04\x14\x00\x00\x00\x08\x00P\x96qH\xc2t\xb1\xd6\xe2\x03\x00\x00\xb2\x0f\x00\x00\x14\x00\x00\x00EGG-INFO/SOURCES.txt\x95WKs\xdb6\x10\xbe\xebW\xe4\xd8\x1cHO\xedN:=z\x12\xe71\x1d;\x9d\xb8=c rI\xed\x08\x04P\x00\x94\xc4\xfc\xfa.\xf8\x90 \x12\xa0\xd5\x8be\xec\xf7aw\xb1\xc0>\xf8\xf1\xeb\xe3\xcb\x97\xa7\xd7\xdc\x9d\xdc\xe6\xf9\xf1\xe5\xdb\xe7\xa7\xd7\xbfs\x94\x9b\x1fO\x8f\x9f\x9e\x9fz\xf1V)g\x9d\xe1:\xd7\xdd\xa6P\xb2r`\x9d\xff\x1f\xb8\xed\x18J\xeb\xb8\x10\xfd\xfa\'\xb3\xe0\xda\x9e\'x+\x8b\x1d\x98\xbc\xd84\xf6Pd\xdb\x16E\x99]\xa4M\xb9\xd1\xfc\x00\r\xc8^\x95\xeez\xa5(qc@\x90b\xf0\xd2A[Q\xd5\x9b\xb3\xdeR\x15\xf6\xee\x99\xef\xa1B\x01\xc3\xca\xbbt\x86J8\x80P\x1aLV\xb7XB\x7f\x80\x10\xe8\r\x9e\x85W\'8K+e\x1a\xee\xecE\xb0C\xeb\x94\xe9.\x02\x94%\x9c.K\xbd\xaf\x99\x01\xabZS@\xb0\x8d\x0e\xb5S\xf2\xe1"\x18\x8f\x16P\x8c\xe2eC\x91=\x0b\xfa\x83:\xa5D@b\x0e\x1a-8Eh0l\xe9`[n\xf2\x9dk\xc4\xc4\xd8Q(\xef$w\xad\x81\xbb~\x91\xfb\xb0\xc4P:\xac\xc3b\\\xe5\x85\xb5\xcc\xad\xd0tW\xfb\x90YO\xdc\\\x9d\xf3\x8eQ\xe4\xd01\xd6\xdf\xdf\x15\xc252\x7f\x9f\xc3\x19f\xbb\x0e KeVvO\x0c\xddin,\xca:M\xb1xJ\x83\xc3\x0f\x94+Nh^\xecyM&\xc8\x1d\xbeU\xed\xba?\x01\xf9M\xdf/\xdcB5\x9a\xbb\x9b\xa8\x94em\xe1\xa3oo\xa17\xdc\xec\xc1\xdcD5\xf0o\x8b\x06\x86\x9b\xbc\x81o5\x14X\xe1\x8d\xda[\x87\xe2&\xe2\x81\x14\xa2\x92K*\x9c\x1c\x18\xb9\x12\xd7\xfe5\xbd\x89\xfb\xbf,\x19\x96\x80s\x9d\xb0k\xcc+\xd6%9\xaf\\\t\xc4\xdc\x14;<\x00\xf3!\x99A\x85\xc0\xec\xe1>\x87\x13\xcc\xa5\x1f~\x8bI\xb9i\xe2\xfc\xb9\xa8\x04M\x81\x9e;X\xe2P\xa4\x03\x91\x8f\xb2\x9c. \x90S\xa5\x8cX\xf2\xd2\xa5g^\x1a\xf7\x8c\x90\xb9h(\xf73k\x02\xb7\xf7N=08\xcd\x00\xdf\'\xfe`\xb6\xd5Z\x99\xb9\xeb\xc3\x1b\x026\x14\xde\x19\xd6\xdd\x7f\xb8$\xd95\xf0{\x02x\xf85\nX.\xcb\xad\x9a\x1b\xb0\x85A\xed\xde\xfdB-\xe4}\xee\xa8\x14/\xc1\xa5\x18\x1ddd`q|kE\xe2\x8c\xad\xc4B\x95\xc3\xdb\x99\xdffL\x16dS =R\x88\xd4\xd1\xc6m\xe4P\xd7\x19\xcaJ\xdd\xfd\xf5\xe7\x97\xec\xdb\xcb\xe7\xefQ\xf0\xf5\xfb??>\x8eCA\x0c\x1f^\x1c\xc8\xa2c\x02\xe5\xde&\x89ToL\xc7\xb4B\xe9\xd2$\xa74\x13\xbe;\'\x19?Qg\x96W\xd7\x89\xa0\x9a\x86n+\x95\x88\x13\xcc\x05\xf2y\xe0&l\xebs\x84\x91\x95U\xdc\xe8f\x15\xa7\x80\xfb\t"\xc5\xf1s\x0f\xbd\xf5u\\w\tx\x9cZ\x12\xe8|\x00\x8bQ\xea\x9a\xf9\x18&\xe0\xf5\xcd#\xcanSBoa\xfb\x06cH\x96\xd4}L\xd3\xe1;Za\xe5\xe7\xc1S#bD\x035E\x9e\xc6\xc8\xb8\x1e\xa3hv\x81\x04hi\xeaTi\x1fl\xa4n\x9e1\xa0\xa7\x9a\x02\xa7\xa18\x02\xb5Z\xd0\x98\xb7\n2?\x81E\xca\xf5\xac)\x06\xe8\xb2#.@\x9a\x00\x1d)\x99\xeb\x1d@\x90\x074JN\x03\xf8\x02\xf7\xf3u|g\x85\xa7\xf3\x8c\xb2\x00\x93\xc5x\x80\x87\x07\x90\x1d\xd1\xed\xb2\xad\x9a\'\xd6\xc8\x01sX\xdcm\xd0\x92Si\x1bR\x12Y\x17P\xe2\x99\x15\x12\xbc\x95\xc8\xab\x0f(+\xf9\x17\xb2\xe2\xd9\x130*\xaa\xd9llq\xf1\xb0\xf64\xaa\xa2P\x1b\x1a\xcb\x17E?\x1c\x7f|\x17\xf57@\xf7\xb7\x12\xc4\xd1Z\xac\x9f\x06\xacx?\x0c\t\x91t\t\xe1K1Or"\x89\x13\xa0kM1\xa4%\xb3( M\xad\xf1H\xdf\xb2z\x1c\x11#\xcc\x93;\x8e\x1f\xbb\x0b\xb0\x0f\xd78 \x0e\xad\x8fi\x83\xca\xa0\xeb\xc6t\xe5b\xf8,\xfb_[-\xd2\xf4\x00\xf4\xdd\xa9\xe8\xb3n\xfc\xb8\xec\xb5\x0c[\xa9N\xb4\\L\x81\xfa\x0fPK\x03\x04\x14\x00\x00\x00\x08\x00P\x96qH0\\\x01\x91(\x00\x00\x00&\x00\x00\x00\x16\x00\x00\x00EGG-INFO/top_level.txtKM,\xae\x8c\xcf\xcc+.I\xcc\xc9\xe1*\xc8N\x8f/J-\xce/-JN-\xe6*N-)-(\xc9\xcf\xcf)\xe6\x02\x00PK\x03\x04\x14\x00\x00\x00\x08\x00\xa1B[H\x93\x06\xd72\x03\x00\x00\x00\x01\x00\x00\x00\x11\x00\x00\x00EGG-INFO/zip-safe\xe3\x02\x00PK\x03\x04\x14\x00\x00\x00\x08\x00\xf3\x80oH\x15\xd1Q\xc0\x8cj\x00\x00W\x88\x01\x00\x19\x00\x00\x00pkg_resources/__init__.py\xcd\xbdmw\x1b\xc7\x91(\xfc\x9d\xbfbB\xad/\x00\t\x1cIv\xb2\xc9*K\'\x8a\xa4$\xba\xb1%^I\xb6\x93\xa5y\x81!0$\'\x040\xf0\x0c@\n\xce\xe6\xf9\xedO\xbdvW\xf7\xf4\x80\x94\x93\xdc\xb38>\x16\x81\xe9\xa9\xae\xee\xae\xae\xae\xf7><<<8)f\xd7\xc5e\x995e[o\x9bY\x99=?y}p\x94\xf8\x1c\x1c<\xf7\x8d\xaa6+\xb2E}Y\xcd\x8aEvQ-\xcalV\xaf6E\xb5*\xe7\xd9m\xb5\xb9\xaaV\xf0|\xcd\xa0\xc7Y\xdd\xf8\xd6\x07\xed\xf6|^5\xe5lS7\xbblsU6e}\x91g\xd9\x87\xabR_\x08p\xc9\xca\x8fkh\xdc\xfa\x1fW\xc5\xb2l\x0f6uvU\xdc\x94\x08\xa1j\xe0\xcd\xcd\x15\xfc\xaf\x81vm\t\xff\x16\x1bA$\x9bN\x1fO\xa7\xe3\xec\xe1\xaa\xde<\xccn\xaf\xe0\xc1M\xd9\xe0[\x80\x10\xa2Co\xca;\x80g\xd5\x02./\xeb\x0c\x9ag\xdb\xb6\xcc\xea6\xa7\x16\xf5\xba\x84\x06U\xbdj3\xe8yY\xac\xaa\xf5v\x01\xc0\x1cZ\x07\x84Vv^V\xabK\xc0\xa4m\x01\x81j\x05m\xb1+\x18G~p\xd0;D\x98\xcdy\xd9V\x978{\xf0\xc6m\xdd\\3\xf2\xab\xbaY\xca\x04\xb7\xbbvS.\xf5\xfdv|\x90\x97\x97\x97\xfcd\x9c\x15\xaby\xb6]\xe13\x80\xe0\x1f\xc0P^o\xb2Y\x01\x8b\xb1h\x05.\xad\xcc\xa2ZV4C\xc5\x8e::\xc8\x7f\xac\xd6\xfc\x0e\xc1\xa2\xceg\xdbvS/\xb3\x93W\'\xd9\x17O>\x87\xe9*\xe6e\x03\xc3\x879\xcc\xda\xedz]7\x1b\x1a\xdctzYn&\xf3bS\x0cG\xd3\xe9\xc1\xb2\xdc\\\xd5\xf3\xfc\xe0\x10\x88\xeb\xe0\xa2\x01\x08\x93\xc9\xc5v\xb3m\xca\xc9$\xab\x96\xf4Zq\xde\xd6\x8b\xed\xa6\x9c\xf0\xf7\x83\x03\xf9\x1d\x06\xa9\x7f\xd6\xee\xaf\xaa\xd6\xbf6\xd5\xb2\xd4\xbf\x1b\xf7\xd7f\xb7.]c\x18\x07\x0e\xc3|\x95.\xe4\x87\xdb\xa2Y\xc1\n\xb9\xf6\xed\xa6p\xcf.\xb6+\xa0\xcaz\xe1\x1e\xae\xaf/\xb7\x9bj\xe1:\xaa\xaf\xcb\x95Guy^\xbbGL\x1eu\xe3\xde\x04\xda\xb8\x80\xc5\xd3\xef\xb3z\xb1\x00*F\xfa\xf1M\xaav\xb3\xa8\xce\xf5{\xb9,\xaa\x05\x10[\xd3\x96\x0e\x0c\xacx0\x9cM\xf9qs\xdb\x14k\x9eWAO\'\x15W\x81\xff\x04\x00\x07\x9bf\xf7\xec \x83\x8f<\xc5G\x07\xe5\xc7Y\xb9\xded\xaf\xe9\xa7WMS7\xdc\xe6Av\xb2\x83U[e_\xe4\x9f\x03\xaeK \xf9\xea\xbcZT\x9b\x9d\x05\x01\xffdE\xcb\x90\x1c\x06\x13\xa5\xe46\x07\xe4\xcaf\xa5\xad\xdb\xeac\x7f\xa3\x1c\x9e\xe6\xcb\xfa\x06\xe8M\x9ao\x9b\x05L\xc6\x18\xb6\xd6z\x8c\x94H\x83x\x00\xc4\xbbF\xd2AB\x83\xdd\x08\x9b\xe3|\x87\x9b+k\x81L\xcf\xeb\x8f\xb0\x94\xdcI\xed\x01\x11\x95\xb8\xe1GO\x97\xd7\xc0|\xc6@=\xb8]\xc7\xb0i\x16\xd5\xea\x9a\x1a~\xf7\xee\xf5\x87W\x93\xf7\xdf\x9c\x9c\xbc}\xf7!;\xce>4\xdbr\xcf\x84\xad`?5\xb0\x89t+\x8c\xb3uS\x9f\x17\xe7\x8b\x1d\x00\x85\x8d\x92\xfd\xe1\xf9\xab$\xdc\xdf\xc3^,\x0fb\xac\x81\x80V8\xb9u;\xc1?\xf513\x1f\x9d\xff\x96po\x81r6\xdd\x05\xe6\x7f`\x0e\xf3e1\x03\x06\\\x02{-Z\xff\xf3\xc4\xfd,#(f\xb0\x1e\xb0\xdf7\x9b\xa6:\x87\xcd\x88\xb3\x0b4\x8b\xdc]f\x92\xc61/\x17\xc5\x0e\x99\x99L`9\xbb\x02\xee\xd7.\xdb\xdc\xf4\x1e\xc0\xcf\'\x13\x9c\xdd\xc9\xa4w\xfa\x12/\xc1\xcc\xbc\xa9Wew\\\xb2#\xfa@!5\xdc\x83\x1a\x99o"\xb9Ld\x93L&\xc3A\x924]\xd3\x1cN\x8a\x16\xb6\xec`\xf4)/\xb5p\\U\x17\x15\xbc\xfai\xef5\xe5\x0f[8\x17\x97\xe5j\xf3\x89o.\x8b\xe6\x9a\xbb\x03Fz\x91\r\xbf\x18gOF\xd9\x7f"7\xd5!L\xaa\xd5E\r?\xe1\xb3/F<s\xcb\xf6\x12&}H\x7f\xe3\xe7\xf0\xbd0u \x02\xcf\x0f\x9e\x1c!O\xb8*\xf0h\x03\x12\x9d7\xf5z]\xce\xf3\xec\xf7\xc4\xd23\x81\xdff\x87\x1e\xcem\xb5\x803\x0b\xb8Y\x86\xa7{\xceOF\xf4\x7fe\xbf9\xfe1\x04\x0cF\xb8\xc9\xe7\xe5lQ\x00\xb0\xb6^\x96\xd9\xe5\x02\xb6\xd1B\xce\x19\x02u^B\x8b\x0b\x92-\xf0\xc8\x85\xd3\xbb\x86\x97Z\xe0Q\xed\xc5\x8e\x8fr8i\x01\x91\xfc@&Q\x89\tO<\xe8n\xd2\x96\x1bG_\x07\xd0\x17\x90=\x1ck?\xff\xf9\x93\xef\x18\x9f\xe1\xbb\xed\n\xd9\x86|\x95\t\xc2\x13\x0c\xff\xfd\x06\xcf\xf2\xdb+\x18=\x89+$\xfc\x00a\xb5\xed\xb6\xe4\x93\xb2\xd0i@I\xc7\xad?\xc9\x10\xc8L\x17;\x94\t\xe8\x9cEpx\xa0B\xd7\xb9\xebCQ\x9a\xbc/7\xdb5\x9d@\xdf2\xbc\xaf+\xe0p\xc3\xfa\xfc\xafpv\x00R\xf4\x06L\x05\x9c\xa8\xb0 W@\x1am\xb9\xb8\x10l\xf1\xd3\x00\x00\xa0y`Ie3\xec\x01\x07\x0c\x04_\xca\x1d\x8c\x91\x85\xbb\xd8\x08T\x90\xdap\xb4\x068\x90V\xd5V+81W\xb3rHO\xc7\x19\xf4\xb0(M#\x83\x05=b\x0c\x81\xf2\xa8\xbdkV\x02\x0fL\xbetO\xd4\tMF0\xc0\xbe\xfc\xd7`\x7f\xfc\xcfF\xbfL\xa2_\xfe\xf0/A\xff\xf8\x9f\x8d>\xe1\xd9E\xff\xf2_3\xfb_\xfe\xb3\xd1\xbfL\xcf\xfe\xe5\xbf\x86\xf4\xbf\xfcgc\x9f&\xfd\xd5\xbff\xf2\x7f\xf6\xcf\x9e\xfcU\xcf\xe4\x97\x1b\x10\xa6\x96n\x0c\xd7\xe5\xae\xcb\xd7\x0cb\xa7\xd0\xe0\xcc\x02\x80\xb7\x9b.CD\xf6\x0b\\\x7f\xb5\x99\xd0\xa1\x00\xa7' type(input) = <class 'bytes'> errors = strict type(errors) = <class 'str'> decoding_table = ☺☻♥♦ ♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂\u20ac\ufffe\u201aƒ\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\ufffe\u017d\ufffe\ufffe\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\ufffe\u017e\u0178 ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ type(decoding_table) = <class 'str'> ```
ML thread: https://groups.google.com/a/continuum.io/forum/#!topic/conda/vunpzKLGciI Reverting to 4.0.8 solved the problem for me. With a broken conda package in the repo it looks like another good use case for an exclude option as requested in #2410 since trying to update _anything_ will now attempt to update conda to 4.1. In the conda 4.0.9 and 4.1.1 to be released later tonight, there will be a new option to disable conda's aggressive self-update. ``` conda config --set auto_update_conda false ``` @dhirschfeld Is the stack trace triggered just from executing `conda list conda` on Windows? Yep On 16 Jun 2016 12:16 pm, "Kale Franz" [email protected] wrote: > @dhirschfeld https://github.com/dhirschfeld Is the stack trace > triggered just from executing conda list conda on Windows? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > https://github.com/conda/conda/issues/2700#issuecomment-226371253, or mute > the thread > https://github.com/notifications/unsubscribe/AA1xeyjpnLnPfmfk-fgtq-ldtsNPPSILks5qMLHugaJpZM4I243A > . Seeing similar/same problem on OS X: ``` Current conda install: platform : osx-64 conda version : 4.1.0 conda-build version : 0+unknown python version : 3.4.4.final.0 requests version : 2.7.0 root environment : /Users/bryan/anaconda (writable) default environment : /Users/bryan/anaconda envs directories : /Users/bryan/anaconda/envs package cache : /Users/bryan/anaconda/pkgs channel URLs : https://conda.anaconda.org/bokeh/osx-64/ https://conda.anaconda.org/bokeh/noarch/ https://conda.anaconda.org/javascript/osx-64/ https://conda.anaconda.org/javascript/noarch/ https://repo.continuum.io/pkgs/free/osx-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/osx-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /Users/bryan/.condarc is foreign system : False ``` @ilanschnell ``` File "C:\Python\lib\site-packages\conda\egg_info.py", line 49, in parse_egg_info ``` Looks like something blowing up in that new module. Also: ``` $ conda list # packages in environment at /Users/bryan/anaconda: # An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/Users/bryan/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/cli/main.py", line 120, in main args_func(args, p) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/cli/main.py", line 127, in args_func args.func(args, p) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/cli/main_list.py", line 268, in execute show_channel_urls=args.show_channel_urls) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/cli/main_list.py", line 178, in print_packages installed.update(get_egg_info(prefix)) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/egg_info.py", line 82, in get_egg_info dist = parse_egg_info(path) File "/Users/bryan/anaconda/lib/python3.4/site-packages/conda/egg_info.py", line 49, in parse_egg_info for line in open(path): File "/Users/bryan/anaconda/lib/python3.4/codecs.py", line 319, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x95 in position 10: invalid start byte ``` Yes, the `UnicodeDecodeError` in the new `conda.egg_info` module I wrote needs to be handled. This can happen when people have strange `.egg-info` files installed. @bryevdv What's the output of ``` spdir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ls -al $spdir/*.egg* ``` And actually, the _contents_ of any "strange" looking .egg-info files... https://gist.github.com/bryevdv/4fd48871569b2a42b04d0f5e75358e99 Thanks Bryan think I have everything I need now.
2016-06-16T03:57:16
conda/conda
2,708
conda__conda-2708
[ "2688" ]
6690517d591a9a3fa6b8d4b2a53b1f1f7e94a039
diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -297,6 +297,8 @@ def url_channel(url): return None, '<unknown>' channel = url.rsplit('/', 2)[0] schannel = canonical_channel_name(channel) + if url.startswith('file://') and schannel != 'local': + channel = schannel = url.rsplit('/', 1)[0] return channel, schannel # ----- allowed channels ----- diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -76,12 +76,17 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None, prefix = '' if schannel == 'defaults' else schannel + '::' fn = prefix + fn dist = fn[:-8] + is_file = fn.startswith('file://') + # Add file to index so we'll see it later + if is_file: + index[fn] = {'fn': dist2filename(fn), 'url': url, 'md5': None} pkg_path = is_fetched(dist) dir_path = is_extracted(dist) # Don't re-fetch unless there is an MD5 mismatch - if pkg_path and (md5 and md5_file(pkg_path) != md5): + # Also remove explicit tarballs from cache + if pkg_path and (is_file or md5 and md5_file(pkg_path) != md5): # This removes any extracted copies as well actions[RM_FETCHED].append(dist) pkg_path = dir_path = None @@ -96,10 +101,11 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None, _, conflict = find_new_location(dist) if conflict: actions[RM_FETCHED].append(conflict) - if fn not in index or index[fn].get('not_fetched'): - channels[url_p + '/'] = (schannel, 0) + if not is_file: + if fn not in index or index[fn].get('not_fetched'): + channels[url_p + '/'] = (schannel, 0) + verifies.append((dist + '.tar.bz2', md5)) actions[FETCH].append(dist) - verifies.append((dist + '.tar.bz2', md5)) actions[EXTRACT].append(dist) # unlink any installed package with that name
Conda install from file fails in version 4.1 I've recently installed linux-32 conda on CentOS 6.2. I confirmed this on linux-64 version as well. If I run: `conda install ./FILE_1.tar.bz2`, I always get the error: `Fetching package metadata ...Error: Could not find URL: file:///root/dir1/ ` If i downgrade to conda 4.0.8, it works fine. Here's the command with the added `--debug` option: ``` $ conda --debug install ./FILE_1.tar.bz2 DEBUG:conda.fetch:channel_urls={'file:///root/dir1/': ('file:///root', 0)} Fetching package metadata ...INFO:stdoutlog:Fetching package metadata ... DEBUG:requests.packages.urllib3.util.retry:Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None) DEBUG:conda.fetch:Could not find URL: file:///root/dir1/ Error: Could not find URL: file:///root/dir1/ ```
relates to #2642, but not exactly the same I'll take this
2016-06-16T04:26:42
conda/conda
2,715
conda__conda-2715
[ "2710" ]
7d64a5c361f290e1c76a37a66cb39bdbd1ffe1f0
diff --git a/conda/plan.py b/conda/plan.py --- a/conda/plan.py +++ b/conda/plan.py @@ -330,7 +330,7 @@ def ensure_linked_actions(dists, prefix, index=None, force=False, actions[inst.LINK].append('%s %d %s' % (dist, lt, shortcuts)) except (OSError, IOError): - actions[inst.LINK].append(dist, LINK_COPY, shortcuts) + actions[inst.LINK].append('%s %d %s' % (dist, LINK_COPY, shortcuts)) finally: if not extracted_in: # Remove the dummy data
TypeError resulting from conda create I've just installed anaconda2 on a CentOS 6.8 instance. Now I'm trying to create a new conda environment but am receiving this error: ``` [ebrown@AWS-SYD-AL-T2MIC-SWM-P-ANACONDA01 ~]$ conda create --name testenv python Fetching package metadata ....... Solving package specifications ............. An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main args_func(args, p) File "/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 127, in args_func args.func(args, p) File "/anaconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 57, in execute install(args, parser, 'create') File "/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 315, in install shortcuts=shortcuts) File "/anaconda/lib/python2.7/site-packages/conda/plan.py", line 461, in install_actions shortcuts=shortcuts) File "/anaconda/lib/python2.7/site-packages/conda/plan.py", line 333, in ensure_linked_actions actions[inst.LINK].append(dist, LINK_COPY, shortcuts) TypeError: append() takes exactly one argument (3 given) ``` Here is my conda info: ``` [ebrown@AWS-SYD-AL-T2MIC-SWM-P-ANACONDA01 ~]$ conda info Current conda install: platform : linux-64 conda version : 4.1.0 conda-build version : 1.20.0 python version : 2.7.11.final.0 requests version : 2.9.1 root environment : /anaconda (writable) default environment : /anaconda envs directories : /anaconda/envs package cache : /anaconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None is foreign system : False ``` I'm at a loss as to why this is happening, can anyone help? Thanks
https://github.com/conda/conda/blob/master/conda/plan.py#L330-L333 Line 333 should mimic the structure of line 330. ahhh, switching assignment :) Somebody needs to write a bot for github: feed bot stacktrace, assign bug to last person to touch line that triggered stack trace. At some point it'll make sense to add [mention-bot](https://github.com/facebook/mention-bot) to conda. No need to reassign, @msarahan, I've got this.
2016-06-16T14:18:30
conda/conda
2,729
conda__conda-2729
[ "2642" ]
07e517865bbb98e333a0ba0d217fc5f60c444aeb
diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -195,7 +195,9 @@ def get_rc_urls(): return rc['channels'] def is_url(url): - return url and urlparse.urlparse(url).scheme != "" + if url: + p = urlparse.urlparse(url) + return p.netloc != "" or p.scheme == "file" def binstar_channel_alias(channel_alias): if channel_alias.startswith('file:/'):
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -5,7 +5,7 @@ from glob import glob import json from logging import getLogger, Handler -from os.path import exists, isdir, isfile, join, relpath +from os.path import exists, isdir, isfile, join, relpath, basename import os from shlex import split from shutil import rmtree, copyfile @@ -24,7 +24,7 @@ from conda.cli.main_remove import configure_parser as remove_configure_parser from conda.cli.main_update import configure_parser as update_configure_parser from conda.config import pkgs_dirs, bits -from conda.install import linked as install_linked, linked_data_ +from conda.install import linked as install_linked, linked_data_, dist2dirname from conda.install import on_win from conda.compat import PY3, TemporaryDirectory @@ -63,37 +63,18 @@ def reenable_dotlog(handlers): dotlogger.handlers = handlers -@contextmanager -def make_temp_env(*packages): - prefix = make_temp_prefix() - try: - # try to clear any config that's been set by other tests - config.rc = config.load_condarc('') - - p = conda_argparse.ArgumentParser() - sub_parsers = p.add_subparsers(metavar='command', dest='cmd') - create_configure_parser(sub_parsers) - - command = "create -y -q -p {0} {1}".format(escape_for_winpath(prefix), " ".join(packages)) - - args = p.parse_args(split(command)) - args.func(args, p) - - yield prefix - finally: - rmtree(prefix, ignore_errors=True) - - class Commands: INSTALL = "install" UPDATE = "update" REMOVE = "remove" + CREATE = "create" parser_config = { Commands.INSTALL: install_configure_parser, Commands.UPDATE: update_configure_parser, Commands.REMOVE: remove_configure_parser, + Commands.CREATE: create_configure_parser, } @@ -102,23 +83,38 @@ def run_command(command, prefix, *arguments): sub_parsers = p.add_subparsers(metavar='command', dest='cmd') parser_config[command](sub_parsers) - command = "{0} -y -q -p {1} {2}".format(command, - escape_for_winpath(prefix), - " ".join(arguments)) + prefix = escape_for_winpath(prefix) + arguments = list(map(escape_for_winpath, arguments)) + command = "{0} -y -q -p {1} {2}".format(command, prefix, " ".join(arguments)) args = p.parse_args(split(command)) args.func(args, p) +@contextmanager +def make_temp_env(*packages): + prefix = make_temp_prefix() + try: + # try to clear any config that's been set by other tests + config.rc = config.load_condarc('') + run_command(Commands.CREATE, prefix, *packages) + yield prefix + finally: + rmtree(prefix, ignore_errors=True) + + def package_is_installed(prefix, package, exact=False): + packages = list(install_linked(prefix)) + if '::' not in package: + packages = list(map(dist2dirname, packages)) if exact: - return any(p == package for p in install_linked(prefix)) - return any(p.startswith(package) for p in install_linked(prefix)) + return package in packages + return any(p.startswith(package) for p in packages) def assert_package_is_installed(prefix, package, exact=False): if not package_is_installed(prefix, package, exact): - print([p for p in install_linked(prefix)]) + print(list(install_linked(prefix))) raise AssertionError("package {0} is not in prefix".format(package)) @@ -147,29 +143,29 @@ def test_create_install_update_remove(self): assert not package_is_installed(prefix, 'flask-0.') assert_package_is_installed(prefix, 'python-3') - @pytest.mark.skipif(on_win, reason="windows tarball is broken still") @pytest.mark.timeout(300) def test_tarball_install_and_bad_metadata(self): with make_temp_env("python flask=0.10.1") as prefix: - assert_package_is_installed(prefix, 'flask-0.') + assert_package_is_installed(prefix, 'flask-0.10.1') run_command(Commands.REMOVE, prefix, 'flask') - assert not package_is_installed(prefix, 'flask-0.') + assert not package_is_installed(prefix, 'flask-0.10.1') assert_package_is_installed(prefix, 'python') # regression test for #2626 # install tarball with full path flask_tar_file = glob(join(pkgs_dirs[0], 'flask-0.*.tar.bz2'))[-1] - if not on_win: - run_command(Commands.INSTALL, prefix, flask_tar_file) - assert_package_is_installed(prefix, 'flask-0.') + tar_new_path = join(prefix, basename(flask_tar_file)) + copyfile(flask_tar_file, tar_new_path) + run_command(Commands.INSTALL, prefix, tar_new_path) + assert_package_is_installed(prefix, 'flask-0') - run_command(Commands.REMOVE, prefix, 'flask') - assert not package_is_installed(prefix, 'flask-0.') + run_command(Commands.REMOVE, prefix, 'flask') + assert not package_is_installed(prefix, 'flask-0') # regression test for #2626 # install tarball with relative path - flask_tar_file = relpath(flask_tar_file) - run_command(Commands.INSTALL, prefix, flask_tar_file) + tar_new_path = relpath(tar_new_path) + run_command(Commands.INSTALL, prefix, tar_new_path) assert_package_is_installed(prefix, 'flask-0.') # regression test for #2599
tarball install windows @msarahan @mingwandroid What _should_ the `file://` url format be on Windows? ``` ________________________ IntegrationTests.test_python3 ________________________ Traceback (most recent call last): File "C:\projects\conda\tests\test_create.py", line 146, in test_python3 run_command(Commands.INSTALL, prefix, flask_tar_file) File "C:\projects\conda\tests\test_create.py", line 104, in run_command args.func(args, p) File "C:\projects\conda\conda\cli\main_install.py", line 62, in execute install(args, parser, 'install') File "C:\projects\conda\conda\cli\install.py", line 195, in install explicit(args.packages, prefix, verbose=not args.quiet) File "C:\projects\conda\conda\misc.py", line 111, in explicit index.update(fetch_index(channels, **fetch_args)) File "C:\projects\conda\conda\fetch.py", line 266, in fetch_index for url in iterkeys(channel_urls)] File "C:\projects\conda\conda\fetch.py", line 67, in func res = f(*args, **kwargs) File "C:\projects\conda\conda\fetch.py", line 149, in fetch_repodata raise RuntimeError(msg) RuntimeError: Could not find URL: file:///C|/projects/conda/ ---------------------------- Captured stdout call ----------------------------- ``` The relevant lines to look at here are line 64 in `conda/misc.py` ``` url_p = utils_url_path(url_p).rstrip('/') ``` and line 147 in `conda/utils.py` ``` def url_path(path): path = abspath(path) if sys.platform == 'win32': path = '/' + path.replace(':', '|').replace('\\', '/') return 'file://%s' % path ``` Help here is definitely appreciated.
Maybe this might be useful. https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/ Python's (3.4+) pathlib module might give a hint ``` In [1]: import pathlib In [2]: pathlib.Path(r"C:\projects\conda").as_uri() Out[2]: 'file:///C:/projects/conda' ``` I'm unable to reproduce this, however maybe the code that interprets the file uri might also be relevant. This would include conda's `LocalFSAdapter()` in connection.py (https://github.com/conda/conda/blob/231e9db898b3d7720b49e9e2050a88be6978fd38/conda/connection.py#L205-L235) which makes a call to `url_to_path()` (https://github.com/conda/conda/blob/231e9db898b3d7720b49e9e2050a88be6978fd38/conda/connection.py#L238-L251). These functions seem to interpret conda's `file:///C|/projects/conda/` format correctly. One final observation: line 64 in `misc.py` strips the rightmost `/`, yet the uri in the error message seems to still have one. Is that supposed to be happening? Hi @groutr. thanks for looking at this and good to see you again! @kalefranz yeah, you need to keep the : @mingwandroid no problem. I hope to keep active here as time permits.
2016-06-16T20:23:12
conda/conda
2,734
conda__conda-2734
[ "2732" ]
3c6a9b5827f255735993c433488429e5781d4658
diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -13,7 +13,7 @@ from ..compat import string_types from ..config import (rc_bool_keys, rc_string_keys, rc_list_keys, sys_rc_path, user_rc_path, rc_other) -from ..utils import yaml_load, yaml_dump +from ..utils import yaml_load, yaml_dump, yaml_bool descr = """ Modify configuration values in .condarc. This is modeled after the git @@ -289,14 +289,14 @@ def execute_config(args, parser): set_bools, set_strings = set(rc_bool_keys), set(rc_string_keys) for key, item in args.set: # Check key and value - yamlitem = yaml_load(item) if key in set_bools: - if not isinstance(yamlitem, bool): + itemb = yaml_bool(item) + if itemb is None: error_and_exit("Key: %s; %s is not a YAML boolean." % (key, item), json=args.json, error_type="TypeError") - rc_config[key] = yamlitem + rc_config[key] = itemb elif key in set_strings: - rc_config[key] = yamlitem + rc_config[key] = item else: error_and_exit("Error key must be one of %s, not %s" % (', '.join(set_bools | set_strings), key), json=args.json, diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -22,7 +22,7 @@ from . import __version__ as VERSION from .compat import urlparse, StringIO from .config import platform as config_platform, ssl_verify, get_proxy_servers -from .utils import gnu_get_libc_version +from .utils import gnu_get_libc_version, yaml_bool RETRIES = 3 @@ -110,7 +110,7 @@ def __init__(self, *args, **kwargs): self.headers['User-Agent'] = user_agent - self.verify = ssl_verify + self.verify = yaml_bool(ssl_verify, ssl_verify) class NullAuth(requests.auth.AuthBase): diff --git a/conda/utils.py b/conda/utils.py --- a/conda/utils.py +++ b/conda/utils.py @@ -292,6 +292,20 @@ def get_yaml(): return yaml +# Restores YAML 1.1 boolean flexibility. +yaml_bool_ = { + 'true': True, 'yes': True, 'on': True, + 'false': False, 'no': False, 'off': False +} +def yaml_bool(s, passthrough=None): + if type(s) is bool: + return s + try: + return yaml_bool_.get(s.lower(), passthrough) + except AttributeError: + return passthrough + + def yaml_load(filehandle): yaml = get_yaml() try:
diff --git a/tests/test_config.py b/tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -12,7 +12,7 @@ import pytest import conda.config as config -from conda.utils import get_yaml +from conda.utils import get_yaml, yaml_bool from tests.helpers import run_conda_command @@ -441,20 +441,17 @@ def test_invalid_rc(): def test_config_set(): # Test the config set command - # Make sure it accepts only boolean values for boolean keys and any value for string keys + # Make sure it accepts any YAML 1.1 boolean values + assert yaml_bool(True) is True + assert yaml_bool(False) is False + for str in ('yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'off', 'Off', 'OFF', 'no', 'No', 'NO'): + with make_temp_condarc() as rc: + stdout, stderr = run_conda_command('config', '--file', rc, + '--set', 'always_yes', str) + assert stdout == '' + assert stderr == '' - with make_temp_condarc() as rc: - stdout, stderr = run_conda_command('config', '--file', rc, - '--set', 'always_yes', 'yes') - - assert stdout == '' - assert stderr == 'Error: Key: always_yes; yes is not a YAML boolean.' - - stdout, stderr = run_conda_command('config', '--file', rc, - '--set', 'always_yes', 'no') - - assert stdout == '' - assert stderr == 'Error: Key: always_yes; no is not a YAML boolean.' def test_set_rc_string(): # Test setting string keys in .condarc
conda config --set show_channel_urls yes doesn't work anymore This is happening since the latest conda update: ``` bat λ conda config --set show_channel_urls yes Error: Key: show_channel_urls; yes is not a YAML boolean. ``` It happens with both conda 4.1.1 (local windows py 3.5) and 4.1.0 (appveyor, https://ci.appveyor.com/project/mdboom/matplotlib/build/1.0.1774) and it worked with 4.0.8 (https://ci.appveyor.com/project/mdboom/matplotlib/build/1.0.1765/job/bkldg98f8p087xmf)
This one is CC @mcg1969 I didn't mess with the section of code. I don't mind fixing it, don't get me wrong, but I am guessing that this is a difference between our old YAML library and our new one Try using true/false instead of yes/no... @msarahan? Ahhhh, interesting. I thought I had tested for that. But we can change the ruamel_yaml version back to using yaml 1.1 (if it isn't already), and then yes/no should work for yaml booleans. On Thu, Jun 16, 2016 at 5:33 PM, Michael C. Grant [email protected] wrote: > Try using true/false instead of yes/no... @msarahan > https://github.com/msarahan? > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > https://github.com/conda/conda/issues/2732#issuecomment-226633230, or mute > the thread > https://github.com/notifications/unsubscribe/ABWks12m0vAh-7R3sO7oVkpihlF1YwIhks5qMc8tgaJpZM4I33Ze > . ## _Kale J. Franz, PhD_ _Conda Tech Lead_ [email protected] [email protected]_ _@kalefranz https://twitter.com/kalefranz_ http://continuum.io/ http://continuum.io/ http://continuum.io/ 221 W 6th St | Suite 1550 | Austin, TX 78701 I think the ship is sailed on the new library. I think we have to work around it Looks like YAML 1.2 drops Yes/No and On/Off support: http://yaml.readthedocs.io/en/latest/pyyaml.html Good news, we can fix Changing `version="1.2"` to `version="1.1"` on line 298 of `utils.py` restores this behavior. I'm concerned we may be breaking other things though by doing this, so my inclination is to create a `yaml_bool` function to wrap around the output of `yaml.load` in cases like this. Even better: drop the use of `yaml.load` to parse the boolean strings in `cli/main_config.py` in the first place.
2016-06-16T23:29:56
conda/conda
2,736
conda__conda-2736
[ "2725", "2677" ]
111d718b4433f49c083cf901a019c03a180cc54d
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -90,8 +90,6 @@ def __init__(self, *args, **kwargs): proxies = get_proxy_servers() if proxies: self.proxies = proxies - self.auth = NullAuth() # disable .netrc file. for reference, see - # https://github.com/Anaconda-Platform/anaconda-client/pull/298 # Configure retries if retries: @@ -112,22 +110,6 @@ def __init__(self, *args, **kwargs): self.verify = ssl_verify - -class NullAuth(requests.auth.AuthBase): - '''force requests to ignore the ``.netrc`` - Some sites do not support regular authentication, but we still - want to store credentials in the ``.netrc`` file and submit them - as form elements. Without this, requests would otherwise use the - .netrc which leads, on some sites, to a 401 error. - https://github.com/kennethreitz/requests/issues/2773 - Use with:: - requests.get(url, auth=NullAuth()) - ''' - - def __call__(self, r): - return r - - class S3Adapter(requests.adapters.BaseAdapter): def __init__(self):
Basic access authentification channels broken in 4.1.0 Previously it was possible to have a channel like: https://user:[email protected] or even have the user and password saved in `.netrc`. conda 4.1.0 and up ignore the credentials and give a 401 error (causing everything to break for users). ``` $ conda install conda=4.1.0 Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata ...........Error: HTTPError: 401 Client Error: Unauthorized for url:https://user:[email protected] ``` conda=4.1 no longer respects HTTP_PROXY My proxy variables are properly set: ``` $ set https_proxy HTTPS_PROXY=http://myproxy:8080 ``` `conda=4.0.8` successfully picks up my `%HTTPS_PROXY%` and installs `conda=4.1`: ``` $ conda install conda=4.1 Fetching package metadata: .......... Solving package specifications: ......... The following packages will be UPDATED: conda: 4.0.8-py27_0 defaults --> 4.1.0-py27_0 defaults ``` now trying to revert back to `conda=4.0`: ``` $ conda install conda=4.0 Fetching package metadata ......... Could not connect to https://repo.continuum.io/pkgs/free/win-64/ Connection error: HTTPSConnectionPool(host='repo.continuum.io', port=443): Max retries exceeded with url... ``` proxy settings no longer work. Configuring `proxy_servers` in `.condarc` restores connectivity.
See this PR that is in 4.1.1. https://github.com/conda/conda/pull/2695 We disabled the requests library's use of .netrc. You can set `proxy_servers` in .condarc if you want. Besides reverting back to sucking up .netrc by default, how can we make things work best with your setup? > On Jun 16, 2016, at 2:41 PM, Zaharid [email protected] wrote: > > Previously it was possible to have a channel like: > > https://user:[email protected] > > or even have the user and password saved in .netrc. conda 4.1.0 and up ignore the credentials and give a 401 error (causing everything to break for users). > > $ conda install conda=4.1.0 > Using Anaconda Cloud api site https://api.anaconda.org > Fetching package metadata ...........Error: HTTPError: 401 Client Error: Unauthorized for url:https://user:[email protected] > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or mute the thread. There is 4.1.0 that disables `.netrc`, but there is something else in 4.1.1 that furthermore disables urls with user and password explicitly in the channel urls (which I don't like very much anyway because the credentials appear in all the logs). Thinks that could be good for me are: - Explicit support for basic auth in condarc (since it isn't in .netrc). - Support for client SSL certificates (which I believe is easy with requests). Thanks. > Explicit support for basic auth in condarc I'll add this tonight or tomorrow. Will be in 4.1.2. > Support for client SSL certificates (which I believe is easy with requests). Already done. ``` conda config --set ssl_verify PATH_TO_CERT_BUNDLE ``` The `ssl_verify` parameter is fed directly to requests. Can either be boolean True/False to verify ssl, or a string with a cert bundle path to verify against. Can also confirm this. Unfortunately it's not possible to specify no_proxy in the .condarc, so 4.1 is not working if you have a proxy and internal channels. Thanks for the report, folks; I'm sorry for the trouble here. I'm unfamiliar with the proxy handling code so we'll have to find someone here better equipped. As far as I can tell we've never explicitly checked HTTP_PROXY so I'm guessing that it's caused by `requests` (not blaming that module per se, just saying that we must have changed the way we are using it.) @kalefranz @msarahan any ideas? Something like this changed in Conda-build - not sure if it is instructive: https://github.com/conda/conda-build/pull/989 This seems to be a problem with the newer version of requests in conda 4.1.0. With an HTTPS_PROXY environment variable set: Using requests 2.9.0: ``` In [1]: import requests In [2]: requests.get('https://repo.continuum.io/pkgs/free/win-64', timeout=1, verify=False) C:\Miniconda2_2\lib\site-packages\requests\packages\urllib3\connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Out [2]: <Response [407]> ``` Using requests 2.10.0 ``` In [1]: import requests In [2]: requests.get('https://repo.continuum.io/pkgs/free/win-64', timeout=1, verify=False) requests\packages\urllib3\connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) <.............. times out> ``` The 407 response 'proxy authentication required' might be another clue I guess. Ah, so I'm not the only one. I created this ticket because I experienced the same thing: https://github.com/conda/conda/issues/2671. This current ticket is more eloquent than mine, so perhaps 2671 can be closed and this can take it's place? I have experienced the same thing. .condarc works, but env var HTTP_PROXY is not taken into account. conda 4.0.8 was fine in this regard. I'm looking into this now. Probably the last bug to fix for today's 4.1.1 release. Pretty sure this happened when I disabled `~/.netrc` files from requests. PR https://github.com/conda/conda/pull/2514 in response to issue https://github.com/conda/conda/issues/2161. The thread here for requests is relevant: https://github.com/kennethreitz/requests/issues/2773 Looks like I should have followed more closely @dsludwig's fix here: https://github.com/Anaconda-Platform/anaconda-client/pull/298
2016-06-17T01:18:05
conda/conda
2,772
conda__conda-2772
[ "2771", "2771" ]
c6fe8c805dc2148eac52aa32591d0fd5a38a91be
diff --git a/conda/plan.py b/conda/plan.py --- a/conda/plan.py +++ b/conda/plan.py @@ -442,6 +442,7 @@ def install_actions(prefix, index, specs, force=False, only_names=None, always_c if auto_update_conda and is_root_prefix(prefix): specs.append('conda') + specs.append('conda-env') if pinned: pinned_specs = get_pinned_specs(prefix)
conda update conda doesn't get latest conda-env It's annoying we even have this problem, but... ``` root@default:~ # conda update conda Fetching package metadata: ...... .Solving package specifications: ......... Package plan for installation in environment /usr/local: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.5.0 | py27_0 28 KB conda-4.1.2 | py27_0 198 KB ------------------------------------------------------------ Total: 226 KB The following NEW packages will be INSTALLED: ruamel_yaml: 0.11.7-py27_0 The following packages will be UPDATED: conda: 4.0.5-py27_0 --> 4.1.2-py27_0 conda-env: 2.4.5-py27_0 --> 2.5.0-py27_0 Proceed ([y]/n)? y Fetching packages ... conda-env-2.5. 100% |#########################################################################################| Time: 0:00:00 587.12 kB/s conda-4.1.2-py 100% |#########################################################################################| Time: 0:00:00 994.90 kB/s Extracting packages ... [ COMPLETE ]|############################################################################################################| 100% Unlinking packages ... [ COMPLETE ]|############################################################################################################| 100% Linking packages ... [ COMPLETE ]|############################################################################################################| 100% root@default:~ # conda update conda-env Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment /usr/local: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.5.1 | py27_0 26 KB The following packages will be UPDATED: conda-env: 2.5.0-py27_0 --> 2.5.1-py27_0 Proceed ([y]/n)? y Fetching packages ... conda-env-2.5. 100% |#########################################################################################| Time: 0:00:00 569.65 kB/s Extracting packages ... [ COMPLETE ]|############################################################################################################| 100% Unlinking packages ... [ COMPLETE ]|############################################################################################################| 100% Linking packages ... [ COMPLETE ]|############################################################################################################| 100% ``` conda update conda doesn't get latest conda-env It's annoying we even have this problem, but... ``` root@default:~ # conda update conda Fetching package metadata: ...... .Solving package specifications: ......... Package plan for installation in environment /usr/local: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.5.0 | py27_0 28 KB conda-4.1.2 | py27_0 198 KB ------------------------------------------------------------ Total: 226 KB The following NEW packages will be INSTALLED: ruamel_yaml: 0.11.7-py27_0 The following packages will be UPDATED: conda: 4.0.5-py27_0 --> 4.1.2-py27_0 conda-env: 2.4.5-py27_0 --> 2.5.0-py27_0 Proceed ([y]/n)? y Fetching packages ... conda-env-2.5. 100% |#########################################################################################| Time: 0:00:00 587.12 kB/s conda-4.1.2-py 100% |#########################################################################################| Time: 0:00:00 994.90 kB/s Extracting packages ... [ COMPLETE ]|############################################################################################################| 100% Unlinking packages ... [ COMPLETE ]|############################################################################################################| 100% Linking packages ... [ COMPLETE ]|############################################################################################################| 100% root@default:~ # conda update conda-env Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment /usr/local: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.5.1 | py27_0 26 KB The following packages will be UPDATED: conda-env: 2.5.0-py27_0 --> 2.5.1-py27_0 Proceed ([y]/n)? y Fetching packages ... conda-env-2.5. 100% |#########################################################################################| Time: 0:00:00 569.65 kB/s Extracting packages ... [ COMPLETE ]|############################################################################################################| 100% Unlinking packages ... [ COMPLETE ]|############################################################################################################| 100% Linking packages ... [ COMPLETE ]|############################################################################################################| 100% ```
2016-06-20T03:26:06
conda/conda
2,806
conda__conda-2806
[ "2765" ]
a10456ed13e37a498ae3db4a03b90988e79ff143
diff --git a/conda/cli/activate.py b/conda/cli/activate.py --- a/conda/cli/activate.py +++ b/conda/cli/activate.py @@ -119,14 +119,11 @@ def main(): shelldict = shells[shell] if sys.argv[1] == '..activate': path = get_path(shelldict) - if len(sys.argv) == 3 or sys.argv[3].lower() == root_env_name.lower(): - binpath = binpath_from_arg(root_env_name, shelldict=shelldict) - rootpath = None - elif len(sys.argv) == 4: + if len(sys.argv) == 4: binpath = binpath_from_arg(sys.argv[3], shelldict=shelldict) rootpath = binpath_from_arg(root_env_name, shelldict=shelldict) else: - sys.exit("Error: did not expect more than one argument") + sys.exit("Error: ..activate expected exactly two arguments: shell and env name") pathlist_str = pathlist_to_str(binpath) sys.stderr.write("prepending %s to PATH\n" % shelldict['path_to'](pathlist_str)) @@ -142,7 +139,7 @@ def main(): elif sys.argv[1] == '..checkenv': if len(sys.argv) < 4: - sys.argv.append(root_env_name) + sys.exit("Invalid arguments to checkenv. Need shell and env name/path") if len(sys.argv) > 4: sys.exit("Error: did not expect more than one argument.") if sys.argv[3].lower() == root_env_name.lower():
source activate without arguments breaks source activate/deactivate commands Running `source activate` without any further arguments on Linux with the latest release makes it so that further activate/deactivate commands do not work. For example: ``` ihenriksen@ubuntu:~$ source activate prepending /home/ihenriksen/miniconda2/envs/bin to PATH ihenriksen@ubuntu:~$ source activate py27 bash: activate: No such file or directory ihenriksen@ubuntu:~$ source deactivate bash: deactivate: No such file or directory ihenriksen@ubuntu:~$ ``` This isn't at all a blocking issue for me, but it seems like something worth revisiting when we can.
Pretty sure it is getting an empty string, then considering that a valid env, somehow. ugh. Thanks for reporting.
2016-06-22T14:10:00
conda/conda
2,821
conda__conda-2821
[ "2807" ]
dcc70e413ee3e0875ce5889c57206a13747bf990
diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -69,18 +69,9 @@ def func(*args, **kwargs): return res return func + @dotlog_on_return("fetching repodata:") def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): - if not ssl_verify: - try: - from requests.packages.urllib3.connectionpool import InsecureRequestWarning - except ImportError: - pass - else: - warnings.simplefilter('ignore', InsecureRequestWarning) - - session = session or CondaSession() - cache_path = join(cache_dir or create_cache_dir(), cache_fn_url(url)) try: with open(cache_path) as f: @@ -91,31 +82,50 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): if use_cache: return cache + if not ssl_verify: + try: + from requests.packages.urllib3.connectionpool import InsecureRequestWarning + except ImportError: + pass + else: + warnings.simplefilter('ignore', InsecureRequestWarning) + + session = session or CondaSession() + headers = {} if "_etag" in cache: headers["If-None-Match"] = cache["_etag"] if "_mod" in cache: headers["If-Modified-Since"] = cache["_mod"] + if 'repo.continuum.io' in url: + filename = 'repodata.json.bz2' + else: + headers['Accept-Encoding'] = 'gzip, deflate, compress, identity' + headers['Content-Type'] = 'application/json' + filename = 'repodata.json' + try: - resp = session.get(url + 'repodata.json.bz2', - headers=headers, proxies=session.proxies) + resp = session.get(url + filename, headers=headers, proxies=session.proxies) resp.raise_for_status() if resp.status_code != 304: - cache = json.loads(bz2.decompress(resp.content).decode('utf-8')) + if filename.endswith('.bz2'): + json_str = bz2.decompress(resp.content).decode('utf-8') + else: + json_str = resp.content.decode('utf-8') + cache = json.loads(json_str) add_http_value_to_dict(resp, 'Etag', cache, '_etag') add_http_value_to_dict(resp, 'Last-Modified', cache, '_mod') except ValueError as e: - raise RuntimeError("Invalid index file: %srepodata.json.bz2: %s" % - (remove_binstar_tokens(url), e)) + raise RuntimeError("Invalid index file: {0}{1}: {2}" + .format(remove_binstar_tokens(url), filename, e)) except requests.exceptions.HTTPError as e: if e.response.status_code == 407: # Proxy Authentication Required handle_proxy_407(url, session) # Try again - return fetch_repodata(url, cache_dir=cache_dir, - use_cache=use_cache, session=session) + return fetch_repodata(url, cache_dir=cache_dir, use_cache=use_cache, session=session) if e.response.status_code == 404: if url.startswith(DEFAULT_CHANNEL_ALIAS): @@ -161,8 +171,7 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): if "407" in str(e): # Proxy Authentication Required handle_proxy_407(url, session) # Try again - return fetch_repodata(url, cache_dir=cache_dir, - use_cache=use_cache, session=session) + return fetch_repodata(url, cache_dir=cache_dir, use_cache=use_cache, session=session) msg = "Connection error: %s: %s\n" % (e, remove_binstar_tokens(url)) stderrlog.info('Could not connect to %s\n' % remove_binstar_tokens(url))
Consider allowing for conda compression that uses deflate rather than bzip2
related #2794 FYI @msarahan
2016-06-22T23:50:46
conda/conda
2,862
conda__conda-2862
[ "2845" ]
b332659482ea5e3b3596dbe89f338f9a7e750d30
diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -98,7 +98,7 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): if "_mod" in cache: headers["If-Modified-Since"] = cache["_mod"] - if 'repo.continuum.io' in url: + if 'repo.continuum.io' in url or url.startswith("file://"): filename = 'repodata.json.bz2' else: headers['Accept-Encoding'] = 'gzip, deflate, compress, identity'
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -260,8 +260,8 @@ def test_tarball_install_and_bad_metadata(self): os.makedirs(subchan) tar_new_path = join(subchan, flask_fname) copyfile(tar_old_path, tar_new_path) - with open(join(subchan, 'repodata.json'), 'w') as f: - f.write(json.dumps(repodata)) + with bz2.BZ2File(join(subchan, 'repodata.json.bz2'), 'w') as f: + f.write(json.dumps(repodata).encode('utf-8')) run_command(Commands.INSTALL, prefix, '-c', channel, 'flask') assert_package_is_installed(prefix, channel + '::' + 'flask-')
file:// URLs don't work anymore with conda 4.1.3 Conda 4.1.3 does not work anymore with **file://** URLs: ``` (E:\Anaconda3) C:\Windows\system32>conda update --override-channels --channel file:///A:/pkgs/free --all Fetching package metadata ....Error: Could not find URL: file:///A:/pkgs/free/win-64/ ``` But `A:\pkgs\free\win-64` really exists: ``` (E:\Anaconda3) C:\Windows\system32>dir A:\pkgs\free\win-64 Volume in drive A is Software Volume Serial Number is 4546-3CD9 Directory of A:\pkgs\free\win-64 06/24/2016 12:31 AM <DIR> . 01/23/2016 06:27 PM <DIR> .. 06/24/2016 12:28 AM 259,605 repodata.json.bz2 07/07/2015 12:54 AM 85,764 argcomplete-0.9.0-py34_0.tar.bz2 ``` Before upgrading from 4.0.8-py35_0 everything worked fine. The same happened to the Linux version.
@mcg1969 I think I was going to write an integration test for this but obviously let it slip. ARGH! No, actually, we have integration tests for file URLs and for file-based channels. This is madness! :-( @ciupicri, I apologize. Hold on! @ciupicri, can you please create an _uncompressed_ `repodata.json` in that channel directory? (You do recall, do you not, @kalefranz, that you removed the `bzip2` support from my test...) :facepalm: > On Jun 23, 2016, at 7:09 PM, Michael C. Grant [email protected] wrote: > > (You do recall, do you not, @kalefranz, that you removed the bzip2 support from my test...) > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread. Looks like we need to refer to `bzip2` for file:// base URLs. Should be a simple fix, not quite one-character :-) @mcg1969, I've uncompresses the `repodata.json.bz2` that I had, and now conda fails at the next stage: ``` unicodecsv: 0.14.1-py35_0 --> 0.14.1-py35_0 file:///A:/pkgs/free vs2015_runtime: 14.00.23026.0-0 --> 14.00.23026.0-0 file:///A:/pkgs/free wheel: 0.29.0-py35_0 --> 0.29.0-py35_0 file:///A:/pkgs/free Proceed ([y]/n)? y DEBUG:conda.instructions: PREFIX('E:\\Anaconda3') DEBUG:conda.instructions: PRINT('Fetching packages ...') Fetching packages ... INFO:print:Fetching packages ... DEBUG:conda.instructions: FETCH('file:///A:/pkgs/free::libdynd-0.7.2-0') DEBUG:requests.packages.urllib3.util.retry:Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None) DEBUG:conda.fetch:url='file:///A:/pkgs/free/win-64/libdynd-0.7.2-0.tar.bz2' DEBUG:conda.fetch:HTTPError: 404 Client Error: None for url: file:///A:/pkgs/free/win-64/libdynd-0.7.2-0.tar.bz2: file:///A:/pkgs/free/win-64/libdynd-0.7.2-0.tar.bz2 Error: HTTPError: 404 Client Error: None for url: file:///A:/pkgs/free/win-64/libdynd-0.7.2-0.tar.bz2: file:///A:/pkgs/free/win-64/libdynd-0.7.2-0.tar.bz2 ``` `conda list` show that I already have libdynd-0.7.2.
2016-06-24T22:48:06
conda/conda
2,873
conda__conda-2873
[ "2754" ]
895d23dd3c5154b149bdc5f57b1c1e33b3afdd71
diff --git a/conda/egg_info.py b/conda/egg_info.py --- a/conda/egg_info.py +++ b/conda/egg_info.py @@ -29,14 +29,15 @@ def get_site_packages_dir(installed_pkgs): def get_egg_info_files(sp_dir): for fn in os.listdir(sp_dir): - if not fn.endswith(('.egg', '.egg-info')): + if not fn.endswith(('.egg', '.egg-info', '.dist-info')): continue path = join(sp_dir, fn) if isfile(path): yield path elif isdir(path): for path2 in [join(path, 'PKG-INFO'), - join(path, 'EGG-INFO', 'PKG-INFO')]: + join(path, 'EGG-INFO', 'PKG-INFO'), + join(path, 'METADATA')]: if isfile(path2): yield path2 @@ -54,7 +55,7 @@ def parse_egg_info(path): key = m.group(1).lower() info[key] = m.group(2) try: - return '%(name)s-%(version)s-<egg_info>' % info + return '%(name)s-%(version)s-<pip>' % info except KeyError: pass return None
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -230,11 +230,21 @@ def test_create_install_update_remove(self): @pytest.mark.timeout(300) def test_list_with_pip_egg(self): with make_temp_env("python=3 pip") as prefix: - check_call(PYTHON_BINARY + " -m pip install --egg --no-use-wheel flask==0.10.1", + check_call(PYTHON_BINARY + " -m pip install --egg --no-binary flask flask==0.10.1", cwd=prefix, shell=True) stdout, stderr = run_command(Commands.LIST, prefix) stdout_lines = stdout.split('\n') - assert any(line.endswith("<egg_info>") for line in stdout_lines + assert any(line.endswith("<pip>") for line in stdout_lines + if line.lower().startswith("flask")) + + @pytest.mark.timeout(300) + def test_list_with_pip_wheel(self): + with make_temp_env("python=3 pip") as prefix: + check_call(PYTHON_BINARY + " -m pip install flask==0.10.1", + cwd=prefix, shell=True) + stdout, stderr = run_command(Commands.LIST, prefix) + stdout_lines = stdout.split('\n') + assert any(line.endswith("<pip>") for line in stdout_lines if line.lower().startswith("flask")) @pytest.mark.timeout(300)
conda list misses pip-installed wheels As of conda 4.1, `conda list` no longer captures python packages that were pip-installed and were installed from wheels. https://www.python.org/dev/peps/pep-0427/#id14 CC @ilanschnell
This is actually a real issue now because the large majority of packages on PyPI are distributed as sdists, and now on install, pip force-compiles sdists to wheels, then installs those wheels. How about we use something like this: ``` import pkgutil packages = [p[1] for p in pkgutil.iter_modules()] ``` The problem is that from whatever `pkgutil.iter_modules()` returns, it is hard to tell whether or nor the installed package is a conda package or not. The point of the new `conda.egginfo` module, part from not having to call out to `pip`, is that conda knows which `.egg-info` files are "untracked" (not part of any conda package). I think the best solution is to extend `conda.egginfo` to handle these new meta-data files also.
2016-06-26T19:18:01
conda/conda
2,875
conda__conda-2875
[ "2841" ]
8d744a0fab207153da762d615a7e71342fe9a20f
diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -257,13 +257,19 @@ def execute_config(args, parser): if isinstance(rc_config[key], (bool, string_types)): print("--set", key, rc_config[key]) - else: + else: # assume the key is a list-type # Note, since conda config --add prepends, these are printed in # the reverse order so that entering them in this order will # recreate the same file - for item in reversed(rc_config.get(key, [])): + items = rc_config.get(key, []) + numitems = len(items) + for q, item in enumerate(reversed(items)): # Use repr so that it can be pasted back in to conda config --add - print("--add", key, repr(item)) + if key == "channels" and q in (0, numitems-1): + print("--add", key, repr(item), + " # lowest priority" if q == 0 else " # highest priority") + else: + print("--add", key, repr(item)) # Add, append for arg, prepend in zip((args.add, args.append), (True, False)):
diff --git a/tests/test_config.py b/tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -240,8 +240,8 @@ def test_config_command_get(): --set always_yes True --set changeps1 False --set channel_alias http://alpha.conda.anaconda.org ---add channels 'defaults' ---add channels 'test' +--add channels 'defaults' # lowest priority +--add channels 'test' # highest priority --add create_default_packages 'numpy' --add create_default_packages 'ipython'\ """ @@ -251,8 +251,8 @@ def test_config_command_get(): '--get', 'channels') assert stdout == """\ ---add channels 'defaults' ---add channels 'test'\ +--add channels 'defaults' # lowest priority +--add channels 'test' # highest priority\ """ assert stderr == "" @@ -269,8 +269,8 @@ def test_config_command_get(): assert stdout == """\ --set changeps1 False ---add channels 'defaults' ---add channels 'test'\ +--add channels 'defaults' # lowest priority +--add channels 'test' # highest priority\ """ assert stderr == "" @@ -326,12 +326,12 @@ def test_config_command_parser(): with make_temp_condarc(condarc) as rc: stdout, stderr = run_conda_command('config', '--file', rc, '--get') - + print(stdout) assert stdout == """\ --set always_yes True --set changeps1 False ---add channels 'defaults' ---add channels 'test' +--add channels 'defaults' # lowest priority +--add channels 'test' # highest priority --add create_default_packages 'numpy' --add create_default_packages 'ipython'\ """
Would be nice if conda config --get channels listed the channels in priority order As far as I can tell it currently lists them in reverse order.
Good idea! Wow, I was about to change this, but the code has a note ``` # Note, since conda config --add prepends, these are printed in # the reverse order so that entering them in this order will # recreate the same file ``` It's a good point. And as implemented was intended to be a feature. I don't think this is a bug anymore. And if we change it, would have to go in 4.2.x instead of 4.1.x. I have to think more about it. I think one problem is that `--add` prepends. It seems more natural to me that `--add` would append, and there should be a separate `--prepend` flag. As a new feature (maybe not in 4.2.x), we should probably add both `--append` and `--prepend` flags. Keep the `--add` flag as-is for a while, but warn on use, and eventually change the behavior for `--add` from prepend to append. Good news: we already have append and prepend. As a stopgap, you could perhaps add `# lowest priority` and `# highest priority` to the first and last lines of the output? > Good news: we already have append and prepend. Oh perfect. I thought we had added one of them. Didn't remember if we put in both.
2016-06-26T21:50:18
conda/conda
2,896
conda__conda-2896
[ "2891" ]
b1c962d3f282ff93b08bbc831f1edae33a9f653a
diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -194,7 +194,7 @@ def get_default_urls(merged=False): return defaults_ def get_rc_urls(): - if rc.get('channels') is None: + if rc is None or rc.get('channels') is None: return [] if 'system' in rc['channels']: raise RuntimeError("system cannot be used in .condarc")
conda throws error if allow_other_channels setting is used The feature to lock down what channels your users are allowed to use stopped working http://conda.pydata.org/docs/install/central.html#allow-other-channels-allow-other-channels Reproduced this error in Windows 10 and OS X 10.11.5, if you use this setting in the systemwide .condarc file. ``` $ cat /Users/jenns/anaconda/.condarc allow_other_channels: False channels: - defaults ``` ``` $ conda info Traceback (most recent call last): File "/Users/jenns/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 61, in main from conda.cli import conda_argparse File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 15, in <module> from .common import add_parser_help File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/cli/common.py", line 12, in <module> from ..config import (envs_dirs, default_prefix, platform, update_dependencies, File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/config.py", line 331, in <module> allowed_channels = get_allowed_channels() File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/config.py", line 329, in get_allowed_channels return normalize_urls(base_urls) File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/config.py", line 253, in normalize_urls urls = get_rc_urls() + urls File "/Users/jenns/anaconda/lib/python2.7/site-packages/conda/config.py", line 197, in get_rc_urls if rc.get('channels') is None: AttributeError: 'NoneType' object has no attribute 'get' ```
downgraded conda to 4.0.9 and the issue went away. This occurs because when `allow_other_channels` is `False`, the call to `get_allowed_channels()` in `config.py` is trying to call `get_rc_urls()` before the local `~/.condarc` has been loaded. This can be fixed by moving the line `allowed_channels = get_allowed_channels()` to the very end of `config.py`, after the `load_condarc` call. It can also be fixed by modifying `get_rc_urls` to return an empty list if `rc` is `None`. I'm leaning towards the latter.
2016-06-28T14:54:15
conda/conda
2,908
conda__conda-2908
[ "2886" ]
767c0a9c06e8d37b06ad2a5afce8a25af1eac795
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -41,7 +41,6 @@ import tarfile import tempfile import time -import tempfile import traceback from os.path import (abspath, basename, dirname, isdir, isfile, islink, join, normpath) diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -69,14 +69,18 @@ def explicit(specs, prefix, verbose=False, force_extract=True, fetch_args=None, prefix = pkg_path = dir_path = None if url.startswith('file://'): prefix = cached_url(url) + if prefix is not None: + schannel = 'defaults' if prefix == '' else prefix[:-2] + is_file = False # If not, determine the channel name from the URL if prefix is None: channel, schannel = url_channel(url) + is_file = schannel.startswith('file:') and schannel.endswith('/') prefix = '' if schannel == 'defaults' else schannel + '::' + fn = prefix + fn dist = fn[:-8] - is_file = schannel.startswith('file:') and schannel.endswith('/') # Add explicit file to index so we'll see it later if is_file: index[fn] = {'fn': dist2filename(fn), 'url': url, 'md5': None}
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -260,11 +260,32 @@ def test_tarball_install_and_bad_metadata(self): assert not package_is_installed(prefix, 'flask-0.10.1') assert_package_is_installed(prefix, 'python') - # Regression test for 2812 - # install from local channel from conda.config import pkgs_dirs flask_fname = flask_data['fn'] tar_old_path = join(pkgs_dirs[0], flask_fname) + + # regression test for #2886 (part 1 of 2) + # install tarball from package cache, default channel + run_command(Commands.INSTALL, prefix, tar_old_path) + assert_package_is_installed(prefix, 'flask-0.') + + # regression test for #2626 + # install tarball with full path, outside channel + tar_new_path = join(prefix, flask_fname) + copyfile(tar_old_path, tar_new_path) + run_command(Commands.INSTALL, prefix, tar_new_path) + assert_package_is_installed(prefix, 'flask-0') + + # regression test for #2626 + # install tarball with relative path, outside channel + run_command(Commands.REMOVE, prefix, 'flask') + assert not package_is_installed(prefix, 'flask-0.10.1') + tar_new_path = relpath(tar_new_path) + run_command(Commands.INSTALL, prefix, tar_new_path) + assert_package_is_installed(prefix, 'flask-0.') + + # Regression test for 2812 + # install from local channel for field in ('url', 'channel', 'schannel'): del flask_data[field] repodata = {'info': {}, 'packages':{flask_fname: flask_data}} @@ -279,21 +300,12 @@ def test_tarball_install_and_bad_metadata(self): run_command(Commands.INSTALL, prefix, '-c', channel, 'flask') assert_package_is_installed(prefix, channel + '::' + 'flask-') - # regression test for #2626 - # install tarball with full path - tar_new_path = join(prefix, flask_fname) - copyfile(tar_old_path, tar_new_path) - run_command(Commands.INSTALL, prefix, tar_new_path) - assert_package_is_installed(prefix, 'flask-0') - + # regression test for #2886 (part 2 of 2) + # install tarball from package cache, local channel run_command(Commands.REMOVE, prefix, 'flask') assert not package_is_installed(prefix, 'flask-0') - - # regression test for #2626 - # install tarball with relative path - tar_new_path = relpath(tar_new_path) - run_command(Commands.INSTALL, prefix, tar_new_path) - assert_package_is_installed(prefix, 'flask-0.') + run_command(Commands.INSTALL, prefix, tar_old_path) + assert_package_is_installed(prefix, channel + '::' + 'flask-') # regression test for #2599 linked_data_.clear()
conda install from tarball error? Running into this issue when trying to install directly from a tarball. ``` Traceback (most recent call last): File "/usr/local/bin/conda2", line 6, in <module> sys.exit(main()) An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. File "/opt/conda2/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main exit_code = args_func(args, p) File "/opt/conda2/lib/python2.7/site-packages/conda/cli/main.py", line 130, in args_func exit_code = args.func(args, p) File "/opt/conda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 69, in execute install(args, parser, 'install') File "/opt/conda2/lib/python2.7/site-packages/conda/cli/install.py", line 196, in install explicit(args.packages, prefix, verbose=not args.quiet) File "/opt/conda2/lib/python2.7/site-packages/conda/misc.py", line 79, in explicit is_file = schannel.startswith('file:') and schannel.endswith('/') UnboundLocalError: local variable 'schannel' referenced before assignment ```
`conda info`? This is in a docker image. ``` $ conda info Current conda install: platform : linux-64 conda version : 4.1.4 conda-env version : 2.5.1 conda-build version : 1.20.0 python version : 2.7.11.final.0 requests version : 2.9.2 root environment : /opt/conda2 (writable) default environment : /opt/conda2 envs directories : /opt/conda2/envs package cache : /opt/conda2/pkgs channel URLs : https://conda.anaconda.org/nanshe/linux-64/ https://conda.anaconda.org/nanshe/noarch/ https://conda.anaconda.org/conda-forge/linux-64/ https://conda.anaconda.org/conda-forge/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /root/.condarc offline mode : False is foreign system : False ``` I'm having trouble reproducing this. I know this should be obvious but can you give us the exact command line? @jakirkham More details here would be helpful, including the specific package you tried to install by tarball. I'm genuinely having difficulty reproducing. So, this is coming out of an open sourced Docker image. Though I really should come up with a simpler example. I started to and then other stuff came up. I'll give it another try. Until I do here is the [Dockerfile](https://github.com/nanshe-org/docker_nanshe/blob/6fa60ad6f221731c17bf2277f5744f8b781095db/Dockerfile). Sorry it is so ugly. I've tried my best to make it readable given the constraints. The line that cause it to fail is this [one](https://github.com/nanshe-org/docker_nanshe/blob/6fa60ad6f221731c17bf2277f5744f8b781095db/Dockerfile#L29). Basically, what happens is we install everything in the `root` environment of two different `conda`s. One for Python 2 and the other for Python 3. We then remove one package `nanshe` and download the source code matching that version so as to have the test suite. We then remove the package and run the test suite. Once complete we try to reinstall the package from a file which fails. I was able to reproduce the problem---it is specifically limited to installing tarballs _in the package cache_. As a short-term fix you can copy the package out of the cache and then reinstall, I think. #2907 is the same issue. I'm working on a fix now. cc: @kalefranz
2016-06-29T04:29:30
conda/conda
2,915
conda__conda-2915
[ "2681" ]
deaccea600d7b80cbcc939f018a5fdfe2a066967
diff --git a/conda/egg_info.py b/conda/egg_info.py --- a/conda/egg_info.py +++ b/conda/egg_info.py @@ -15,6 +15,7 @@ from .misc import rel_path + def get_site_packages_dir(installed_pkgs): for info in itervalues(installed_pkgs): if info['name'] == 'python': diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -8,6 +8,3 @@ class InvalidInstruction(CondaException): def __init__(self, instruction, *args, **kwargs): msg = "No handler for instruction: %r" % instruction super(InvalidInstruction, self).__init__(msg, *args, **kwargs) - -class LockError(RuntimeError, CondaException): - pass diff --git a/conda/lock.py b/conda/lock.py --- a/conda/lock.py +++ b/conda/lock.py @@ -17,11 +17,11 @@ """ from __future__ import absolute_import, division, print_function -import logging import os -import time - -from .exceptions import LockError +import logging +from os.path import join +import glob +from time import sleep LOCKFN = '.conda_lock' @@ -33,13 +33,15 @@ class Locked(object): """ Context manager to handle locks. """ - def __init__(self, path, retries=10): + def __init__(self, path): self.path = path self.end = "-" + str(os.getpid()) - self.lock_path = os.path.join(self.path, LOCKFN + self.end) - self.retries = retries + self.lock_path = join(self.path, LOCKFN + self.end) + self.pattern = join(self.path, LOCKFN + '-*') + self.remove = True def __enter__(self): + retries = 10 # Keep the string "LOCKERROR" in this string so that external # programs can look for it. lockstr = ("""\ @@ -48,24 +50,33 @@ def __enter__(self): If you are sure that conda is not running, remove it and try again. You can also use: $ conda clean --lock\n""") sleeptime = 1 - - for _ in range(self.retries): - if os.path.isdir(self.lock_path): - stdoutlog.info(lockstr % self.lock_path) + files = None + while retries: + files = glob.glob(self.pattern) + if files and not files[0].endswith(self.end): + stdoutlog.info(lockstr % str(files)) stdoutlog.info("Sleeping for %s seconds\n" % sleeptime) - - time.sleep(sleeptime) + sleep(sleeptime) sleeptime *= 2 + retries -= 1 else: - os.makedirs(self.lock_path) - return self + break + else: + stdoutlog.error("Exceeded max retries, giving up") + raise RuntimeError(lockstr % str(files)) - stdoutlog.error("Exceeded max retries, giving up") - raise LockError(lockstr % self.lock_path) + if not files: + try: + os.makedirs(self.lock_path) + except OSError: + pass + else: # PID lock already here --- someone else will remove it. + self.remove = False def __exit__(self, exc_type, exc_value, traceback): - try: - os.rmdir(self.lock_path) - os.rmdir(self.path) - except OSError: - pass + if self.remove: + for path in self.lock_path, self.path: + try: + os.rmdir(path) + except OSError: + pass
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -18,7 +18,3 @@ def test_creates_message_with_instruction_name(self): e = exceptions.InvalidInstruction(random_instruction) expected = "No handler for instruction: %s" % random_instruction self.assertEqual(expected, str(e)) - -def test_lockerror_hierarchy(): - assert issubclass(exceptions.LockError, exceptions.CondaException) - assert issubclass(exceptions.LockError, RuntimeError) diff --git a/tests/test_lock.py b/tests/test_lock.py deleted file mode 100644 --- a/tests/test_lock.py +++ /dev/null @@ -1,32 +0,0 @@ -import os.path -import pytest - -from conda.lock import Locked, LockError - - -def test_lock_passes(tmpdir): - with Locked(tmpdir.strpath) as lock: - path = os.path.basename(lock.lock_path) - assert tmpdir.join(path).exists() and tmpdir.join(path).isdir() - - # lock should clean up after itself - assert not tmpdir.join(path).exists() - assert not tmpdir.exists() - -def test_lock_locks(tmpdir): - with Locked(tmpdir.strpath) as lock1: - path = os.path.basename(lock1.lock_path) - assert tmpdir.join(path).exists() and tmpdir.join(path).isdir() - - with pytest.raises(LockError) as execinfo: - with Locked(tmpdir.strpath, retries=1) as lock2: - assert False # this should never happen - assert lock2.lock_path == lock1.lock_path - assert "LOCKERROR" in str(execinfo) - assert "conda is already doing something" in str(execinfo) - - assert tmpdir.join(path).exists() and tmpdir.join(path).isdir() - - # lock should clean up after itself - assert not tmpdir.join(path).exists() - assert not tmpdir.exists()
[Regression] Conda create environment fails on lock if root environment is not under user control This issue is introduced in Conda 4.1.0 (Conda 4.0.8 works fine). ``` $ conda create -n root2 python=2 [123/1811] Fetching package metadata ....... Solving package specifications ............. Package plan for installation in environment /home/frol/.conda/envs/root2: The following NEW packages will be INSTALLED: openssl: 1.0.2h-1 (soft-link) pip: 8.1.2-py27_0 (soft-link) python: 2.7.11-0 (soft-link) readline: 6.2-2 (soft-link) setuptools: 23.0.0-py27_0 (soft-link) sqlite: 3.13.0-0 (soft-link) tk: 8.5.18-0 (soft-link) wheel: 0.29.0-py27_0 (soft-link) zlib: 1.2.8-3 (soft-link) Proceed ([y]/n)? Linking packages ... An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Include the output of the command 'conda info' in your report. Traceback (most recent call last): File "/usr/local/miniconda/bin/conda", line 6, in <module> sys.exit(main()) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main args_func(args, p) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 127, in args_func args.func(args, p) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 57, in execute install(args, parser, 'create') File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 407, in install execute_actions(actions, index, verbose=not args.quiet) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/plan.py", line 566, in execute_actions inst.execute_instructions(plan, index, verbose) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 137, in execute_instructions cmd(state, arg) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 80, in LINK_CMD link(state['prefix'], dist, lt, index=state['index'], shortcuts=shortcuts) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/install.py", line 1035, in link with Locked(prefix), Locked(pkgs_dir): File "/usr/local/miniconda/lib/python2.7/site-packages/conda/lock.py", line 60, in __enter__ os.makedirs(self.lock_path) File "/usr/local/miniconda/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/usr/local/miniconda/pkgs/.conda_lock-949' ``` `/usr/local/miniconda/` is a system-wide installation of miniconda, so obviously, users cannot create lock files there. P.S. I have a dream that updating conda software won't break things on every release...
It seems that I cannot even do `source activate ...` as a regular user now. It just hangs. Here is what I get when I interrupt it with `^C`: ``` $ source activate root2 ^CTraceback (most recent call last): File "/usr/local/miniconda/bin/conda", line 6, in <module> sys.exit(main()) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 48, in main activate.main() File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/activate.py", line 121, in main path = get_path(shelldict) File "/usr/local/miniconda/lib/python2.7/site-packages/conda/cli/activate.py", line 108, in get_path return run_in(shelldict["printpath"], shelldict)[0] File "/usr/local/miniconda/lib/python2.7/site-packages/conda/utils.py", line 174, in run_in stdout, stderr = p.communicate() File "/usr/local/miniconda/lib/python2.7/subprocess.py", line 799, in communicate return self._communicate(input) File "/usr/local/miniconda/lib/python2.7/subprocess.py", line 1409, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/usr/local/miniconda/lib/python2.7/subprocess.py", line 1463, in _communicate_with_poll ready = poller.poll() KeyboardInterrupt ``` It also seems like there is no way to pin Conda version. Installing any package to the root env tries to update Conda to the latest version: ``` $ conda install python Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: .... Solving package specifications: ......... Package plan for installation in environment /usr/local/miniconda: The following packages will be UPDATED: conda: 4.0.8-py27_0 --> 4.1.0-py27_0 conda-env: 2.4.5-py27_0 --> 2.5.0-py27_0 Proceed ([y]/n)? ``` You can now pin 4.0.9. ``` conda install conda=4.0.9 conda config --set auto_update_conda false ``` `auto_update_conda` setting will be added to 4.1.1 also, which is coming out tonight or tomorrow morning. Freaking lock on the whole package cache. We're going to get rid of that soon. I can't really tell what initially tripped here. What are the permissions on `/usr/local/miniconda/pkgs/.conda_lock-949`? Are they yours, or root, or does it even exist? Ohhh I think I get it, from your issue title. I actually thought this was already broken anyway. I plan on having 4.2 out in a couple weeks now, and should be a simple fix at that point. Ok with staying on 4.0.9 for this use case until then? @kalefranz It seems that I don't have options here but wait. I use Docker containers and this bug doesn't bother me that much. However, I would say that it is not a minor regression to postpone it to the next release. (From my experience, next release will break things in another way, so people will stuck with 4.0.*) In the last several months our coverage has gone from ~48% to almost 70%. The code base is still far more fragile and brittle than I'd like it to be, but we're making progress I think. Reverting #2320 fixed the regression. However, it seems that it just fails silently at locking, but at least it works in non-concurrent scenarios. cc @alanhdu @frol: Yeah, that's about right. Before #2320, conda would just swallow all `OsError`s (including `PermissionError`s). For now, we could add a `try ... except` around https://github.com/conda/conda/blob/master/conda/lock.py#L60, catch a `PermissionError` (or whatever the equivalent Python 2 error is), and try to do something smart (or just silently fail... depends how important that lock actually is). I am seeing this issue as well @kalefranz After reading this, I thought I would be able to downgrade conda to 4.0.9. However after doing that, I am still unable to activate centrally administered conda environments as a user. Is there a prior version of conda you would reccommend? Or did the 4.1.3 version leave something in my miniconda install that is causing the problem? Do I need to re-install miniconda2 from scratch? Should I just wait for this to be fixed before proceeding with trying to build a central conda install for our users? @davidslac There are two options you may try: 1. Downgrade conda-env together with conda: ``` bash $ conda install conda=4.0.9 'conda-env<2.5' ``` 2. Patch (revert changes) conda lock in Conda 4.1.x: ``` bash $ curl -o "/usr/local/miniconda/lib/python"*"/site-packages/conda/lock.py" \ "https://raw.githubusercontent.com/conda/conda/9428ad0b76be55e8070e04dd577c96e7dab571e0/conda/lock.py" ``` Thanks! I tried both, but it sill did not work. It's probably something I'm overlooking on my part - after the first failure I deleted the lock.pyc, but still no luck. I'll just hope for a fix in the future. I suspect though, that central administration is not as standard of a use case, so one is more likely to run into problems. It may be we should just provide a channel of our packages to our users and let them administer their own software stacks, give them some environments we know work. best, David On 06/27/16 10:58, Vlad Frolov wrote: > @davidslac https://github.com/davidslac There are two options you > may try: > > 1. > > ``` > Downgrade conda-env: > > $ conda install'conda-env<2.5' > ``` > > 2. > > ``` > Patch (revert changes) conda lock: > > $ curl -o"/usr/local/miniconda/lib/python"*"/site-packages/conda/lock.py" \ > "https://raw.githubusercontent.com/conda/conda/9428ad0b76be55e8070e04dd577c96e7dab571e0/conda/lock.py" > ```
2016-06-29T17:16:25
conda/conda
3,041
conda__conda-3041
[ "3036" ]
0b4b690e6a3e1b5562307b4bda29f2f7cdbb4632
diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -151,21 +151,19 @@ def configure_parser(sub_parsers): choices=BoolOrListKey() ) action.add_argument( - "--add", + "--append", "--add", nargs=2, action="append", - help="""Add one configuration value to the beginning of a list key. - To add to the end of the list, use --append.""", + help="""Add one configuration value to the end of a list key.""", default=[], choices=ListKey(), metavar=('KEY', 'VALUE'), ) action.add_argument( - "--append", + "--prepend", nargs=2, action="append", - help="""Add one configuration value to a list key. The default - behavior is to prepend.""", + help="""Add one configuration value to the beginning of a list key.""", default=[], choices=ListKey(), metavar=('KEY', 'VALUE'), @@ -260,7 +258,7 @@ def execute_config(args, parser): # recreate the same file items = rc_config.get(key, []) numitems = len(items) - for q, item in enumerate(reversed(items)): + for q, item in enumerate(items): # Use repr so that it can be pasted back in to conda config --add if key == "channels" and q in (0, numitems-1): print("--add", key, repr(item), @@ -268,8 +266,8 @@ def execute_config(args, parser): else: print("--add", key, repr(item)) - # Add, append - for arg, prepend in zip((args.add, args.append), (True, False)): + # prepend, append, add + for arg, prepend in zip((args.prepend, args.append), (True, False)): for key, item in arg: if key == 'channels' and key not in rc_config: rc_config[key] = ['defaults'] @@ -287,7 +285,7 @@ def execute_config(args, parser): if item in arglist: # Right now, all list keys should not contain duplicates message = "Warning: '%s' already in '%s' list, moving to the %s" % ( - item, key, "front" if prepend else "back") + item, key, "top" if prepend else "bottom") arglist = rc_config[key] = [p for p in arglist if p != item] if not args.json: print(message, file=sys.stderr) diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -197,6 +197,12 @@ def __init__(self, message, *args, **kwargs): super(PackageNotFoundError, self).__init__(msg, *args, **kwargs) +class CondaHTTPError(CondaError): + def __init__(self, message, *args, **kwargs): + msg = 'HTTP Error: %s\n' % message + super(CondaHTTPError, self).__init__(msg, *args, **kwargs) + + class NoPackagesFoundError(CondaError, RuntimeError): '''An exception to report that requested packages are missing. @@ -352,7 +358,7 @@ def print_exception(exception): def get_info(): - from StringIO import StringIO + from conda.compat import StringIO from contextlib import contextmanager from conda.cli import conda_argparse from conda.cli.main_info import configure_parser diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -27,8 +27,8 @@ rm_rf, exp_backoff_fn) from .lock import Locked as Locked from .utils import memoized -from .exceptions import ProxyError, ChannelNotAllowed, CondaRuntimeError, CondaSignatureError - +from .exceptions import ProxyError, ChannelNotAllowed, CondaRuntimeError, CondaSignatureError, \ + CondaError, CondaHTTPError log = getLogger(__name__) dotlog = getLogger('dotupdate') @@ -159,7 +159,7 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): msg = "HTTPError: %s: %s\n" % (e, remove_binstar_tokens(url)) log.debug(msg) - raise CondaRuntimeError(msg) + raise CondaHTTPError(msg) except requests.exceptions.SSLError as e: msg = "SSL Error: %s\n" % e
diff --git a/tests/test_config.py b/tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -303,19 +303,19 @@ def test_config_command_basics(): assert stdout == stderr == '' assert _read_test_condarc(rc) == """\ channels: - - test - defaults + - test """ with make_temp_condarc() as rc: # When defaults is explicitly given, it should not be added stdout, stderr = run_conda_command('config', '--file', rc, '--add', 'channels', 'test', '--add', 'channels', 'defaults') assert stdout == '' - assert stderr == "Warning: 'defaults' already in 'channels' list, moving to the front" + assert stderr == "Warning: 'defaults' already in 'channels' list, moving to the bottom" assert _read_test_condarc(rc) == """\ channels: - - defaults - test + - defaults """ # Duplicate keys should not be added twice with make_temp_condarc() as rc: @@ -325,11 +325,11 @@ def test_config_command_basics(): stdout, stderr = run_conda_command('config', '--file', rc, '--add', 'channels', 'test') assert stdout == '' - assert stderr == "Warning: 'test' already in 'channels' list, moving to the front" + assert stderr == "Warning: 'test' already in 'channels' list, moving to the bottom" assert _read_test_condarc(rc) == """\ channels: - - test - defaults + - test """ # Test append @@ -340,7 +340,7 @@ def test_config_command_basics(): stdout, stderr = run_conda_command('config', '--file', rc, '--append', 'channels', 'test') assert stdout == '' - assert stderr == "Warning: 'test' already in 'channels' list, moving to the back" + assert stderr == "Warning: 'test' already in 'channels' list, moving to the bottom" assert _read_test_condarc(rc) == """\ channels: - defaults @@ -394,10 +394,10 @@ def test_config_command_get(): --set always_yes True --set changeps1 False --set channel_alias http://alpha.conda.anaconda.org ---add channels 'defaults' # lowest priority ---add channels 'test' # highest priority ---add create_default_packages 'numpy' ---add create_default_packages 'ipython'\ +--add channels 'test' # lowest priority +--add channels 'defaults' # highest priority +--add create_default_packages 'ipython' +--add create_default_packages 'numpy'\ """ assert stderr == "unknown key invalid_key" @@ -405,8 +405,8 @@ def test_config_command_get(): '--get', 'channels') assert stdout == """\ ---add channels 'defaults' # lowest priority ---add channels 'test' # highest priority\ +--add channels 'test' # lowest priority +--add channels 'defaults' # highest priority\ """ assert stderr == "" @@ -423,8 +423,8 @@ def test_config_command_get(): assert stdout == """\ --set changeps1 False ---add channels 'defaults' # lowest priority ---add channels 'test' # highest priority\ +--add channels 'test' # lowest priority +--add channels 'defaults' # highest priority\ """ assert stderr == "" @@ -484,16 +484,23 @@ def test_config_command_parser(): assert stdout == """\ --set always_yes True --set changeps1 False ---add channels 'defaults' # lowest priority ---add channels 'test' # highest priority ---add create_default_packages 'numpy' ---add create_default_packages 'ipython'\ +--add channels 'test' # lowest priority +--add channels 'defaults' # highest priority +--add create_default_packages 'ipython' +--add create_default_packages 'numpy'\ """ + print(">>>>") + with open(rc, 'r') as fh: + print(fh.read()) - stdout, stderr = run_conda_command('config', '--file', rc, '--add', - 'channels', 'mychannel') + + + stdout, stderr = run_conda_command('config', '--file', rc, '--prepend', 'channels', 'mychannel') assert stdout == stderr == '' + with open(rc, 'r') as fh: + print(fh.read()) + assert _read_test_condarc(rc) == """\ channels: - mychannel
conda config needs --prepend; change behavior of --add to --append referencing https://github.com/conda/conda/issues/2841 - conda config needs `--prepend` - change behavior of `--add` to `--append` - un-reverse order of `conda config --get channels`
2016-07-11T22:03:41
conda/conda
3,080
conda__conda-3080
[ "3060", "3060" ]
13302ffd9d51807f34c3bf2fad22cb37356d2449
diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -46,7 +46,7 @@ def explicit(specs, prefix, verbose=False, force_extract=True, index_args=None, index_args = index_args or {} index = index or {} verifies = [] - channels = {} + channels = set() for spec in specs: if spec == '@EXPLICIT': continue @@ -106,7 +106,7 @@ def explicit(specs, prefix, verbose=False, force_extract=True, index_args=None, actions[RM_FETCHED].append(conflict) if not is_local: if fn not in index or index[fn].get('not_fetched'): - channels.add(channel) + channels.add(schannel) verifies.append((dist + '.tar.bz2', md5)) actions[FETCH].append(dist) actions[EXTRACT].append(dist) @@ -122,7 +122,7 @@ def explicit(specs, prefix, verbose=False, force_extract=True, index_args=None, index_args = index_args or {} index_args = index_args.copy() index_args['prepend'] = False - index_args['channel_urls'] = channels + index_args['channel_urls'] = list(channels) index.update(get_index(**index_args)) # Finish the MD5 verification
conda create causes: AttributeError: 'dict' object has no attribute 'add' Trying to clone the root environment with: ``` conda create --clone root --copy -n myenv2 ``` Gives: ``` Traceback (most recent call last): File "/opt/miniconda/bin/conda", line 6, in <module> sys.exit(main()) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main exit_code = args_func(args, p) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 130, in args_func exit_code = args.func(args, p) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 58, in execute install(args, parser, 'create') File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 223, in install clone(args.clone, prefix, json=args.json, quiet=args.quiet, index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 88, in clone index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/misc.py", line 360, in clone_env force_extract=False, index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/misc.py", line 109, in explicit channels.add(channel) AttributeError: 'dict' object has no attribute 'add' ``` conda info: ``` platform : linux-64 conda version : 4.1.8 conda-env version : 2.5.1 conda-build version : 1.18.1 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /opt/miniconda (read only) default environment : /opt/miniconda envs directories : /home/wiecki/.conda/envs /home/wiecki/envs /opt/miniconda/envs package cache : /home/wiecki/.conda/envs/.pkgs /home/wiecki/envs/.pkgs /opt/miniconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False is foreign system : False ``` conda create causes: AttributeError: 'dict' object has no attribute 'add' Trying to clone the root environment with: ``` conda create --clone root --copy -n myenv2 ``` Gives: ``` Traceback (most recent call last): File "/opt/miniconda/bin/conda", line 6, in <module> sys.exit(main()) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main exit_code = args_func(args, p) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 130, in args_func exit_code = args.func(args, p) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 58, in execute install(args, parser, 'create') File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 223, in install clone(args.clone, prefix, json=args.json, quiet=args.quiet, index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 88, in clone index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/misc.py", line 360, in clone_env force_extract=False, index_args=index_args) File "/opt/miniconda/lib/python2.7/site-packages/conda/misc.py", line 109, in explicit channels.add(channel) AttributeError: 'dict' object has no attribute 'add' ``` conda info: ``` platform : linux-64 conda version : 4.1.8 conda-env version : 2.5.1 conda-build version : 1.18.1 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /opt/miniconda (read only) default environment : /opt/miniconda envs directories : /home/wiecki/.conda/envs /home/wiecki/envs /opt/miniconda/envs package cache : /home/wiecki/.conda/envs/.pkgs /home/wiecki/envs/.pkgs /opt/miniconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False is foreign system : False ```
Same problem on Windows. Also encountered https://github.com/conda/conda/issues/3009 On Mac, it also has this bug. In the source code, channels is initialised as {}, and dict has no add() function. I change it to channels = () at line 51, and every thing is fine. Thanks for pointing out the bug @kalefranz , this is a bug need to fix for conda 4.2 I think, and I will create a PR for that Same problem on Windows. Also encountered https://github.com/conda/conda/issues/3009 On Mac, it also has this bug. In the source code, channels is initialised as {}, and dict has no add() function. I change it to channels = () at line 51, and every thing is fine. Thanks for pointing out the bug @kalefranz , this is a bug need to fix for conda 4.2 I think, and I will create a PR for that
2016-07-15T03:12:13
conda/conda
3,143
conda__conda-3143
[ "3073" ]
c5fa7f9f4482b99e5c4f0f3d6d2e9cee9afb578a
diff --git a/conda/connection.py b/conda/connection.py --- a/conda/connection.py +++ b/conda/connection.py @@ -6,6 +6,10 @@ from __future__ import print_function, division, absolute_import +from base64 import b64decode + +import ftplib + import cgi import email import mimetypes @@ -16,10 +20,12 @@ from io import BytesIO from logging import getLogger +from conda.exceptions import AuthenticationError from . import __version__ as VERSION from .base.context import context, platform as context_platform -from .common.url import url_to_path, url_to_s3_info +from .common.url import url_to_path, url_to_s3_info, urlparse from .utils import gnu_get_libc_version +from .compat import StringIO RETRIES = 3 @@ -195,6 +201,196 @@ def close(self): pass +# Taken from requests-ftp +# (https://github.com/Lukasa/requests-ftp/blob/master/requests_ftp/ftp.py) + +# Copyright 2012 Cory Benfield + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +class FTPAdapter(requests.adapters.BaseAdapter): + '''A Requests Transport Adapter that handles FTP urls.''' + def __init__(self): + super(FTPAdapter, self).__init__() + + # Build a dictionary keyed off the methods we support in upper case. + # The values of this dictionary should be the functions we use to + # send the specific queries. + self.func_table = {'LIST': self.list, + 'RETR': self.retr, + 'STOR': self.stor, + 'NLST': self.nlst, + 'GET': self.retr} + + def send(self, request, **kwargs): + '''Sends a PreparedRequest object over FTP. Returns a response object. + ''' + # Get the authentication from the prepared request, if any. + auth = self.get_username_password_from_header(request) + + # Next, get the host and the path. + host, port, path = self.get_host_and_path_from_url(request) + + # Sort out the timeout. + timeout = kwargs.get('timeout', None) + + # Establish the connection and login if needed. + self.conn = ftplib.FTP() + self.conn.connect(host, port, timeout) + + if auth is not None: + self.conn.login(auth[0], auth[1]) + else: + self.conn.login() + + # Get the method and attempt to find the function to call. + resp = self.func_table[request.method](path, request) + + # Return the response. + return resp + + def close(self): + '''Dispose of any internal state.''' + # Currently this is a no-op. + pass + + def list(self, path, request): + '''Executes the FTP LIST command on the given path.''' + data = StringIO() + + # To ensure the StringIO gets cleaned up, we need to alias its close + # method to the release_conn() method. This is a dirty hack, but there + # you go. + data.release_conn = data.close + + self.conn.cwd(path) + code = self.conn.retrbinary('LIST', data_callback_factory(data)) + + # When that call has finished executing, we'll have all our data. + response = build_text_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def retr(self, path, request): + '''Executes the FTP RETR command on the given path.''' + data = BytesIO() + + # To ensure the BytesIO gets cleaned up, we need to alias its close + # method. See self.list(). + data.release_conn = data.close + + code = self.conn.retrbinary('RETR ' + path, data_callback_factory(data)) + + response = build_binary_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def stor(self, path, request): + '''Executes the FTP STOR command on the given path.''' + + # First, get the file handle. We assume (bravely) + # that there is only one file to be sent to a given URL. We also + # assume that the filename is sent as part of the URL, not as part of + # the files argument. Both of these assumptions are rarely correct, + # but they are easy. + data = parse_multipart_files(request) + + # Split into the path and the filename. + path, filename = os.path.split(path) + + # Switch directories and upload the data. + self.conn.cwd(path) + code = self.conn.storbinary('STOR ' + filename, data) + + # Close the connection and build the response. + self.conn.close() + + response = build_binary_response(request, BytesIO(), code) + + return response + + def nlst(self, path, request): + '''Executes the FTP NLST command on the given path.''' + data = StringIO() + + # Alias the close method. + data.release_conn = data.close + + self.conn.cwd(path) + code = self.conn.retrbinary('NLST', data_callback_factory(data)) + + # When that call has finished executing, we'll have all our data. + response = build_text_response(request, data, code) + + # Close the connection. + self.conn.close() + + return response + + def get_username_password_from_header(self, request): + '''Given a PreparedRequest object, reverse the process of adding HTTP + Basic auth to obtain the username and password. Allows the FTP adapter + to piggyback on the basic auth notation without changing the control + flow.''' + auth_header = request.headers.get('Authorization') + + if auth_header: + # The basic auth header is of the form 'Basic xyz'. We want the + # second part. Check that we have the right kind of auth though. + encoded_components = auth_header.split()[:2] + if encoded_components[0] != 'Basic': + raise AuthenticationError('Invalid form of Authentication used.') + else: + encoded = encoded_components[1] + + # Decode the base64 encoded string. + decoded = b64decode(encoded) + + # The string is of the form 'username:password'. Split on the + # colon. + components = decoded.split(':') + username = components[0] + password = components[1] + return (username, password) + else: + # No auth header. Return None. + return None + + def get_host_and_path_from_url(self, request): + '''Given a PreparedRequest object, split the URL in such a manner as to + determine the host and the path. This is a separate method to wrap some + of urlparse's craziness.''' + url = request.url + # scheme, netloc, path, params, query, fragment = urlparse(url) + parsed = urlparse(url) + path = parsed.path + + # If there is a slash on the front of the path, chuck it. + if path[0] == '/': + path = path[1:] + + host = parsed.hostname + port = parsed.port or 0 + + return (host, port, path) + + def data_callback_factory(variable): '''Returns a callback suitable for use by the FTP library. This callback will repeatedly save data into the variable provided to this function. This diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -203,6 +203,10 @@ def __init__(self, message, *args, **kwargs): super(CondaHTTPError, self).__init__(msg, *args, **kwargs) +class AuthenticationError(CondaError): + pass + + class NoPackagesFoundError(CondaError, RuntimeError): '''An exception to report that requested packages are missing.
put ftp:// back into 4.2
2016-07-25T16:54:06
conda/conda
3,144
conda__conda-3144
[ "3079" ]
c5fa7f9f4482b99e5c4f0f3d6d2e9cee9afb578a
diff --git a/conda/_vendor/auxlib/packaging.py b/conda/_vendor/auxlib/packaging.py --- a/conda/_vendor/auxlib/packaging.py +++ b/conda/_vendor/auxlib/packaging.py @@ -69,11 +69,14 @@ import sys from collections import namedtuple from logging import getLogger -from os import getenv, remove +from os import getenv, remove, listdir from os.path import abspath, dirname, expanduser, isdir, isfile, join from re import compile from shlex import split from subprocess import CalledProcessError, Popen, PIPE +from fnmatch import fnmatchcase +from distutils.util import convert_path + try: from setuptools.command.build_py import build_py from setuptools.command.sdist import sdist @@ -81,8 +84,8 @@ except ImportError: from distutils.command.build_py import build_py from distutils.command.sdist import sdist - TestCommand = object + TestCommand = object log = getLogger(__name__) @@ -222,3 +225,21 @@ def run_tests(self): args = '' errno = cmdline(args=args) sys.exit(errno) + + +# swiped from setuptools +def find_packages(where='.', exclude=()): + out = [] + stack = [(convert_path(where), '')] + while stack: + where, prefix = stack.pop(0) + for name in listdir(where): + fn = join(where, name) + if ('.' not in name and isdir(fn) and + isfile(join(fn, '__init__.py')) + ): + out.append(prefix + name) + stack.append((fn, prefix + name + '.')) + for pat in list(exclude) + ['ez_setup', 'distribute_setup']: + out = [item for item in out if not fnmatchcase(item, pat)] + return out diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. import os import sys -from setuptools import find_packages if 'develop' in sys.argv: from setuptools import setup else: @@ -61,7 +60,8 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", ], - packages=find_packages(exclude=("tests", "conda-env", "build", "utils", ".tox")), + packages=conda._vendor.auxlib.packaging.find_packages(exclude=("tests", "conda-env", + "build", "utils", ".tox")), cmdclass={ 'build_py': conda._vendor.auxlib.BuildPyCommand, 'sdist': conda._vendor.auxlib.SDistCommand,
setuptools hard build dependency Here: https://github.com/conda/conda/blob/master/setup.py#L8 @kalefranz I thought we had agreed that setuptools is not going to be a hard build dependency anymore.
If you don't want to hard code all the packages (because you're vendoring so many things now), you can use this code: ``` import os from fnmatch import fnmatchcase from distutils.util import convert_path def find_packages(where='.', exclude=()): out = [] stack=[(convert_path(where), '')] while stack: where, prefix = stack.pop(0) for name in os.listdir(where): fn = os.path.join(where,name) if ('.' not in name and os.path.isdir(fn) and os.path.isfile(os.path.join(fn, '__init__.py')) ): out.append(prefix+name) stack.append((fn, prefix+name+'.')) for pat in list(exclude) + ['ez_setup', 'distribute_setup']: out = [item for item in out if not fnmatchcase(item, pat)] return out ``` Actually, I thought you'd think this build dependency was ok. I'm still using the `setup` function from distutils, not from setuptools. https://github.com/conda/conda/blob/master/setup.py#L12 No, `from distutils.core import setup` doesn't help, because `setuptools` monkeypatches `distutils` somehow. When I add `setuptools` as a build dependency, I also have to add `pycosat`. I'm not sure exactly what setuptools does, not it's safest to not depend on it. Grrrrrrrrr that sucks. OK I'll fix it with the function you suggest. I'll put that in auxlib.packaging. Thanks! Setuptools does crazy stuff, so the best is to avoid it when possible.
2016-07-25T16:58:34
conda/conda
3,210
conda__conda-3210
[ "2837", "2837" ]
21c26e487dee9567467c18761fc7bffa511a97bd
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -613,7 +613,7 @@ def symlink_conda_hlp(prefix, root_dir, where, symlink_fn): symlink_fn(root_file, prefix_file) except (IOError, OSError) as e: if (os.path.lexists(prefix_file) and - (e.errno in (errno.EPERM, errno.EACCES, errno.EROFS))): + (e.errno in (errno.EPERM, errno.EACCES, errno.EROFS, errno.EEXIST))): log.debug("Cannot symlink {0} to {1}. Ignoring since link already exists." .format(root_file, prefix_file)) else:
Activate issue with parallel activations - "File exists" in symlinked path I'm working in a cluster environment where I am trying to activate a conda environment in multiple parallel processes. After recently upgrading to the latest release (4.1.2), I've been receiving a "File exists" error in some of those processes, similar to the below: ``` Traceback (most recent call last): File "/symln_home/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 48, in main activate.main() File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/cli/activate.py", line 163, in main conda.install.symlink_conda(prefix, root_dir, shell) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/install.py", line 582, in symlink_conda symlink_conda_hlp(prefix, root_dir, where, symlink_fn) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/install.py", line 599, in symlink_conda_hlp symlink_fn(root_file, prefix_file) OSError: [Errno 17] File exists ``` I've been able to repro this issue on a laptop when my PATH to the root anaconda install contains a symlinked directory ("symln_home," in this example). Doesn't seem to be a problem when the PATH is symlink-free. The below has produced the error consistently for me on OS X: ``` $ echo $PATH /symln_home/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ``` ``` python from multiprocessing import Pool import os call = ['source activate myenv && echo $PATH' for i in range(30)] pool = Pool(4) pool.map(os.system, call) pool.close() ``` Is this a bug, or are there any workarounds for this particular use case? In my cluster environment, my HOME directory (where I've installed anaconda) is symlinked, which I would assume is a fairly common setup in shared computing (I don't admin it, so unfortunately I can't change that aspect). Activate issue with parallel activations - "File exists" in symlinked path I'm working in a cluster environment where I am trying to activate a conda environment in multiple parallel processes. After recently upgrading to the latest release (4.1.2), I've been receiving a "File exists" error in some of those processes, similar to the below: ``` Traceback (most recent call last): File "/symln_home/anaconda/bin/conda", line 6, in <module> sys.exit(main()) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 48, in main activate.main() File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/cli/activate.py", line 163, in main conda.install.symlink_conda(prefix, root_dir, shell) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/install.py", line 582, in symlink_conda symlink_conda_hlp(prefix, root_dir, where, symlink_fn) File "/Users/tomflem/anaconda/lib/python2.7/site-packages/conda/install.py", line 599, in symlink_conda_hlp symlink_fn(root_file, prefix_file) OSError: [Errno 17] File exists ``` I've been able to repro this issue on a laptop when my PATH to the root anaconda install contains a symlinked directory ("symln_home," in this example). Doesn't seem to be a problem when the PATH is symlink-free. The below has produced the error consistently for me on OS X: ``` $ echo $PATH /symln_home/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ``` ``` python from multiprocessing import Pool import os call = ['source activate myenv && echo $PATH' for i in range(30)] pool = Pool(4) pool.map(os.system, call) pool.close() ``` Is this a bug, or are there any workarounds for this particular use case? In my cluster environment, my HOME directory (where I've installed anaconda) is symlinked, which I would assume is a fairly common setup in shared computing (I don't admin it, so unfortunately I can't change that aspect).
@tomfleming We've had some fixes since `4.1.2` that might have tangentially touched on this, and may have ended up helping. Can you see if you still have the problem as of `4.1.5`? I downgraded to `4.0.0` and it appears to have resolved this issue. I'd recommend dropping back not to 4.0.0, but rather 4.0.10. This has been an issue brought to us. When running multiple instances of a bash script in parallel where a conda environment is activated prior to executing some python code, but the error below is produced: `Traceback (most recent call last):` `File "/usr/prog/anaconda/3.5-4.0.0/bin/conda", line 6, in <module>` `sys.exit(main())` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/cli/main.py", line 48, in main activate.main()` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/cli/activate.py", line 163, in main conda.install.symlink_conda(prefix, root_dir, shell)` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/install.py", line 582, in symlink_conda` `symlink_conda_hlp(prefix, root_dir, where, symlink_fn)` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/install.py", line 599, in symlink_conda_hlp` `symlink_fn(root_file, prefix_file)` `FileExistsError: [Errno 17] File exists: '/usr/prog/anaconda/3.5-4.0.0/bin/conda' -> '/home/john/.conda/envs/scikit/bin/conda'` The script works as expected when it's not executed concurrently. The error was worked around by replacing the activation of the environment with the corresponding $PATH settings. @tomfleming We've had some fixes since `4.1.2` that might have tangentially touched on this, and may have ended up helping. Can you see if you still have the problem as of `4.1.5`? I downgraded to `4.0.0` and it appears to have resolved this issue. I'd recommend dropping back not to 4.0.0, but rather 4.0.10. This has been an issue brought to us. When running multiple instances of a bash script in parallel where a conda environment is activated prior to executing some python code, but the error below is produced: `Traceback (most recent call last):` `File "/usr/prog/anaconda/3.5-4.0.0/bin/conda", line 6, in <module>` `sys.exit(main())` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/cli/main.py", line 48, in main activate.main()` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/cli/activate.py", line 163, in main conda.install.symlink_conda(prefix, root_dir, shell)` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/install.py", line 582, in symlink_conda` `symlink_conda_hlp(prefix, root_dir, where, symlink_fn)` `File "/usr/prog/anaconda/3.5-4.0.0/lib/python3.5/site-packages/conda/install.py", line 599, in symlink_conda_hlp` `symlink_fn(root_file, prefix_file)` `FileExistsError: [Errno 17] File exists: '/usr/prog/anaconda/3.5-4.0.0/bin/conda' -> '/home/john/.conda/envs/scikit/bin/conda'` The script works as expected when it's not executed concurrently. The error was worked around by replacing the activation of the environment with the corresponding $PATH settings.
2016-08-02T18:38:52
conda/conda
3,228
conda__conda-3228
[ "3226" ]
3b60a03ff8a2a839968a6ab299377129c8e15574
diff --git a/conda/base/constants.py b/conda/base/constants.py --- a/conda/base/constants.py +++ b/conda/base/constants.py @@ -62,9 +62,9 @@ def from_sys(cls): '$CONDA_ROOT/condarc', '$CONDA_ROOT/.condarc', '$CONDA_ROOT/condarc.d/', - '$HOME/.conda/condarc', - '$HOME/.conda/condarc.d/', - '$HOME/.condarc', + '~/.conda/condarc', + '~/.conda/condarc.d/', + '~/.condarc', '$CONDA_PREFIX/.condarc', '$CONDA_PREFIX/condarc.d/', '$CONDARC',
`conda update --all` wants to downgrade from conda-canary (and then things go haywire) I just did the following to try out conda-canary: ``` >conda config --add channels conda-canary >conda update conda ... The following packages will be UPDATED: conda: 4.1.9-py35_0 --> 4.2.1-py35_0 conda-canary Proceed ([y]/n)? y ... ``` I then thought I might update all the packages, and conda wants to downgrade itself: ``` >conda update --all Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment C:\Anaconda3: The following packages will be downloaded: package | build ---------------------------|----------------- cython-0.24.1 | py35_0 2.2 MB llvmlite-0.12.1 | py35_0 5.8 MB lxml-3.6.1 | py35_0 1.6 MB pytz-2016.6.1 | py35_0 171 KB pyzmq-15.3.0 | py35_0 551 KB ruamel_yaml-0.11.14 | py35_0 217 KB sip-4.18 | py35_0 241 KB tornado-4.4.1 | py35_0 595 KB wcwidth-0.1.7 | py35_0 21 KB win_unicode_console-0.5 | py35_0 27 KB conda-4.1.11 | py35_0 247 KB numba-0.27.0 | np111py35_0 1.9 MB numexpr-2.6.1 | np111py35_0 142 KB pickleshare-0.7.3 | py35_0 8 KB prompt_toolkit-1.0.3 | py35_0 308 KB qt-4.8.7 | vc14_9 50.5 MB traitlets-4.2.2 | py35_0 113 KB anaconda-client-1.5.1 | py35_0 166 KB bokeh-0.12.1 | py35_0 3.3 MB conda-build-1.21.9 | py35_0 319 KB ipython-5.0.0 | py35_0 1.0 MB pyqt-4.11.4 | py35_7 3.8 MB pyopenssl-16.0.0 | py35_0 68 KB jupyter_console-5.0.0 | py35_0 69 KB ------------------------------------------------------------ Total: 73.2 MB The following packages will be UPDATED: anaconda-client: 1.4.0-py35_0 --> 1.5.1-py35_0 bokeh: 0.12.0-py35_0 --> 0.12.1-py35_0 conda-build: 1.21.6-py35_0 --> 1.21.9-py35_0 cython: 0.24-py35_0 --> 0.24.1-py35_0 ipython: 4.2.0-py35_0 --> 5.0.0-py35_0 jupyter_console: 4.1.1-py35_0 --> 5.0.0-py35_0 llvmlite: 0.11.0-py35_0 --> 0.12.1-py35_0 lxml: 3.6.0-py35_0 --> 3.6.1-py35_0 numba: 0.26.0-np111py35_0 --> 0.27.0-np111py35_0 numexpr: 2.6.0-np111py35_0 --> 2.6.1-np111py35_0 pickleshare: 0.7.2-py35_0 --> 0.7.3-py35_0 prompt_toolkit: 1.0.0-py35_0 xonsh --> 1.0.3-py35_0 pyopenssl: 0.16.0-py35_0 --> 16.0.0-py35_0 pyqt: 4.11.4-py35_6 --> 4.11.4-py35_7 pytz: 2016.4-py35_0 --> 2016.6.1-py35_0 pyzmq: 15.2.0-py35_0 --> 15.3.0-py35_0 qt: 4.8.7-vc14_8 [vc14] --> 4.8.7-vc14_9 [vc14] ruamel_yaml: 0.11.7-py35_0 --> 0.11.14-py35_0 sip: 4.16.9-py35_2 --> 4.18-py35_0 tornado: 4.3-py35_1 --> 4.4.1-py35_0 traitlets: 4.2.1-py35_0 --> 4.2.2-py35_0 wcwidth: 0.1.5-py35_5 xonsh --> 0.1.7-py35_0 win_unicode_console: 0.4-py35_0 xonsh --> 0.5-py35_0 The following packages will be SUPERCEDED by a higher-priority channel: conda: 4.2.1-py35_0 conda-canary --> 4.1.11-py35_0 Proceed ([y]/n)? n ``` I'm not sure why upgrading via `conda update conda` would produce a different result for the package than `conda update --all`, intuitively the latter feels like it's a superset of the former, and the channel priority logic should apply the same way to both. To check that there's no conflict between conda-canary and something else interfering with the `--all` case, I next proceeded with the update, then did `conda update conda` again. It goes haywire at this point: ``` ... lots of printout that scrolled out of range ... WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn\prop-base\DOMPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn\text-base\DOMPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMPrint WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\prop-base\DOMTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\text-base\DOMTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\prop-base\DOMTraversalTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\text-base\DOMTraversalTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTraversalTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\prop-base\DOMTypeInfoTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\text-base\DOMTypeInfoTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\DOMTypeInfoTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\prop-base\EncodingTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\text-base\EncodingTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EncodingTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\prop-base\EnumVal.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\text-base\EnumVal.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\EnumVal WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\prop-base\InitTermTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\text-base\InitTermTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\InitTermTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\prop-base\MemHandlerTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\text-base\MemHandlerTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemHandlerTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\prop-base\MemParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\text-base\MemParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\MemParse WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\prop-base\PParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\text-base\PParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PParse WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\prop-base\PSVIWriter.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\text-base\PSVIWriter.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\PSVIWriter WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\prop-base\RangeTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\text-base\RangeTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\RangeTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\prop-base\Redirect.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\text-base\Redirect.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\Redirect WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\prop-base\SAX2Count.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\text-base\SAX2Count.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Count WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\prop-base\SAX2Print.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\text-base\SAX2Print.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAX2Print WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\prop-base\SAXCount.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\text-base\SAXCount.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXCount WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\prop-base\SAXPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\text-base\SAXPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SAXPrint WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\prop-base\SCMPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\text-base\SCMPrint.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SCMPrint WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\prop-base\SEnumVal.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\text-base\SEnumVal.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\SEnumVal WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\prop-base\StdInParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\text-base\StdInParse.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\StdInParse WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\prop-base\ThreadTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\text-base\ThreadTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\ThreadTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\prop-base\XercesLib.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\text-base\XercesLib.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XercesLib WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\prop-base\XInclude.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\text-base\XInclude.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XInclude WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\prop-base\XSerializerTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\text-base\XSerializerTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSerializerTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\prop-base\XSTSHarness.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\text-base\XSTSHarness.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSTSHarness WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\prop-base\XSValueTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\text-base\XSValueTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all\XSValueTest WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8\xerces-all WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC8 WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\.svn\entries WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\.svn WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\prop-base\xerces-all.sln.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\text-base\xerces-all.sln.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\.svn WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\prop-base\all.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\text-base\all.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\all WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\prop-base\CreateDOMDocument.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\text-base\CreateDOMDocument.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\CreateDOMDocument WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\prop-base\DOMCount.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\text-base\DOMCount.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMCount WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\prop-base\DOMMemTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\prop-base WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\text-base\DOMMemTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn\text-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest\.svn WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMMemTest WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMNormalizerTest\.svn\all-wcprops WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMNormalizerTest\.svn\entries WARNING:conda.install:Cannot remove, permission denied: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMNormalizerTest\.svn\prop-base\DOMNormalizerTest.vcproj.svn-base WARNING:conda.install:Cannot remove, not empty: C:\Anaconda3\pkgs\.trash\tmp9n2xgmlr\xerces-c-3.1.3\projects\Win32\VC9\xerces-all\DOMNormalizerTest\.svn\prop-base Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\conda\install.py", line 270, in rm_rf PermissionError: [WinError 5] Access is denied: 'C:\\Anaconda3\\Scripts/conda.exe' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Anaconda3\lib\shutil.py", line 381, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Anaconda3\\pkgs\\.trash\\tmp9n2xgmlr\\xerces-c-3.1.3\\projects\\Win32\\VC9\\xerces-all\\DOMNormalizerTest\\.svn\\text-base\\DOMNormalizerTest.vcproj.svn-base' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Anaconda3\Scripts\conda-script.py", line 5, in <module> File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 120, in main File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 130, in args_func File "C:\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 64, in execute File "C:\Anaconda3\lib\site-packages\conda\cli\install.py", line 407, in install File "C:\Anaconda3\lib\site-packages\conda\plan.py", line 599, in execute_actions File "C:\Anaconda3\lib\site-packages\conda\instructions.py", line 135, in execute_instructions File "C:\Anaconda3\lib\site-packages\conda\instructions.py", line 82, in UNLINK_CMD File "C:\Anaconda3\lib\site-packages\conda\install.py", line 1127, in unlink File "C:\Anaconda3\lib\site-packages\conda\install.py", line 274, in rm_rf File "C:\Anaconda3\lib\site-packages\conda\install.py", line 1007, in move_path_to_trash File "C:\Anaconda3\lib\site-packages\conda\install.py", line 985, in delete_trash File "C:\Anaconda3\lib\site-packages\conda\install.py", line 285, in rm_rf File "C:\Anaconda3\lib\shutil.py", line 488, in rmtree return _rmtree_unsafe(path, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Anaconda3\lib\shutil.py", line 381, in _rmtree_unsafe os.unlink(fullname) KeyboardInterrupt >conda update conda Cannot open C:\Anaconda3\Scripts\conda-script.py ``` I guess this is why it's "canary" :)
Well that's frustrating. Thanks for the report. Let me try to reproduce on windows right now. In the meantime, can you give the me contents of your condarc file? Ok, I wasn't able to reproduce yet. My own output from windows below. You basically have a broken conda right now, correct? The easiest way to recover for you I think is to download the latest miniconda installer, and then point it at your `C:\Anaconda3` directory to overwrite or correct anything that got borked. Output from trying to reproduce myself: ``` kfranz@DESKTOP-V5CQ93H MSYS ~/continuum/anaconda/packages/conda-4.2.1 $ conda install conda=4.1.9 Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment C:\Users\kfranz\Anaconda3: The following packages will be DOWNGRADED due to dependency conflicts: conda: 4.1.11-py35_0 --> 4.1.9-py35_0 Proceed ([y]/n)? Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% kfranz@DESKTOP-V5CQ93H MSYS ~/continuum/anaconda/packages/conda-4.2.1 $ conda config --add channels conda-canary kfranz@DESKTOP-V5CQ93H MSYS ~/continuum/anaconda/packages/conda-4.2.1 $ conda update conda Fetching package metadata ........... Solving package specifications: .......... Package plan for installation in environment C:\Users\kfranz\Anaconda3: The following packages will be downloaded: package | build ---------------------------|----------------- conda-4.2.1 | py35_0 402 KB conda-canary The following packages will be UPDATED: conda: 4.1.9-py35_0 --> 4.2.1-py35_0 conda-canary Proceed ([y]/n)? Using Anaconda Cloud api site https://api.anaconda.org Fetching packages ... conda-4.2.1-py 100% |###############################| Time: 0:00:00 941.32 kB/s Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% kfranz@DESKTOP-V5CQ93H MSYS ~/continuum/anaconda/packages/conda-4.2.1 $ conda update --all Fetching package metadata ...Remote site alias https://api.anaconda.org does not exist in the config file ........ Solving package specifications: .......... Package plan for installation in environment C:\Users\kfranz\Anaconda3: The following packages will be UPDATED: conda-build: 1.20.3-py35_0 --> 1.21.9-py35_0 The following packages will be DOWNGRADED due to dependency conflicts: anaconda-navigator: 1.2.2-py35_0 --> 1.2.1-py35_0 hdf5: 1.8.16-vc14_0 [vc14] --> 1.8.15.1-vc14_4 [vc14] ipython: 5.0.0-py35_0 --> 4.2.0-py35_0 jupyter_console: 5.0.0-py35_0 --> 4.1.1-py35_0 llvmlite: 0.12.1-py35_0 --> 0.11.0-py35_0 lxml: 3.6.1-py35_0 --> 3.6.0-py35_0 nb_anacondacloud: 1.2.0-py35_0 --> 1.1.0-py35_0 nb_conda: 2.0.0-py35_0 --> 1.1.0-py35_0 ruamel_yaml: 0.11.14-py35_0 --> 0.11.7-py35_0 Proceed ([y]/n)? ``` Studying your output more, I think there were several things that happened. First, as of conda 4.1 and later, channel order matters. Also, `conda config --add channels conda-canary` actually has different behavior in 4.1 and 4.2 (changelog [here](https://github.com/conda/conda/releases/tag/4.2.0). In 4.1, it is equivalent to `conda config --prepend channels conda-canary`. In 4.2, it is equivalent to `conda config --append channels conda-canary`. The behavior change is deliberate. It's a safer default behavior for more inexperienced users. I'm guessing your condarc has something like ``` channels: - defaults - conda-canary ``` which is why `conda update --all` wanted to downgrade conda. The "going haywire" part with trash removal is what I'm more concerned about and don't have a good explanation for yet. My `.condarc` looks like this: ``` >type c:\Users\mwiebe\.condarc channels: - conda-canary - defaults ``` To recover, I've completely wiped out C:\Anaconda3 and reinstalled miniconda. After installing miniconda3, it looks like I can alternate between `conda update conda` and `conda update --all` many times, and each command upgrades or downgrades. ``` C:\>conda update conda Fetching package metadata ........... Solving package specifications: .......... Package plan for installation in environment C:\Anaconda3: The following packages will be downloaded: package | build ---------------------------|----------------- conda-4.2.1 | py35_0 402 KB conda-canary The following packages will be UPDATED: conda: 4.1.11-py35_0 --> 4.2.1-py35_0 conda-canary Proceed ([y]/n)? Fetching packages ... conda-4.2.1-py 100% |###############################| Time: 0:00:00 522.38 kB/s Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% C:\>conda update --all Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment C:\Anaconda3: The following packages will be SUPERCEDED by a higher-priority channel: conda: 4.2.1-py35_0 conda-canary --> 4.1.11-py35_0 Proceed ([y]/n)? y Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% ``` When you're on a 4.2.1 conda, what is the output of `conda config --show` and `conda config --show-sources`? Here's that output: ``` C:\>conda --version conda 4.2.1 C:\>conda config --show disallow: [] ssl_verify: true proxy_servers: {} json: false channels: - defaults channel_priority: true add_pip_as_python_dependency: true channel_alias: https://conda.anaconda.org/ allow_softlinks: true default_channels: - https://repo.continuum.io/pkgs/free - https://repo.continuum.io/pkgs/pro - https://repo.continuum.io/pkgs/msys2 track_features: [] offline: false shortcuts: true always_copy: false always_yes: false update_dependencies: true changeps1: true debug: false show_channel_urls: binstar_upload: create_default_packages: [] auto_update_conda: true quiet: false add_anaconda_token: true use_pip: true C:\>conda config --show-sources > cmd_line json: False debug: False ``` Wow ok. Yes, this is exactly why we have canary. Your condarc file isn't even getting picked up. There's something I've apparently missed with windows installs. What is the output of `conda info -a`? Another odd thing is the error `Uncaught backoff with errno 2` when at version 4.2.1: ``` C:\>conda update conda Fetching package metadata ........... Solving package specifications: .......... Package plan for installation in environment C:\Anaconda3: The following packages will be UPDATED: conda: 4.1.11-py35_0 --> 4.2.1-py35_0 conda-canary Proceed ([y]/n)? Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% C:\>conda update conda Fetching package metadata ...Uncaught backoff with errno 2 ...... # All requested packages already installed. # packages in environment at C:\Anaconda3: # conda 4.2.1 py35_0 conda-canary ``` Here's the `conda info -a` output: ``` C:\>conda info -a Current conda install: platform : win-64 conda version : 4.2.1 conda is private : False conda-env version : 2.5.2 conda-build version : not installed python version : 3.5.2.final.0 requests version : 2.10.0 root environment : C:\Anaconda3 (writable) default environment : C:\Anaconda3 envs directories : C:\Anaconda3\envs package cache : C:\Anaconda3\pkgs channel URLs : defaults config file : C:\Users\mwiebe\.condarc offline mode : False # conda environments: # root * C:\Anaconda3 sys.version: 3.5.2 |Continuum Analytics, Inc.| (defau... sys.prefix: C:\Anaconda3 sys.executable: C:\Anaconda3\python.exe conda location: C:\Anaconda3\lib\site-packages\conda conda-build: None conda-env: C:\Anaconda3\Scripts\conda-env.exe user site dirs: C:\Users\mwiebe\AppData\Roaming\Python\Python27 C:\Users\mwiebe\AppData\Roaming\Python\Scripts CIO_TEST: <not set> CONDA_DEFAULT_ENV: <not set> CONDA_ENVS_PATH: <not set> PATH: C:\Anaconda3\Library\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Gow\bin;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\CMake\bin;C:\Program Files (x86)\Skype\Phone\;C:\cygwin\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\HashiCorp\Vagrant\bin;C:\Anaconda3;C:\Anaconda3\Scripts;C:\Anaconda3\Library\bin;C:\Ruby22-x64\bin;C:\Users\mwiebe\bin;C:\Program Files\Docker Toolbox;C:\Users\mwiebe\AppData\Roaming\MiKTeX\2.9\miktex\bin\x64\;C:\Program Files\LAStools\bin PYTHONHOME: <not set> PYTHONPATH: <not set> WARNING: could not import _license.show_info # try: # $ conda install -n root _license ``` Thanks for pointing out the `Uncaught backoff with errno 2`. We've been having a lot of issues with files being locked on Windows, apparently by virus scanners. That's some of the background for that debug message. I'll look into it. I've got ESET Endpoint Antivirus on the machine. Much of the realtime scanning that intercepts email, filesystem access, etc is disabled though, I found it slowed things down too much and interfered with too many programs. I know what it is... I guess I can't use the `$HOME` environment variable on Windows, as I did [here](https://github.com/conda/conda/blob/master/conda/base/constants.py#L57). That's a great catch. I'll have the fixed in 4.2.2.
2016-08-04T03:41:28
conda/conda
3,257
conda__conda-3257
[ "3256" ]
83f397d3d596dedc93e0160104dad46c6bfdb7ef
diff --git a/conda/utils.py b/conda/utils.py --- a/conda/utils.py +++ b/conda/utils.py @@ -313,6 +313,12 @@ def human_bytes(n): "sh.exe": dict( msys2_shell_base, exe="sh.exe", ), + "zsh.exe": dict( + msys2_shell_base, exe="zsh.exe", + ), + "zsh": dict( + msys2_shell_base, exe="zsh", + ), } else:
Zsh.exe not supported on MSYS2 The following error is reported in a MSYS2 zsh shell: ``` ➜ dotfiles git:(master) ✗ source activate py35_32 Traceback (most recent call last): File "C:\Miniconda3\Scripts\conda-script.py", line 5, in <module> sys.exit(main()) File "C:\Miniconda3\lib\site-packages\conda\cli\main.py", line 48, in main activate.main() File "C:\Miniconda3\lib\site-packages\conda\cli\activate.py", line 105, in main shelldict = shells[shell] KeyError: 'zsh.exe' ```
2016-08-09T15:16:41
conda/conda
3,258
conda__conda-3258
[ "3253" ]
83f397d3d596dedc93e0160104dad46c6bfdb7ef
diff --git a/conda_env/specs/requirements.py b/conda_env/specs/requirements.py --- a/conda_env/specs/requirements.py +++ b/conda_env/specs/requirements.py @@ -37,6 +37,9 @@ def environment(self): dependencies = [] with open(self.filename) as reqfile: for line in reqfile: + line = line.strip() + if not line or line.startswith('#'): + continue dependencies.append(line) return env.Environment( name=self.name,
conda canary - unable to create environment yml file I just did ` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda/logs $ conda env export > ../manage/config/environment-anabase-1.0.0.yml` anabase is the environment, I also add the account, psreldev, that I'm logged into, and got this output ``` n unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Current conda install: platform : linux-64 conda version : 4.2.1 conda is private : False conda-env version : 2.5.2 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anabase envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 file:///reg/g/psdm/sw/conda/channels/external-rhel7 defaults scikit-beam file:///reg/g/psdm/sw/conda/channels/testing-rhel7 config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc offline mode : False `$ /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-env export` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 403, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_env/cli/main_export.py", line 93, in execute ignore_channels=args.ignore_prefix) AttributeError: 'Namespace' object has no attribute 'ignore_prefix' ../manage/config/environment-anabase-1.0.0.yml (END) ``` Here is the environment, if this matters - there is one pip in there, nose2 ``` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda/logs $ conda list # packages in environment at /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anabase: # backports 1.0 py27_0 boost 1.57.0 4 cairo 1.12.18 6 coverage 4.1 py27_0 cycler 0.10.0 py27_0 cython 0.24.1 py27_0 decorator 4.0.10 py27_0 szip 2.1 100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 h5py 2.5.0 py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5 1.8.17 openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mpi4py 2.0.0 py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openmpi 1.10.3 lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tables 3.2.3.1 py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 fontconfig 2.11.1 6 freetype 2.5.5 1 get_terminal_size 1.0.0 py27_0 glib 2.43.0 1 harfbuzz 0.9.39 1 icu 54.1 0 ipython 5.0.0 py27_0 ipython_genutils 0.1.0 py27_0 jbig 2.1 0 jinja2 2.8 py27_1 jpeg 8d 1 libffi 3.2.1 0 libgfortran 3.0.0 1 libpng 1.6.22 0 libsodium 1.0.10 0 libtiff 4.0.6 2 libxml2 2.9.2 0 markupsafe 0.23 py27_2 matplotlib 1.5.1 np111py27_0 mkl 11.3.3 0 mysql 5.5.24 0 networkx 1.11 py27_0 nose 1.3.7 py27_1 nose2 0.6.5 <pip> numexpr 2.6.1 np111py27_0 numpy 1.11.1 py27_0 openssl 1.0.2h 1 pandas 0.18.1 np111py27_0 pango 1.39.0 1 path.py 8.2.1 py27_0 pathlib2 2.1.0 py27_0 pexpect 4.0.1 py27_0 pickleshare 0.7.3 py27_0 pillow 3.3.0 py27_0 pip 8.1.2 py27_0 pixman 0.32.6 0 prompt_toolkit 1.0.3 py27_0 ptyprocess 0.5.1 py27_0 pycairo 1.10.0 py27_0 pygments 2.1.3 py27_0 pyparsing 2.1.4 py27_0 pyqt 4.11.4 py27_4 pyqtgraph 0.9.10 py27_1 python 2.7.12 1 python-dateutil 2.5.3 py27_0 pytz 2016.6.1 py27_0 pyzmq 15.3.0 py27_0 qt 4.8.5 0 readline 6.2 2 lmfit 0.8.3 py27_0 scikit-beam scikit-beam 0.0.8 py27_0 scikit-beam xraylib 3.1.0 nppy27_0 scikit-beam scikit-image 0.12.3 np111py27_1 scikit-learn 0.17.1 np111py27_2 scipy 0.18.0 np111py27_0 scons 2.3.0 py27_0 setuptools 23.0.0 py27_0 simplegeneric 0.8.1 py27_1 sip 4.18 py27_0 six 1.10.0 py27_0 sqlite 3.13.0 0 tk 8.5.18 0 traitlets 4.2.2 py27_0 wcwidth 0.1.7 py27_0 wheel 0.29.0 py27_0 xz 5.2.2 0 zeromq 4.1.4 0 zlib 1.2.8 3 ```
Perhaps related to above, after I create the environment file with the non-canaray conda, i.e, ``` anabase) (psreldev) psdev105: /reg/g/psdm/sw/conda $ conda info Current conda install: platform : linux-64 conda version : 4.1.11 conda-env version : 2.5.2 conda-build version : 1.21.9 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs/anabase envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel6/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel6/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel6/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://conda.anaconda.org/t/<TOKEN>/scikit-beam/linux-64/ https://conda.anaconda.org/t/<TOKEN>/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/.condarc offline mode : False is foreign system : False ``` I am unable to create a new environment from it, I get the message: ``` Error: Packages missing in current linux-64 channels: - file:///reg/g/psdm/sw/conda/channels/external-rhel6::szip 2.1 100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::h5py 2.5.0 py27_hdf518_mpi4py2_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::hdf5 1.8.17 openmpi_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::mpi4py 2.0.0 py27_openmpi_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::openmpi 1.10.3 lsf_verbs_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::tables 3.2.3.1 py27_hdf18_100 - scikit-beam::lmfit 0.8.3 py27_0 - scikit-beam::scikit-beam 0.0.8 py27_0 - scikit-beam::xraylib 3.1.0 nppy27_0 ``` but the packages are there, for instance I can create an environment with szip: ``` anabase) (psreldev) psdev105: /reg/g/psdm/sw/conda $ conda create -n szip szip=2.1=100 Package plan for installation in environment /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs/szip: The following NEW packages will be INSTALLED: szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel6 Proceed ([y]/n)? n ``` Following along on this page http://conda.pydata.org/docs/using/envs.html#export-the-environment-file I tried to create an environment from a spec file, but I got errors about the lines with comments: `````` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda $ conda list -e > manage/config/spec-file-anabase-1.0.0.txt (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda $ conda env create --name ana-1.0.0 --file manage/config/spec-file-anabase-1.0.0.txt Using Anaconda API: https://api.anaconda.org Value error: invalid package specification: # This file may be used to create an environment using: ```after deleting the initial header lines that had # in the front, it seems to be working `````` For the first bug you got, it is caused by a wrong attribute in a NameSpace, please refer to [here](https://github.com/conda/conda/blob/4.2.1/conda_env/cli/main_export.py#L93), it should be args.ignore_channels, instead of ignore_prefix For the second bug, cannot create env from .txt file, it is caused by NoneType Error, please refer to [here](https://github.com/conda/conda/blob/4.1.x/conda/cli/common.py#L479). This is an error for conda 4.1.x. After strip the comment, the result may be None. However, it forward to MatchSpec class without None-checking, as a result, it will leads to a NoneType-related exception, and raise a CondaValue error
2016-08-09T15:51:07
conda/conda
3,259
conda__conda-3259
[ "3253" ]
83f397d3d596dedc93e0160104dad46c6bfdb7ef
diff --git a/conda_env/cli/main_export.py b/conda_env/cli/main_export.py --- a/conda_env/cli/main_export.py +++ b/conda_env/cli/main_export.py @@ -90,7 +90,7 @@ def execute(args, parser): name = args.name prefix = get_prefix(args) env = from_environment(name, prefix, no_builds=args.no_builds, - ignore_channels=args.ignore_prefix) + ignore_channels=args.ignore_channels) if args.override_channels: env.remove_channels()
conda canary - unable to create environment yml file I just did ` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda/logs $ conda env export > ../manage/config/environment-anabase-1.0.0.yml` anabase is the environment, I also add the account, psreldev, that I'm logged into, and got this output ``` n unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Current conda install: platform : linux-64 conda version : 4.2.1 conda is private : False conda-env version : 2.5.2 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anabase envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 file:///reg/g/psdm/sw/conda/channels/external-rhel7 defaults scikit-beam file:///reg/g/psdm/sw/conda/channels/testing-rhel7 config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc offline mode : False `$ /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-env export` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 403, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_env/cli/main_export.py", line 93, in execute ignore_channels=args.ignore_prefix) AttributeError: 'Namespace' object has no attribute 'ignore_prefix' ../manage/config/environment-anabase-1.0.0.yml (END) ``` Here is the environment, if this matters - there is one pip in there, nose2 ``` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda/logs $ conda list # packages in environment at /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anabase: # backports 1.0 py27_0 boost 1.57.0 4 cairo 1.12.18 6 coverage 4.1 py27_0 cycler 0.10.0 py27_0 cython 0.24.1 py27_0 decorator 4.0.10 py27_0 szip 2.1 100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 h5py 2.5.0 py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5 1.8.17 openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mpi4py 2.0.0 py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openmpi 1.10.3 lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tables 3.2.3.1 py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 fontconfig 2.11.1 6 freetype 2.5.5 1 get_terminal_size 1.0.0 py27_0 glib 2.43.0 1 harfbuzz 0.9.39 1 icu 54.1 0 ipython 5.0.0 py27_0 ipython_genutils 0.1.0 py27_0 jbig 2.1 0 jinja2 2.8 py27_1 jpeg 8d 1 libffi 3.2.1 0 libgfortran 3.0.0 1 libpng 1.6.22 0 libsodium 1.0.10 0 libtiff 4.0.6 2 libxml2 2.9.2 0 markupsafe 0.23 py27_2 matplotlib 1.5.1 np111py27_0 mkl 11.3.3 0 mysql 5.5.24 0 networkx 1.11 py27_0 nose 1.3.7 py27_1 nose2 0.6.5 <pip> numexpr 2.6.1 np111py27_0 numpy 1.11.1 py27_0 openssl 1.0.2h 1 pandas 0.18.1 np111py27_0 pango 1.39.0 1 path.py 8.2.1 py27_0 pathlib2 2.1.0 py27_0 pexpect 4.0.1 py27_0 pickleshare 0.7.3 py27_0 pillow 3.3.0 py27_0 pip 8.1.2 py27_0 pixman 0.32.6 0 prompt_toolkit 1.0.3 py27_0 ptyprocess 0.5.1 py27_0 pycairo 1.10.0 py27_0 pygments 2.1.3 py27_0 pyparsing 2.1.4 py27_0 pyqt 4.11.4 py27_4 pyqtgraph 0.9.10 py27_1 python 2.7.12 1 python-dateutil 2.5.3 py27_0 pytz 2016.6.1 py27_0 pyzmq 15.3.0 py27_0 qt 4.8.5 0 readline 6.2 2 lmfit 0.8.3 py27_0 scikit-beam scikit-beam 0.0.8 py27_0 scikit-beam xraylib 3.1.0 nppy27_0 scikit-beam scikit-image 0.12.3 np111py27_1 scikit-learn 0.17.1 np111py27_2 scipy 0.18.0 np111py27_0 scons 2.3.0 py27_0 setuptools 23.0.0 py27_0 simplegeneric 0.8.1 py27_1 sip 4.18 py27_0 six 1.10.0 py27_0 sqlite 3.13.0 0 tk 8.5.18 0 traitlets 4.2.2 py27_0 wcwidth 0.1.7 py27_0 wheel 0.29.0 py27_0 xz 5.2.2 0 zeromq 4.1.4 0 zlib 1.2.8 3 ```
Perhaps related to above, after I create the environment file with the non-canaray conda, i.e, ``` anabase) (psreldev) psdev105: /reg/g/psdm/sw/conda $ conda info Current conda install: platform : linux-64 conda version : 4.1.11 conda-env version : 2.5.2 conda-build version : 1.21.9 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs/anabase envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel6/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel6/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel6/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel6/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://conda.anaconda.org/t/<TOKEN>/scikit-beam/linux-64/ https://conda.anaconda.org/t/<TOKEN>/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/.condarc offline mode : False is foreign system : False ``` I am unable to create a new environment from it, I get the message: ``` Error: Packages missing in current linux-64 channels: - file:///reg/g/psdm/sw/conda/channels/external-rhel6::szip 2.1 100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::h5py 2.5.0 py27_hdf518_mpi4py2_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::hdf5 1.8.17 openmpi_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::mpi4py 2.0.0 py27_openmpi_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::openmpi 1.10.3 lsf_verbs_100 - file:///reg/g/psdm/sw/conda/channels/system-rhel6::tables 3.2.3.1 py27_hdf18_100 - scikit-beam::lmfit 0.8.3 py27_0 - scikit-beam::scikit-beam 0.0.8 py27_0 - scikit-beam::xraylib 3.1.0 nppy27_0 ``` but the packages are there, for instance I can create an environment with szip: ``` anabase) (psreldev) psdev105: /reg/g/psdm/sw/conda $ conda create -n szip szip=2.1=100 Package plan for installation in environment /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel6/envs/szip: The following NEW packages will be INSTALLED: szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel6 Proceed ([y]/n)? n ``` Following along on this page http://conda.pydata.org/docs/using/envs.html#export-the-environment-file I tried to create an environment from a spec file, but I got errors about the lines with comments: `````` (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda $ conda list -e > manage/config/spec-file-anabase-1.0.0.txt (anabase) (psreldev) psel701: /reg/g/psdm/sw/conda $ conda env create --name ana-1.0.0 --file manage/config/spec-file-anabase-1.0.0.txt Using Anaconda API: https://api.anaconda.org Value error: invalid package specification: # This file may be used to create an environment using: ```after deleting the initial header lines that had # in the front, it seems to be working `````` For the first bug you got, it is caused by a wrong attribute in a NameSpace, please refer to [here](https://github.com/conda/conda/blob/4.2.1/conda_env/cli/main_export.py#L93), it should be args.ignore_channels, instead of ignore_prefix For the second bug, cannot create env from .txt file, it is caused by NoneType Error, please refer to [here](https://github.com/conda/conda/blob/4.1.x/conda/cli/common.py#L479). This is an error for conda 4.1.x. After strip the comment, the result may be None. However, it forward to MatchSpec class without None-checking, as a result, it will leads to a NoneType-related exception, and raise a CondaValue error
2016-08-09T15:53:54
conda/conda
3,326
conda__conda-3326
[ "3307", "3307" ]
550d679e447b02781caeb348aa89370a62ffa400
diff --git a/conda/lock.py b/conda/lock.py --- a/conda/lock.py +++ b/conda/lock.py @@ -45,8 +45,11 @@ def touch(file_name, times=None): Examples: touch("hello_world.py") """ - with open(file_name, 'a'): - os.utime(file_name, times) + try: + with open(file_name, 'a'): + os.utime(file_name, times) + except (OSError, IOError) as e: + log.warn("Failed to create lock, do not run conda in parallel process\n") class FileLock(object): @@ -111,11 +114,13 @@ def __init__(self, directory_path, retries=10): self.lock_file_path = "%s.pid{0}.%s" % (lock_path_pre, LOCK_EXTENSION) # e.g. if locking directory `/conda`, lock file will be `/conda/conda.pidXXXX.conda_lock` self.lock_file_glob_str = "%s.pid*.%s" % (lock_path_pre, LOCK_EXTENSION) + # make sure '/' exists assert isdir(dirname(self.directory_path)), "{0} doesn't exist".format(self.directory_path) if not isdir(self.directory_path): - os.makedirs(self.directory_path, exist_ok=True) - log.debug("forced to create %s", self.directory_path) - assert os.access(self.directory_path, os.W_OK), "%s not writable" % self.directory_path - + try: + os.makedirs(self.directory_path) + log.debug("forced to create %s", self.directory_path) + except (OSError, IOError) as e: + log.warn("Failed to create directory %s" % self.directory_path) Locked = DirectoryLock
diff --git a/tests/test_lock.py b/tests/test_lock.py --- a/tests/test_lock.py +++ b/tests/test_lock.py @@ -1,9 +1,12 @@ import pytest -from os.path import basename, join -from conda.lock import FileLock, LOCKSTR, LOCK_EXTENSION, LockError -from conda.install import on_win +from os.path import basename, join, exists, isfile +from conda.lock import FileLock, DirectoryLock, LockError + def test_filelock_passes(tmpdir): + """ + Normal test on file lock + """ package_name = "conda_file1" tmpfile = join(tmpdir.strpath, package_name) with FileLock(tmpfile) as lock: @@ -15,7 +18,10 @@ def test_filelock_passes(tmpdir): def test_filelock_locks(tmpdir): - + """ + Test on file lock, multiple lock on same file + Lock error should raised + """ package_name = "conda_file_2" tmpfile = join(tmpdir.strpath, package_name) with FileLock(tmpfile) as lock1: @@ -27,48 +33,42 @@ def test_filelock_locks(tmpdir): assert False # this should never happen assert lock2.path_to_lock == lock1.path_to_lock - if not on_win: - assert "LOCKERROR" in str(execinfo.value) - assert "conda is already doing something" in str(execinfo.value) assert tmpdir.join(path).exists() and tmpdir.join(path).isfile() # lock should clean up after itself assert not tmpdir.join(path).exists() -def test_filelock_folderlocks(tmpdir): - import os - package_name = "conda_file_2" +def test_folder_locks(tmpdir): + """ + Test on Directory lock + """ + package_name = "dir_1" tmpfile = join(tmpdir.strpath, package_name) - os.makedirs(tmpfile) - with FileLock(tmpfile) as lock1: - path = basename(lock1.lock_file_path) - assert tmpdir.join(path).exists() and tmpdir.join(path).isfile() + with DirectoryLock(tmpfile) as lock1: + + assert exists(lock1.lock_file_path) and isfile(lock1.lock_file_path) with pytest.raises(LockError) as execinfo: - with FileLock(tmpfile, retries=1) as lock2: + with DirectoryLock(tmpfile, retries=1) as lock2: assert False # this should never happen - assert lock2.path_to_lock == lock1.path_to_lock - - if not on_win: - assert "LOCKERROR" in str(execinfo.value) - assert "conda is already doing something" in str(execinfo.value) - assert lock1.path_to_lock in str(execinfo.value) - assert tmpdir.join(path).exists() and tmpdir.join(path).isfile() + assert exists(lock1.lock_file_path) and isfile(lock1.lock_file_path) # lock should clean up after itself - assert not tmpdir.join(path).exists() - - -def lock_thread(tmpdir, file_path): - with FileLock(file_path) as lock1: - path = basename(lock1.lock_file_path) - assert tmpdir.join(path).exists() and tmpdir.join(path).isfile() - assert not tmpdir.join(path).exists() + assert not exists(lock1.lock_file_path) def test_lock_thread(tmpdir): + """ + 2 thread want to lock a file + One thread will have LockError Raised + """ + def lock_thread(tmpdir, file_path): + with FileLock(file_path) as lock1: + path = basename(lock1.lock_file_path) + assert tmpdir.join(path).exists() and tmpdir.join(path).isfile() + assert not tmpdir.join(path).exists() from threading import Thread package_name = "conda_file_3" @@ -85,13 +85,17 @@ def test_lock_thread(tmpdir): assert not tmpdir.join(path).exists() -def lock_thread_retries(tmpdir, file_path): - with pytest.raises(LockError) as execinfo: - with FileLock(file_path, retries=0): - assert False # should never enter here, since max_tires is 0 - assert "LOCKERROR" in str(execinfo.value) - def test_lock_retries(tmpdir): + """ + 2 thread want to lock a same file + Lock has zero retries + One thread will have LockError raised + """ + def lock_thread_retries(tmpdir, file_path): + with pytest.raises(LockError) as execinfo: + with FileLock(file_path, retries=0): + assert False # should never enter here, since max_tires is 0 + assert "LOCKERROR" in str(execinfo.value) from threading import Thread package_name = "conda_file_3" @@ -106,3 +110,19 @@ def test_lock_retries(tmpdir): t.join() # lock should clean up after itself assert not tmpdir.join(path).exists() + + +def test_permission_file(): + """ + Test when lock cannot be created due to permission + Make sure no exception raised + """ + import tempfile + from conda.compat import text_type + with tempfile.NamedTemporaryFile(mode='r') as f: + if not isinstance(f.name, text_type): + return + with FileLock(f.name) as lock: + + path = basename(lock.lock_file_path) + assert not exists(join(f.name, path))
[Regression] Conda create environment fails on lock if root environment is not under user control This is "funny", but it seems that Conda managed to break this thing the second time in a month... #2681 was the previous one. This time, I get the following error: ``` $ conda create -n _root --yes --use-index-cache python=3 ... Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.5/site-packages/conda/exceptions.py", line 442, in conda_exception_handler return_value = func(*args, **kwargs) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/main_create.py", line 66, in execute install(args, parser, 'create') File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/install.py", line 399, in install execute_actions(actions, index, verbose=not args.quiet) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/plan.py", line 640, in execute_actions inst.execute_instructions(plan, index, verbose) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/instructions.py", line 77, in LINK_CMD link(state['prefix'], dist, lt, index=state['index']) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/install.py", line 1060, in link with DirectoryLock(prefix), FileLock(source_dir): File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 86, in __enter__ touch(self.lock_file_path) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): PermissionError: [Errno 13] Permission denied: '/usr/local/miniconda/pkgs/openssl-1.0.2h-1.pid34.conda_lock' ``` ``` Current conda install: platform : linux-64 conda version : 4.2.2 conda is private : False conda-env version : 2.6.0 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 3.5.2.final.0 requests version : 2.10.0 root environment : /usr/local/miniconda (read only) default environment : /usr/local/miniconda envs directories : /home/gitlab-ci/.conda/envs /usr/local/miniconda/envs package cache : /home/gitlab-ci/.conda/envs/.pkgs /usr/local/miniconda/pkgs channel URLs : defaults config file : None offline mode : False ``` /CC @kalefranz [Regression] Conda create environment fails on lock if root environment is not under user control This is "funny", but it seems that Conda managed to break this thing the second time in a month... #2681 was the previous one. This time, I get the following error: ``` $ conda create -n _root --yes --use-index-cache python=3 ... Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.5/site-packages/conda/exceptions.py", line 442, in conda_exception_handler return_value = func(*args, **kwargs) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/main_create.py", line 66, in execute install(args, parser, 'create') File "/usr/local/miniconda/lib/python3.5/site-packages/conda/cli/install.py", line 399, in install execute_actions(actions, index, verbose=not args.quiet) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/plan.py", line 640, in execute_actions inst.execute_instructions(plan, index, verbose) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/instructions.py", line 77, in LINK_CMD link(state['prefix'], dist, lt, index=state['index']) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/install.py", line 1060, in link with DirectoryLock(prefix), FileLock(source_dir): File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 86, in __enter__ touch(self.lock_file_path) File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): PermissionError: [Errno 13] Permission denied: '/usr/local/miniconda/pkgs/openssl-1.0.2h-1.pid34.conda_lock' ``` ``` Current conda install: platform : linux-64 conda version : 4.2.2 conda is private : False conda-env version : 2.6.0 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 3.5.2.final.0 requests version : 2.10.0 root environment : /usr/local/miniconda (read only) default environment : /usr/local/miniconda envs directories : /home/gitlab-ci/.conda/envs /usr/local/miniconda/envs package cache : /home/gitlab-ci/.conda/envs/.pkgs /usr/local/miniconda/pkgs channel URLs : defaults config file : None offline mode : False ``` /CC @kalefranz
@frol, First, **thanks for using canary**!! Do you know if a previous run of conda crashed, exited prematurely, or you sent a signal (i.e. ctrl-c) for it to exit early? Something made that lock file stick around... ``` conda clean --yes --lock ``` should take care of it for you. If it doesn't, that's definitely a bug. We're still working on tuning the locking in conda. It's (hopefully) better in 4.2 than it was in 4.1, and I know for sure it will be better yet in 4.3 with @HugoTian's work in #3197. @kalefranz The error message is quite informative: ``` File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): PermissionError: [Errno 13] Permission denied: '/usr/local/miniconda/pkgs/openssl-1.0.2h-1.pid34.conda_lock' ``` `/usr/local/miniconda` is a read-only directory, so there is no way `open(mode='a')` will ever succeed there. Ahh. This then is what I generally call "multi-user support." That is, install conda as one user, and use the executable as another but without write permissions to the conda executable's root environment. This used case has always been problematic, and it's s high priority to tackle and "get right" in the next several months. I think I just ran into this, created a env in a central install area, then from a user account tried to clone the environment, but it failed with something similar, doing `conda create --offline -n myrel --clone anarel-1.0.0 ` caused ``` ... WARNING conda.install:warn_failed_remove(178): Cannot remove, permission denied: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/psana-conda-1.0.0-py27_1/bin WARNING conda.install:warn_failed_remove(178): Cannot remove, permission denied: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/psana-conda-1.0.0-py27_1 Pruning fetched packages from the cache ... An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Current conda install: platform : linux-64 conda version : 4.2.3 conda is private : False conda-env version : 2.6.0 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (read only) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anarel-1.0.0 envs directories : /reg/neh/home/davidsch/.conda/envs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/neh/home/davidsch/.conda/envs/.pkgs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7 file:///reg/g/psdm/sw/conda/channels/external-rhel7 defaults file:///reg/g/psdm/sw/conda/channels/psana-rhel7 scikit-beam file:///reg/g/psdm/sw/conda/channels/testing-rhel7 config file : /reg/neh/home/davidsch/.condarc offline mode : False `$ /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anarel-1.0.0/bin/conda create --offline -n myrel --clone anarel-1.0.0` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 442, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main_create.py", line 66, in execute install(args, parser, 'create') File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 225, in install clone(args.clone, prefix, json=args.json, quiet=args.quiet, index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 90, in clone index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/misc.py", line 388, in clone_env force_extract=False, index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/misc.py", line 188, in explicit execute_actions(actions, index=index, verbose=verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 639, in execute_actions inst.execute_instructions(plan, index, verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 66, in RM_FETCHED_CMD rm_fetched(arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 801, in rm_fetched with FileLock(fname): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/lock.py", line 86, in __enter__ touch(self.lock_file_path) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): IOError: [Errno 13] Permission denied: u'/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/openmpi-1.10.3-lsf_verbs_100.tar.bz2.pid17825.conda_lock' ``` @HugoTian As part of the 4.2 release, I think we need a lock cleanup step in the exception handler that just attempts to clean up any lock files for the current pid before it ultimately exits. Do you agree? @kalefranz , Moreover, I think some how we need to bring back the try/except block when we create the lock file. Something like : ``` try: touch(****) except OSError: pass ``` @frol, First, **thanks for using canary**!! Do you know if a previous run of conda crashed, exited prematurely, or you sent a signal (i.e. ctrl-c) for it to exit early? Something made that lock file stick around... ``` conda clean --yes --lock ``` should take care of it for you. If it doesn't, that's definitely a bug. We're still working on tuning the locking in conda. It's (hopefully) better in 4.2 than it was in 4.1, and I know for sure it will be better yet in 4.3 with @HugoTian's work in #3197. @kalefranz The error message is quite informative: ``` File "/usr/local/miniconda/lib/python3.5/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): PermissionError: [Errno 13] Permission denied: '/usr/local/miniconda/pkgs/openssl-1.0.2h-1.pid34.conda_lock' ``` `/usr/local/miniconda` is a read-only directory, so there is no way `open(mode='a')` will ever succeed there. Ahh. This then is what I generally call "multi-user support." That is, install conda as one user, and use the executable as another but without write permissions to the conda executable's root environment. This used case has always been problematic, and it's s high priority to tackle and "get right" in the next several months. I think I just ran into this, created a env in a central install area, then from a user account tried to clone the environment, but it failed with something similar, doing `conda create --offline -n myrel --clone anarel-1.0.0 ` caused ``` ... WARNING conda.install:warn_failed_remove(178): Cannot remove, permission denied: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/psana-conda-1.0.0-py27_1/bin WARNING conda.install:warn_failed_remove(178): Cannot remove, permission denied: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/psana-conda-1.0.0-py27_1 Pruning fetched packages from the cache ... An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Current conda install: platform : linux-64 conda version : 4.2.3 conda is private : False conda-env version : 2.6.0 conda-build version : 1.21.11+0.g5b44ab3.dirty python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (read only) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anarel-1.0.0 envs directories : /reg/neh/home/davidsch/.conda/envs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/neh/home/davidsch/.conda/envs/.pkgs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7 file:///reg/g/psdm/sw/conda/channels/external-rhel7 defaults file:///reg/g/psdm/sw/conda/channels/psana-rhel7 scikit-beam file:///reg/g/psdm/sw/conda/channels/testing-rhel7 config file : /reg/neh/home/davidsch/.condarc offline mode : False `$ /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/anarel-1.0.0/bin/conda create --offline -n myrel --clone anarel-1.0.0` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 442, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main_create.py", line 66, in execute install(args, parser, 'create') File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 225, in install clone(args.clone, prefix, json=args.json, quiet=args.quiet, index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 90, in clone index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/misc.py", line 388, in clone_env force_extract=False, index_args=index_args) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/misc.py", line 188, in explicit execute_actions(actions, index=index, verbose=verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 639, in execute_actions inst.execute_instructions(plan, index, verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 66, in RM_FETCHED_CMD rm_fetched(arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 801, in rm_fetched with FileLock(fname): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/lock.py", line 86, in __enter__ touch(self.lock_file_path) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/lock.py", line 48, in touch with open(file_name, 'a'): IOError: [Errno 13] Permission denied: u'/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs/openmpi-1.10.3-lsf_verbs_100.tar.bz2.pid17825.conda_lock' ``` @HugoTian As part of the 4.2 release, I think we need a lock cleanup step in the exception handler that just attempts to clean up any lock files for the current pid before it ultimately exits. Do you agree? @kalefranz , Moreover, I think some how we need to bring back the try/except block when we create the lock file. Something like : ``` try: touch(****) except OSError: pass ```
2016-08-20T01:22:54
conda/conda
3,335
conda__conda-3335
[ "3332" ]
20e6122508e98f63b2cde8d03c58599d66f3f111
diff --git a/conda/fetch.py b/conda/fetch.py --- a/conda/fetch.py +++ b/conda/fetch.py @@ -351,7 +351,6 @@ def fetch_pkg(info, dst_dir=None, session=None): def download(url, dst_path, session=None, md5=None, urlstxt=False, retries=None): - assert "::" not in str(url), url assert "::" not in str(dst_path), str(dst_path) if not offline_keep(url): raise RuntimeError("Cannot download in offline mode: %s" % (url,))
URLs with :: are OK and should not raise assertion errors For conda-build's perl skeleton generator, we can end up with URLs like: http://api.metacpan.org/v0/module/Test::More Unfortunately, conda prevents us from actually using those URLs: ``` File "/Users/msarahan/miniconda2/lib/python2.7/site-packages/conda/fetch.py", line 354, in download assert "::" not in str(url), url AssertionError: http://api.metacpan.org/v0/module/Test::More ``` Please partially revert https://github.com/conda/conda/commit/39605e01ccd05b5af5ebeceeacaafe652f4b32e4
I believe I add this assertion, and I think it is fine to revert back or change it in a new PR.
2016-08-23T13:38:33
conda/conda
3,390
conda__conda-3390
[ "3282" ]
35c14b82aa582f17f37042ae15bcac9d9c0761df
diff --git a/conda/common/configuration.py b/conda/common/configuration.py --- a/conda/common/configuration.py +++ b/conda/common/configuration.py @@ -188,7 +188,7 @@ def __repr__(self): return text_type(vars(self)) @abstractmethod - def value(self, parameter_type): + def value(self, parameter_obj): raise NotImplementedError() @abstractmethod @@ -196,7 +196,7 @@ def keyflag(self): raise NotImplementedError() @abstractmethod - def valueflags(self, parameter_type): + def valueflags(self, parameter_obj): raise NotImplementedError() @classmethod @@ -209,14 +209,29 @@ def make_raw_parameters(cls, source, from_map): class EnvRawParameter(RawParameter): source = 'envvars' - def value(self, parameter_type): - return self.__important_split_value[0].strip() + def value(self, parameter_obj): + if hasattr(parameter_obj, 'string_delimiter'): + string_delimiter = getattr(parameter_obj, 'string_delimiter') + # TODO: add stripping of !important, !top, and !bottom + raw_value = self._raw_value + if string_delimiter in raw_value: + value = raw_value.split(string_delimiter) + else: + value = [raw_value] + return tuple(v.strip() for v in value) + else: + return self.__important_split_value[0].strip() def keyflag(self): return ParameterFlag.final if len(self.__important_split_value) >= 2 else None - def valueflags(self, parameter_type): - return None + def valueflags(self, parameter_obj): + if hasattr(parameter_obj, 'string_delimiter'): + string_delimiter = getattr(parameter_obj, 'string_delimiter') + # TODO: add stripping of !important, !top, and !bottom + return tuple('' for _ in self._raw_value.split(string_delimiter)) + else: + return self.__important_split_value[0].strip() @property def __important_split_value(self): @@ -233,13 +248,13 @@ def make_raw_parameters(cls, appname): class ArgParseRawParameter(RawParameter): source = 'cmd_line' - def value(self, parameter_type): + def value(self, parameter_obj): return make_immutable(self._raw_value) def keyflag(self): return None - def valueflags(self, parameter_type): + def valueflags(self, parameter_obj): return None @classmethod @@ -255,18 +270,18 @@ def __init__(self, source, key, raw_value, keycomment): self._keycomment = keycomment super(YamlRawParameter, self).__init__(source, key, raw_value) - def value(self, parameter_type): - self.__process(parameter_type) + def value(self, parameter_obj): + self.__process(parameter_obj) return self._value def keyflag(self): return ParameterFlag.from_string(self._keycomment) - def valueflags(self, parameter_type): - self.__process(parameter_type) + def valueflags(self, parameter_obj): + self.__process(parameter_obj) return self._valueflags - def __process(self, parameter_type): + def __process(self, parameter_obj): if hasattr(self, '_value'): return elif isinstance(self._raw_value, CommentedSeq): @@ -511,18 +526,17 @@ def __init__(self, default, aliases=(), validation=None, parameter_type=None): def _merge(self, matches): important_match = first(matches, self._match_key_is_important, default=None) if important_match is not None: - return important_match.value(self.__class__) + return important_match.value(self) last_match = last(matches, lambda x: x is not None, default=None) if last_match is not None: - return last_match.value(self.__class__) + return last_match.value(self) raise ThisShouldNeverHappenError() # pragma: no cover - @classmethod - def repr_raw(cls, raw_parameter): + def repr_raw(self, raw_parameter): return "%s: %s%s" % (raw_parameter.key, - cls._str_format_value(raw_parameter.value(cls)), - cls._str_format_flag(raw_parameter.keyflag())) + self._str_format_value(raw_parameter.value(self)), + self._str_format_flag(raw_parameter.keyflag())) class SequenceParameter(Parameter): @@ -531,7 +545,8 @@ class SequenceParameter(Parameter): """ _type = tuple - def __init__(self, element_type, default=(), aliases=(), validation=None): + def __init__(self, element_type, default=(), aliases=(), validation=None, + string_delimiter=','): """ Args: element_type (type or Iterable[type]): The generic type of each element in @@ -543,6 +558,7 @@ def __init__(self, element_type, default=(), aliases=(), validation=None): """ self._element_type = element_type + self.string_delimiter = string_delimiter super(SequenceParameter, self).__init__(default, aliases, validation) def collect_errors(self, instance, value, source="<<merged>>"): @@ -562,21 +578,21 @@ def _merge(self, matches): # get individual lines from important_matches that were marked important # these will be prepended to the final result - def get_marked_lines(match, marker): + def get_marked_lines(match, marker, parameter_obj): return tuple(line - for line, flag in zip(match.value(self.__class__), - match.valueflags(self.__class__)) + for line, flag in zip(match.value(parameter_obj), + match.valueflags(parameter_obj)) if flag is marker) - top_lines = concat(get_marked_lines(m, ParameterFlag.top) for m in relevant_matches) + top_lines = concat(get_marked_lines(m, ParameterFlag.top, self) for m in relevant_matches) # also get lines that were marked as bottom, but reverse the match order so that lines # coming earlier will ultimately be last - bottom_lines = concat(get_marked_lines(m, ParameterFlag.bottom) for m in + bottom_lines = concat(get_marked_lines(m, ParameterFlag.bottom, self) for m in reversed(relevant_matches)) # now, concat all lines, while reversing the matches # reverse because elements closer to the end of search path take precedence - all_lines = concat(m.value(self.__class__) for m in reversed(relevant_matches)) + all_lines = concat(m.value(self) for m in reversed(relevant_matches)) # stack top_lines + all_lines, then de-dupe top_deduped = tuple(unique(concatv(top_lines, all_lines))) @@ -586,19 +602,17 @@ def get_marked_lines(match, marker): # NOTE: for a line value marked both top and bottom, the bottom marker will win out # for the top marker to win out, we'd need one additional de-dupe step bottom_deduped = unique(concatv(reversed(tuple(bottom_lines)), reversed(top_deduped))) - # just reverse, and we're good to go return tuple(reversed(tuple(bottom_deduped))) - @classmethod - def repr_raw(cls, raw_parameter): + def repr_raw(self, raw_parameter): lines = list() lines.append("%s:%s" % (raw_parameter.key, - cls._str_format_flag(raw_parameter.keyflag()))) - for q, value in enumerate(raw_parameter.value(cls)): - valueflag = raw_parameter.valueflags(cls)[q] - lines.append(" - %s%s" % (cls._str_format_value(value), - cls._str_format_flag(valueflag))) + self._str_format_flag(raw_parameter.keyflag()))) + for q, value in enumerate(raw_parameter.value(self)): + valueflag = raw_parameter.valueflags(self)[q] + lines.append(" - %s%s" % (self._str_format_value(value), + self._str_format_flag(valueflag))) return '\n'.join(lines) @@ -635,25 +649,24 @@ def _merge(self, matches): # mapkeys with important matches def key_is_important(match, key): - return match.valueflags(self.__class__).get(key) is ParameterFlag.final + return match.valueflags(self).get(key) is ParameterFlag.final important_maps = tuple(dict((k, v) - for k, v in iteritems(match.value(self.__class__)) + for k, v in iteritems(match.value(self)) if key_is_important(match, k)) for match in relevant_matches) # dump all matches in a dict # then overwrite with important matches - return merge(concatv((m.value(self.__class__) for m in relevant_matches), + return merge(concatv((m.value(self) for m in relevant_matches), reversed(important_maps))) - @classmethod - def repr_raw(cls, raw_parameter): + def repr_raw(self, raw_parameter): lines = list() lines.append("%s:%s" % (raw_parameter.key, - cls._str_format_flag(raw_parameter.keyflag()))) - for valuekey, value in iteritems(raw_parameter.value(cls)): - valueflag = raw_parameter.valueflags(cls).get(valuekey) - lines.append(" %s: %s%s" % (valuekey, cls._str_format_value(value), - cls._str_format_flag(valueflag))) + self._str_format_flag(raw_parameter.keyflag()))) + for valuekey, value in iteritems(raw_parameter.value(self)): + valueflag = raw_parameter.valueflags(self).get(valuekey) + lines.append(" %s: %s%s" % (valuekey, self._str_format_value(value), + self._str_format_flag(valueflag))) return '\n'.join(lines) @@ -717,7 +730,7 @@ def check_source(self, source): if match is not None: try: - typed_value = typify_data_structure(match.value(parameter.__class__), + typed_value = typify_data_structure(match.value(parameter), parameter._element_type) except TypeCoercionError as e: validation_errors.append(CustomValidationError(match.key, e.value,
diff --git a/tests/common/test_configuration.py b/tests/common/test_configuration.py --- a/tests/common/test_configuration.py +++ b/tests/common/test_configuration.py @@ -128,7 +128,7 @@ } -class TestConfiguration(Configuration): +class SampleConfiguration(Configuration): always_yes = PrimitiveParameter(False, aliases=('always_yes_altname1', 'yes', 'always_yes_altname2')) changeps1 = PrimitiveParameter(True) @@ -148,13 +148,13 @@ def load_from_string_data(*seq): class ConfigurationTests(TestCase): def test_simple_merges_and_caching(self): - config = TestConfiguration()._add_raw_data(load_from_string_data('file1', 'file2')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('file1', 'file2')) assert config.changeps1 is False assert config.always_yes is True assert config.channels == ('porky', 'bugs', 'elmer', 'daffy', 'tweety') assert config.proxy_servers == {'http': 'marv', 'https': 'sam', 's3': 'pepé'} - config = TestConfiguration()._add_raw_data(load_from_string_data('file2', 'file1')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('file2', 'file1')) assert len(config._cache) == 0 assert config.changeps1 is False assert len(config._cache) == 1 @@ -166,7 +166,7 @@ def test_simple_merges_and_caching(self): assert config.proxy_servers == {'http': 'taz', 'https': 'sly', 's3': 'pepé'} def test_default_values(self): - config = TestConfiguration() + config = SampleConfiguration() assert config.channels == () assert config.always_yes is False assert config.proxy_servers == {} @@ -183,8 +183,7 @@ def make_key(appname, key): try: environ.update(test_dict) assert 'MYAPP_ALWAYS_YES' in environ - raw_data = load_from_string_data('file1', 'file2') - config = TestConfiguration(app_name=appname) + config = SampleConfiguration(app_name=appname) assert config.changeps1 is False assert config.always_yes is True finally: @@ -201,13 +200,42 @@ def make_key(appname, key): try: environ.update(test_dict) assert 'MYAPP_YES' in environ - raw_data = load_from_string_data('file1', 'file2') - config = TestConfiguration()._add_env_vars(appname) + config = SampleConfiguration()._add_env_vars(appname) assert config.always_yes is True assert config.changeps1 is False finally: [environ.pop(key) for key in test_dict] + def test_env_var_config_split_sequence(self): + def make_key(appname, key): + return "{0}_{1}".format(appname.upper(), key.upper()) + appname = "myapp" + test_dict = {} + test_dict[make_key(appname, 'channels')] = 'channel1,channel2' + + try: + environ.update(test_dict) + assert 'MYAPP_CHANNELS' in environ + config = SampleConfiguration()._add_env_vars(appname) + assert config.channels == ('channel1', 'channel2') + finally: + [environ.pop(key) for key in test_dict] + + def test_env_var_config_no_split_sequence(self): + def make_key(appname, key): + return "{0}_{1}".format(appname.upper(), key.upper()) + appname = "myapp" + test_dict = {} + test_dict[make_key(appname, 'channels')] = 'channel1' + + try: + environ.update(test_dict) + assert 'MYAPP_CHANNELS' in environ + config = SampleConfiguration()._add_env_vars(appname) + assert config.channels == ('channel1',) + finally: + [environ.pop(key) for key in test_dict] + def test_load_raw_configs(self): try: tempdir = mkdtemp() @@ -232,7 +260,7 @@ def test_load_raw_configs(self): assert raw_data[f1]['always_yes'].value(None) == "no" assert raw_data[f2]['proxy_servers'].value(None)['http'] == "marv" - config = TestConfiguration(search_path) + config = SampleConfiguration(search_path) assert config.channels == ('wile', 'porky', 'bugs', 'elmer', 'daffy', 'tweety', 'foghorn') @@ -241,105 +269,105 @@ def test_load_raw_configs(self): def test_important_primitive_map_merges(self): raw_data = load_from_string_data('file1', 'file3', 'file2') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.channels == ('wile', 'porky', 'bugs', 'elmer', 'daffy', 'foghorn', 'tweety') assert config.proxy_servers == {'http': 'foghorn', 'https': 'sam', 's3': 'porky'} raw_data = load_from_string_data('file3', 'file2', 'file1') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.channels == ('wile', 'bugs', 'daffy', 'tweety', 'porky', 'elmer', 'foghorn') assert config.proxy_servers == {'http': 'foghorn', 'https': 'sly', 's3': 'pepé'} raw_data = load_from_string_data('file4', 'file3', 'file1') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.proxy_servers == {'https': 'daffy', 'http': 'bugs'} raw_data = load_from_string_data('file1', 'file4', 'file3', 'file2') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.proxy_servers == {'http': 'bugs', 'https': 'daffy', 's3': 'pepé'} raw_data = load_from_string_data('file1', 'file2', 'file3', 'file4') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.proxy_servers == {'https': 'daffy', 'http': 'foghorn', 's3': 'porky'} raw_data = load_from_string_data('file3', 'file1') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is True assert config.always_yes is True assert config.proxy_servers == {'https': 'sly', 'http': 'foghorn', 's3': 'pepé'} raw_data = load_from_string_data('file4', 'file3') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.changeps1 is False assert config.always_yes is True assert config.proxy_servers == {'http': 'bugs', 'https': 'daffy'} def test_list_merges(self): raw_data = load_from_string_data('file5', 'file3') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('marv', 'wile', 'daffy', 'foghorn', 'pepé', 'sam') raw_data = load_from_string_data('file6', 'file5', 'file4', 'file3') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('pepé', 'sam', 'elmer', 'bugs', 'marv') raw_data = load_from_string_data('file3', 'file4', 'file5', 'file6') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('wile', 'pepé', 'marv', 'sam', 'daffy', 'foghorn') raw_data = load_from_string_data('file6', 'file3', 'file4', 'file5') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('wile', 'pepé', 'sam', 'daffy', 'foghorn', 'elmer', 'bugs', 'marv') raw_data = load_from_string_data('file7', 'file8', 'file9') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('sam', 'marv', 'wile', 'foghorn', 'daffy', 'pepé') raw_data = load_from_string_data('file7', 'file9', 'file8') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('sam', 'marv', 'pepé', 'wile', 'foghorn', 'daffy') raw_data = load_from_string_data('file8', 'file7', 'file9') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('marv', 'sam', 'wile', 'foghorn', 'daffy', 'pepé') raw_data = load_from_string_data('file8', 'file9', 'file7') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('marv', 'sam', 'wile', 'daffy', 'pepé') raw_data = load_from_string_data('file9', 'file7', 'file8') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('marv', 'sam', 'pepé', 'daffy') raw_data = load_from_string_data('file9', 'file8', 'file7') - config = TestConfiguration()._add_raw_data(raw_data) + config = SampleConfiguration()._add_raw_data(raw_data) assert config.channels == ('marv', 'sam', 'pepé', 'daffy') def test_validation(self): - config = TestConfiguration()._add_raw_data(load_from_string_data('bad_boolean')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('bad_boolean')) raises(ValidationError, lambda: config.always_yes) - config = TestConfiguration()._add_raw_data(load_from_string_data('too_many_aliases')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('too_many_aliases')) raises(ValidationError, lambda: config.always_yes) - config = TestConfiguration()._add_raw_data(load_from_string_data('not_an_int')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('not_an_int')) raises(ValidationError, lambda: config.always_an_int) - config = TestConfiguration()._add_raw_data(load_from_string_data('bad_boolean_map')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('bad_boolean_map')) raises(ValidationError, lambda: config.boolean_map) - config = TestConfiguration()._add_raw_data(load_from_string_data('good_boolean_map')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('good_boolean_map')) assert config.boolean_map['a_true'] is True assert config.boolean_map['a_yes'] is True assert config.boolean_map['a_1'] is True @@ -351,10 +379,10 @@ def test_parameter(self): assert ParameterFlag.from_name('top') is ParameterFlag.top def test_validate_all(self): - config = TestConfiguration()._add_raw_data(load_from_string_data('file1')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('file1')) config.validate_all() - config = TestConfiguration()._add_raw_data(load_from_string_data('bad_boolean_map')) + config = SampleConfiguration()._add_raw_data(load_from_string_data('bad_boolean_map')) raises(ValidationError, config.validate_all) def test_cross_parameter_validation(self): diff --git a/tests/conda_env/support/notebook.ipynb b/tests/conda_env/support/notebook.ipynb --- a/tests/conda_env/support/notebook.ipynb +++ b/tests/conda_env/support/notebook.ipynb @@ -1 +1 @@ -{"nbformat": 3, "nbformat_minor": 0, "worksheets": [{"cells": []}], "metadata": {"name": "", "signature": ""}} \ No newline at end of file +{"nbformat": 3, "worksheets": [{"cells": []}], "metadata": {"signature": "", "name": ""}, "nbformat_minor": 0} \ No newline at end of file
CONDA_CHANNELS environment variable doesn't work fixed with #3390
2016-09-06T21:54:02
conda/conda
3,395
conda__conda-3395
[ "3203" ]
9c1750349b4c1d66a9caf95d21a9edf90e1eb9cf
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -20,10 +20,10 @@ log = getLogger(__name__) - -default_python = '%d.%d' % sys.version_info[:2] - -# ----- operating system and architecture ----- +try: + import cio_test # NOQA +except ImportError: + log.info("No cio_test package found.") _platform_map = { 'linux2': 'linux', @@ -40,8 +40,6 @@ class Context(Configuration): - default_python = property(lambda self: default_python) - add_anaconda_token = PrimitiveParameter(True, aliases=('add_binstar_token',)) add_pip_as_python_dependency = PrimitiveParameter(True) allow_softlinks = PrimitiveParameter(True) @@ -79,6 +77,11 @@ class Context(Configuration): binstar_upload = PrimitiveParameter(None, aliases=('anaconda_upload',), parameter_type=(bool, NoneType)) + @property + def default_python(self): + ver = sys.version_info + return '%d.%d' % (ver.major, ver.minor) + @property def arch_name(self): m = machine() diff --git a/conda/config.py b/conda/config.py --- a/conda/config.py +++ b/conda/config.py @@ -106,5 +106,5 @@ def get_rc_path(): # put back because of conda build -default_python = context. default_python +default_python = context.default_python binstar_upload = context.binstar_upload
Conda 4.2 branch doesn't support CIO_TEST. In config.py in `conda 4.1.x` I see: ``` def get_channel_urls(platform=None): if os.getenv('CIO_TEST'): import cio_test base_urls = cio_test.base_urls ``` cio_test is not imported anywhere in 4.2.
I need to discuss with Ilan. Didn't get a chance today. No problem, I've been using `4.1.x` when I need to build those packages anyway.
2016-09-07T15:08:31
conda/conda
3,412
conda__conda-3412
[ "3409", "3409" ]
2dd399d86344c8cb8a2fae41f991f8585e73ec9f
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -15,7 +15,7 @@ from difflib import get_close_matches from os.path import abspath, basename, exists, isdir, join -from .. import CondaError, text_type +from .. import text_type from .._vendor.auxlib.ish import dals from ..api import get_index from ..base.constants import ROOT_ENV_NAME @@ -367,7 +367,7 @@ def install(args, parser, command='install'): # Unsatisfiable package specifications/no such revision/import error if e.args and 'could not import' in e.args[0]: raise CondaImportError(text_type(e)) - raise CondaError('UnsatisfiableSpecifications', e) + raise if nothing_to_do(actions) and not newenv: from .main_list import print_packages
unsatisfiability crashes conda canary 4.2.5, rather than giving error output I have a python 3 environment, with the lastest conda in conda-canary, that is ``` Current conda install: platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 1.19.2 python version : 2.7.12.final.0 requests version : 2.10.0 ``` If I try to install something that won't fit, for instance ``` conda install MySQL-python ``` then I get ``` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 471, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main_install.py", line 80, in execute install(args, parser, 'install') File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 370, in install raise CondaError('UnsatisfiableSpecifications', e) TypeError: __init__() takes exactly 2 arguments (3 given) ``` unsatisfiability crashes conda canary 4.2.5, rather than giving error output I have a python 3 environment, with the lastest conda in conda-canary, that is ``` Current conda install: platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 1.19.2 python version : 2.7.12.final.0 requests version : 2.10.0 ``` If I try to install something that won't fit, for instance ``` conda install MySQL-python ``` then I get ``` Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/exceptions.py", line 471, in conda_exception_handler return_value = func(*args, **kwargs) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/main_install.py", line 80, in execute install(args, parser, 'install') File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/cli/install.py", line 370, in install raise CondaError('UnsatisfiableSpecifications', e) TypeError: __init__() takes exactly 2 arguments (3 given) ```
2016-09-13T00:09:16
conda/conda
3,413
conda__conda-3413
[ "3408", "3408" ]
2dd399d86344c8cb8a2fae41f991f8585e73ec9f
diff --git a/conda/common/disk.py b/conda/common/disk.py --- a/conda/common/disk.py +++ b/conda/common/disk.py @@ -192,7 +192,7 @@ def rm_rf(path, max_retries=5, trash=True): move_result = move_path_to_trash(path) if move_result: return True - log.warn("Failed to remove %s.", path) + log.info("Failed to remove %s.", path) elif isdir(path): try: @@ -212,7 +212,7 @@ def rm_rf(path, max_retries=5, trash=True): return True finally: if exists(path): - log.error("rm_rf failed for %s", path) + log.info("rm_rf failed for %s", path) return False
unexpected file locking warnings and errors - nuissance messages I am getting errors and warnings related to locking when I activate an environment as a user. The only other activity that is going on is that the account used to manage the central install is running conda build to build a package - but it is doing so from an environment called 'manage' that is distinct from the environment the user account is trying to activate. I would call these nuisance messages since I am able to activate the environment. Here is conda info ``` (ana-1.0.0) psanaphi101: ~/mlearn $ conda info Current conda install: platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 1.19.2 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (read only) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0 envs directories : /reg/neh/home/davidsch/.conda/envs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/neh/home/davidsch/.conda/envs/.pkgs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/ https://conda.anaconda.org/scikit-beam/linux-64/ https://conda.anaconda.org/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/neh/home/davidsch/.condarc offline mode : False ``` and here is the output when activating the environment ``` psanaphi101: ~ $ source activate ana-1.0.0 -bash: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/python: bad interpreter: No such file or directory psanaphi101: ~ $ source activate ana-1.0.0 WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/conda. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/conda WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/activate. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/activate WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/deactivate. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/deactivate ``` unexpected file locking warnings and errors - nuissance messages I am getting errors and warnings related to locking when I activate an environment as a user. The only other activity that is going on is that the account used to manage the central install is running conda build to build a package - but it is doing so from an environment called 'manage' that is distinct from the environment the user account is trying to activate. I would call these nuisance messages since I am able to activate the environment. Here is conda info ``` (ana-1.0.0) psanaphi101: ~/mlearn $ conda info Current conda install: platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 1.19.2 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (read only) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0 envs directories : /reg/neh/home/davidsch/.conda/envs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/neh/home/davidsch/.conda/envs/.pkgs /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/ https://conda.anaconda.org/scikit-beam/linux-64/ https://conda.anaconda.org/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/neh/home/davidsch/.condarc offline mode : False ``` and here is the output when activating the environment ``` psanaphi101: ~ $ source activate ana-1.0.0 -bash: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda: /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/python: bad interpreter: No such file or directory psanaphi101: ~ $ source activate ana-1.0.0 WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/conda. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/conda WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/activate. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/activate WARNING conda.common.disk:rm_rf(195): Failed to remove /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/deactivate. ERROR conda.common.disk:rm_rf(215): rm_rf failed for /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs/ana-1.0.0/bin/deactivate ```
2016-09-13T00:24:38
conda/conda
3,416
conda__conda-3416
[ "3407", "3407" ]
f1a591d5a5afd707dc38386d7504ebcf974f22c0
diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -128,8 +128,9 @@ def __init__(self, *args, **kwargs): class PaddingError(CondaError): - def __init__(self, *args): - msg = 'Padding error: %s' % ' '.join(text_type(arg) for arg in self.args) + def __init__(self, dist, placeholder, placeholder_length): + msg = ("Placeholder of length '%d' too short in package %s.\n" + "The package must be rebuilt with conda-build > 2.0." % (placeholder_length, dist)) super(PaddingError, self).__init__(msg) diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -248,6 +248,10 @@ def parse_line(line): return {pr.filepath: (pr.placeholder, pr.filemode) for pr in parsed_lines} +class _PaddingError(Exception): + pass + + def binary_replace(data, a, b): """ Perform a binary replacement of `data`, where the placeholder `a` is @@ -261,7 +265,7 @@ def replace(match): occurances = match.group().count(a) padding = (len(a) - len(b))*occurances if padding < 0: - raise PaddingError(a, b, padding) + raise _PaddingError return match.group().replace(a, b) + b'\0' * padding original_data_len = len(data) @@ -968,9 +972,8 @@ def link(prefix, dist, linktype=LINK_HARD, index=None): placeholder, mode = has_prefix_files[filepath] try: update_prefix(join(prefix, filepath), prefix, placeholder, mode) - except PaddingError: - raise PaddingError("ERROR: placeholder '%s' too short in: %s\n" % - (placeholder, dist)) + except _PaddingError: + raise PaddingError(dist, placeholder, len(placeholder)) # make sure that the child environment behaves like the parent, # wrt user/system install on win
diff --git a/tests/test_install.py b/tests/test_install.py --- a/tests/test_install.py +++ b/tests/test_install.py @@ -18,7 +18,8 @@ from conda.fetch import download from conda.install import (FileMode, PaddingError, binary_replace, dist2dirname, dist2filename, dist2name, dist2pair, dist2quad, name_dist, on_win, - read_no_link, update_prefix, warn_failed_remove, yield_lines) + read_no_link, update_prefix, warn_failed_remove, yield_lines, + _PaddingError) from contextlib import contextmanager from os import chdir, getcwd, makedirs from os.path import dirname, exists, join, relpath @@ -46,7 +47,7 @@ def test_shorter(self): b'xxxbbbbxyz\x00\x00zz') def test_too_long(self): - self.assertRaises(PaddingError, binary_replace, + self.assertRaises(_PaddingError, binary_replace, b'xxxaaaaaxyz\x00zz', b'aaaaa', b'bbbbbbbb') def test_no_extra(self): @@ -71,7 +72,7 @@ def test_multiple(self): self.assertEqual( binary_replace(b'aaaacaaaa\x00', b'aaaa', b'bbb'), b'bbbcbbb\x00\x00\x00') - self.assertRaises(PaddingError, binary_replace, + self.assertRaises(_PaddingError, binary_replace, b'aaaacaaaa\x00', b'aaaa', b'bbbbb') @pytest.mark.skipif(not on_win, reason="exe entry points only necessary on win")
conda build - exception - padding error I just updated to the lastest conda-build in defaults, and latest conda conda-env in conda canary, when I run conda build I am getting a 'package error'. Here is my conda environemnt: ``` platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 2.0.1 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://conda.anaconda.org/scikit-beam/linux-64/ https://conda.anaconda.org/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc offline mode : False ``` and here is the build output ``` SIT_ARCH=x86_64-rhel7-gcc48-opt conda build -c file:///reg/g/psdm/sw/conda/channels/system-rhel7 -c file:///reg/g/psdm/sw/conda/channels/psana-rhel7 -c file:///reg/g/psdm/sw/conda/channels/external-rhel7 --quiet recipes/psana/psana-conda-opt 2>&1 | tee -a /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/environ.py:303: UserWarning: The environment variable 'SIT_ROOT' is undefined. UserWarning BUILD START: psana-conda-1.0.2-py27_1 (actual version deferred until further download or env creation) The following NEW packages will be INSTALLED: boost: 1.57.0-4 cairo: 1.12.18-6 cycler: 0.10.0-py27_0 cython: 0.24.1-py27_0 fontconfig: 2.11.1-6 freetype: 2.5.5-1 h5py: 2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5: 1.8.17-openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 icu: 54.1-0 libgfortran: 3.0.0-1 libpng: 1.6.22-0 libsodium: 1.0.10-0 libxml2: 2.9.2-0 matplotlib: 1.5.1-np111py27_0 mkl: 11.3.3-0 mpi4py: 2.0.0-py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mysql: 5.5.24-0 ndarray: 1.1.5-0 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 numexpr: 2.6.1-np111py27_0 numpy: 1.11.1-py27_0 openmpi: 1.10.3-lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openssl: 1.0.2h-1 pip: 8.1.2-py27_0 pixman: 0.32.6-0 pycairo: 1.10.0-py27_0 pyparsing: 2.1.4-py27_0 pyqt: 4.11.4-py27_4 python: 2.7.12-1 python-dateutil: 2.5.3-py27_0 pytz: 2016.6.1-py27_0 pyzmq: 15.4.0-py27_0 qt: 4.8.5-0 readline: 6.2-2 scipy: 0.18.0-np111py27_0 scons: 2.3.0-py27_0 setuptools: 26.1.1-py27_0 sip: 4.18-py27_0 six: 1.10.0-py27_0 sqlite: 3.13.0-0 szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 tables: 3.2.3.1-py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tk: 8.5.18-0 wheel: 0.29.0-py27_0 zeromq: 4.1.4-0 zlib: 1.2.8-3 The following NEW packages will be INSTALLED: boost: 1.57.0-4 cairo: 1.12.18-6 cycler: 0.10.0-py27_0 cython: 0.24.1-py27_0 fontconfig: 2.11.1-6 freetype: 2.5.5-1 h5py: 2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5: 1.8.17-openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 icu: 54.1-0 libgfortran: 3.0.0-1 libpng: 1.6.22-0 libsodium: 1.0.10-0 libxml2: 2.9.2-0 matplotlib: 1.5.1-np111py27_0 mkl: 11.3.3-0 mpi4py: 2.0.0-py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mysql: 5.5.24-0 ndarray: 1.1.5-0 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 numexpr: 2.6.1-np111py27_0 numpy: 1.11.1-py27_0 openmpi: 1.10.3-lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openssl: 1.0.2h-1 pip: 8.1.2-py27_0 pixman: 0.32.6-0 pycairo: 1.10.0-py27_0 pyparsing: 2.1.4-py27_0 pyqt: 4.11.4-py27_4 python: 2.7.12-1 python-dateutil: 2.5.3-py27_0 pytz: 2016.6.1-py27_0 pyzmq: 15.4.0-py27_0 qt: 4.8.5-0 readline: 6.2-2 scipy: 0.18.0-np111py27_0 scons: 2.3.0-py27_0 setuptools: 26.1.1-py27_0 sip: 4.18-py27_0 six: 1.10.0-py27_0 sqlite: 3.13.0-0 szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 tables: 3.2.3.1-py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tk: 8.5.18-0 wheel: 0.29.0-py27_0 zeromq: 4.1.4-0 zlib: 1.2.8-3 Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-build", line 6, in <module> sys.exit(conda_build.cli.main_build.main()) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 239, in main execute(sys.argv[1:]) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 231, in execute already_built=None, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/api.py", line 83, in build need_source_download=need_source_download, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 998, in build_tree config=recipe_config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 558, in build create_env(config.build_prefix, specs, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 451, in create_env clear_cache=clear_cache) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 427, in create_env plan.execute_actions(actions, index, verbose=config.debug) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 643, in execute_actions inst.execute_instructions(plan, index, verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 77, in LINK_CMD link(state['prefix'], dist, lt, index=state['index']) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 973, in link (placeholder, dist)) conda.exceptions.PaddingError: Padding error: finished running conda build. logfile: /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 1: syntax error: unexpected end of file ``` An older version of the recipe can be found here https://github.com/davidslac/manage-lcls-conda-build-system/tree/master/recipes/psana/psana-conda-opt After backing conda-build back down to 1.19, things look like they are working again, at least conda made the build environment and is running my build script conda build - exception - padding error I just updated to the lastest conda-build in defaults, and latest conda conda-env in conda canary, when I run conda build I am getting a 'package error'. Here is my conda environemnt: ``` platform : linux-64 conda version : 4.2.5 conda is private : False conda-env version : 2.6.0 conda-build version : 2.0.1 python version : 2.7.12.final.0 requests version : 2.10.0 root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 (writable) default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7 envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://conda.anaconda.org/scikit-beam/linux-64/ https://conda.anaconda.org/scikit-beam/noarch/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/ file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/ config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc offline mode : False ``` and here is the build output ``` SIT_ARCH=x86_64-rhel7-gcc48-opt conda build -c file:///reg/g/psdm/sw/conda/channels/system-rhel7 -c file:///reg/g/psdm/sw/conda/channels/psana-rhel7 -c file:///reg/g/psdm/sw/conda/channels/external-rhel7 --quiet recipes/psana/psana-conda-opt 2>&1 | tee -a /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/environ.py:303: UserWarning: The environment variable 'SIT_ROOT' is undefined. UserWarning BUILD START: psana-conda-1.0.2-py27_1 (actual version deferred until further download or env creation) The following NEW packages will be INSTALLED: boost: 1.57.0-4 cairo: 1.12.18-6 cycler: 0.10.0-py27_0 cython: 0.24.1-py27_0 fontconfig: 2.11.1-6 freetype: 2.5.5-1 h5py: 2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5: 1.8.17-openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 icu: 54.1-0 libgfortran: 3.0.0-1 libpng: 1.6.22-0 libsodium: 1.0.10-0 libxml2: 2.9.2-0 matplotlib: 1.5.1-np111py27_0 mkl: 11.3.3-0 mpi4py: 2.0.0-py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mysql: 5.5.24-0 ndarray: 1.1.5-0 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 numexpr: 2.6.1-np111py27_0 numpy: 1.11.1-py27_0 openmpi: 1.10.3-lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openssl: 1.0.2h-1 pip: 8.1.2-py27_0 pixman: 0.32.6-0 pycairo: 1.10.0-py27_0 pyparsing: 2.1.4-py27_0 pyqt: 4.11.4-py27_4 python: 2.7.12-1 python-dateutil: 2.5.3-py27_0 pytz: 2016.6.1-py27_0 pyzmq: 15.4.0-py27_0 qt: 4.8.5-0 readline: 6.2-2 scipy: 0.18.0-np111py27_0 scons: 2.3.0-py27_0 setuptools: 26.1.1-py27_0 sip: 4.18-py27_0 six: 1.10.0-py27_0 sqlite: 3.13.0-0 szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 tables: 3.2.3.1-py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tk: 8.5.18-0 wheel: 0.29.0-py27_0 zeromq: 4.1.4-0 zlib: 1.2.8-3 The following NEW packages will be INSTALLED: boost: 1.57.0-4 cairo: 1.12.18-6 cycler: 0.10.0-py27_0 cython: 0.24.1-py27_0 fontconfig: 2.11.1-6 freetype: 2.5.5-1 h5py: 2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 hdf5: 1.8.17-openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 icu: 54.1-0 libgfortran: 3.0.0-1 libpng: 1.6.22-0 libsodium: 1.0.10-0 libxml2: 2.9.2-0 matplotlib: 1.5.1-np111py27_0 mkl: 11.3.3-0 mpi4py: 2.0.0-py27_openmpi_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 mysql: 5.5.24-0 ndarray: 1.1.5-0 file:///reg/g/psdm/sw/conda/channels/psana-rhel7 numexpr: 2.6.1-np111py27_0 numpy: 1.11.1-py27_0 openmpi: 1.10.3-lsf_verbs_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 openssl: 1.0.2h-1 pip: 8.1.2-py27_0 pixman: 0.32.6-0 pycairo: 1.10.0-py27_0 pyparsing: 2.1.4-py27_0 pyqt: 4.11.4-py27_4 python: 2.7.12-1 python-dateutil: 2.5.3-py27_0 pytz: 2016.6.1-py27_0 pyzmq: 15.4.0-py27_0 qt: 4.8.5-0 readline: 6.2-2 scipy: 0.18.0-np111py27_0 scons: 2.3.0-py27_0 setuptools: 26.1.1-py27_0 sip: 4.18-py27_0 six: 1.10.0-py27_0 sqlite: 3.13.0-0 szip: 2.1-100 file:///reg/g/psdm/sw/conda/channels/external-rhel7 tables: 3.2.3.1-py27_hdf18_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7 tk: 8.5.18-0 wheel: 0.29.0-py27_0 zeromq: 4.1.4-0 zlib: 1.2.8-3 Traceback (most recent call last): File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-build", line 6, in <module> sys.exit(conda_build.cli.main_build.main()) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 239, in main execute(sys.argv[1:]) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 231, in execute already_built=None, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/api.py", line 83, in build need_source_download=need_source_download, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 998, in build_tree config=recipe_config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 558, in build create_env(config.build_prefix, specs, config=config) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 451, in create_env clear_cache=clear_cache) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 427, in create_env plan.execute_actions(actions, index, verbose=config.debug) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 643, in execute_actions inst.execute_instructions(plan, index, verbose) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions cmd(state, arg) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 77, in LINK_CMD link(state['prefix'], dist, lt, index=state['index']) File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 973, in link (placeholder, dist)) conda.exceptions.PaddingError: Padding error: finished running conda build. logfile: /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 1: syntax error: unexpected end of file ``` An older version of the recipe can be found here https://github.com/davidslac/manage-lcls-conda-build-system/tree/master/recipes/psana/psana-conda-opt After backing conda-build back down to 1.19, things look like they are working again, at least conda made the build environment and is running my build script
@davidslac Thanks so much for all of these bug reports. Will investigate and fix them all. You're welcome! From: Kale Franz <[email protected]<mailto:[email protected]>> Reply-To: conda/conda <[email protected]<mailto:[email protected]>> Date: Monday, September 12, 2016 at 8:28 AM To: conda/conda <[email protected]<mailto:[email protected]>> Cc: David A Schneider <[email protected]<mailto:[email protected]>>, Mention <[email protected]<mailto:[email protected]>> Subject: Re: [conda/conda] conda build - exception - padding error (#3407) @davidslachttps://github.com/davidslac Thanks so much for all of these bug reports. Will investigate and fix them all. ## You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3407#issuecomment-246385470, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQAThWBmDYIZa-Nx_0FK7EluKsLyuG6wks5qpW-HgaJpZM4J6Hdo. @davidslac I've fixed the other two issues you filed. And I'll make the messaging better on this one. The issue here is that around conda-build 2.0, we changed the length of the binary path placeholder. Before, it was arbitrarily set to 80 characters, and now we've extended it to the max value we can while still maintaining broad interoperability (255). The downside is that dependencies sometimes have to be rebuilt with the longer padding. I think we've rebuilt most of the packages in defaults that needed it, but we could have missed some. My guess is it's one of the packages in one of your local file:// channels. Regardless, I'll make the messaging better so you know exactly which one is the culprit. @davidslac Thanks so much for all of these bug reports. Will investigate and fix them all. You're welcome! From: Kale Franz <[email protected]<mailto:[email protected]>> Reply-To: conda/conda <[email protected]<mailto:[email protected]>> Date: Monday, September 12, 2016 at 8:28 AM To: conda/conda <[email protected]<mailto:[email protected]>> Cc: David A Schneider <[email protected]<mailto:[email protected]>>, Mention <[email protected]<mailto:[email protected]>> Subject: Re: [conda/conda] conda build - exception - padding error (#3407) @davidslachttps://github.com/davidslac Thanks so much for all of these bug reports. Will investigate and fix them all. ## You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3407#issuecomment-246385470, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQAThWBmDYIZa-Nx_0FK7EluKsLyuG6wks5qpW-HgaJpZM4J6Hdo. @davidslac I've fixed the other two issues you filed. And I'll make the messaging better on this one. The issue here is that around conda-build 2.0, we changed the length of the binary path placeholder. Before, it was arbitrarily set to 80 characters, and now we've extended it to the max value we can while still maintaining broad interoperability (255). The downside is that dependencies sometimes have to be rebuilt with the longer padding. I think we've rebuilt most of the packages in defaults that needed it, but we could have missed some. My guess is it's one of the packages in one of your local file:// channels. Regardless, I'll make the messaging better so you know exactly which one is the culprit.
2016-09-13T10:29:01
conda/conda
3,454
conda__conda-3454
[ "3453" ]
5980241daa95ec60af005ad1764bbadfa1d244a3
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -63,7 +63,7 @@ def check_prefix(prefix, json=False): if name == ROOT_ENV_NAME: error = "'%s' is a reserved environment name" % name if exists(prefix): - if isdir(prefix) and not os.listdir(prefix): + if isdir(prefix) and 'conda-meta' not in os.listdir(prefix): return None error = "prefix already exists: %s" % prefix @@ -164,7 +164,7 @@ def install(args, parser, command='install'): (name, prefix)) if newenv and not args.no_default_packages: - default_packages = context.create_default_packages[:] + default_packages = list(context.create_default_packages) # Override defaults if they are specified at the command line for default_pkg in context.create_default_packages: if any(pkg.split('=')[0] == default_pkg for pkg in args.packages):
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -19,6 +19,7 @@ from conda.cli.main_update import configure_parser as update_configure_parser from conda.common.io import captured, disable_logger, stderr_log_level from conda.common.url import path_to_url +from conda.common.yaml import yaml_load from conda.compat import itervalues from conda.connection import LocalFSAdapter from conda.install import dist2dirname, linked as install_linked, linked_data, linked_data_, on_win @@ -46,12 +47,15 @@ def escape_for_winpath(p): return p.replace('\\', '\\\\') -def make_temp_prefix(name=None): +def make_temp_prefix(name=None, create_directory=True): tempdir = gettempdir() dirname = str(uuid4())[:8] if name is None else name prefix = join(tempdir, dirname) os.makedirs(prefix) - assert isdir(prefix) + if create_directory: + assert isdir(prefix) + else: + os.removedirs(prefix) return prefix @@ -591,3 +595,52 @@ def test_shortcut_absent_when_condarc_set(self): rmtree(prefix, ignore_errors=True) if isfile(shortcut_file): os.remove(shortcut_file) + + def test_create_default_packages(self): + # Regression test for #3453 + try: + prefix = make_temp_prefix(str(uuid4())[:7]) + + # set packages + run_command(Commands.CONFIG, prefix, "--add create_default_packages python") + run_command(Commands.CONFIG, prefix, "--add create_default_packages pip") + run_command(Commands.CONFIG, prefix, "--add create_default_packages flask") + stdout, stderr = run_command(Commands.CONFIG, prefix, "--show") + yml_obj = yaml_load(stdout) + assert yml_obj['create_default_packages'] == ['flask', 'pip', 'python'] + + assert not package_is_installed(prefix, 'python-2') + assert not package_is_installed(prefix, 'numpy') + assert not package_is_installed(prefix, 'flask') + + with make_temp_env("python=2", "numpy", prefix=prefix): + assert_package_is_installed(prefix, 'python-2') + assert_package_is_installed(prefix, 'numpy') + assert_package_is_installed(prefix, 'flask') + + finally: + rmtree(prefix, ignore_errors=True) + + def test_create_default_packages_no_default_packages(self): + try: + prefix = make_temp_prefix(str(uuid4())[:7]) + + # set packages + run_command(Commands.CONFIG, prefix, "--add create_default_packages python") + run_command(Commands.CONFIG, prefix, "--add create_default_packages pip") + run_command(Commands.CONFIG, prefix, "--add create_default_packages flask") + stdout, stderr = run_command(Commands.CONFIG, prefix, "--show") + yml_obj = yaml_load(stdout) + assert yml_obj['create_default_packages'] == ['flask', 'pip', 'python'] + + assert not package_is_installed(prefix, 'python-2') + assert not package_is_installed(prefix, 'numpy') + assert not package_is_installed(prefix, 'flask') + + with make_temp_env("python=2", "numpy", "--no-default-packages", prefix=prefix): + assert_package_is_installed(prefix, 'python-2') + assert_package_is_installed(prefix, 'numpy') + assert not package_is_installed(prefix, 'flask') + + finally: + rmtree(prefix, ignore_errors=True)
Conda Fails with create_default_packages When using `create_default_packages`, `conda create...` fails. ## Sample condarc: ``` channels: - defaults create_default_packages: - python - pip ``` ## Command `conda create -n test_conda_update python=2 numpy` ## Error ``` Traceback (most recent call last): File "/opt/a/b/c/muunitnoc/anaconda/lib/python2.7/site-packages/conda/exceptions.py", line 472, in conda_exception_handler return_value = func(*args, **kwargs) File "/opt/a/b/c/muunitnoc/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/opt/a/b/c/muunitnoc/anaconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 68, in execute install(args, parser, 'create') File "/opt/a/b/c/muunitnoc/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 171, in install default_packages.remove(default_pkg) AttributeError: 'tuple' object has no attribute 'remove' ```
2016-09-16T18:43:46
conda/conda
3,521
conda__conda-3521
[ "3467", "3467" ]
8fa70193de809a03208a1f807e701ee29ddac145
diff --git a/conda/common/configuration.py b/conda/common/configuration.py --- a/conda/common/configuration.py +++ b/conda/common/configuration.py @@ -637,9 +637,11 @@ def __init__(self, element_type, default=None, aliases=(), validation=None): def collect_errors(self, instance, value, source="<<merged>>"): errors = super(MapParameter, self).collect_errors(instance, value) - element_type = self._element_type - errors.extend(InvalidElementTypeError(self.name, val, source, type(val), element_type, key) - for key, val in iteritems(value) if not isinstance(val, element_type)) + if isinstance(value, Mapping): + element_type = self._element_type + errors.extend(InvalidElementTypeError(self.name, val, source, type(val), + element_type, key) + for key, val in iteritems(value) if not isinstance(val, element_type)) return errors def _merge(self, matches):
diff --git a/tests/common/test_configuration.py b/tests/common/test_configuration.py --- a/tests/common/test_configuration.py +++ b/tests/common/test_configuration.py @@ -5,7 +5,7 @@ from conda.common.compat import odict, string_types from conda.common.configuration import (Configuration, MapParameter, ParameterFlag, PrimitiveParameter, SequenceParameter, YamlRawParameter, - load_file_configs, MultiValidationError) + load_file_configs, MultiValidationError, InvalidTypeError) from conda.common.yaml import yaml_load from conda.common.configuration import ValidationError from os import environ, mkdir @@ -388,3 +388,12 @@ def test_validate_all(self): def test_cross_parameter_validation(self): pass # test primitive can't be list; list can't be map, etc + + def test_map_parameter_must_be_map(self): + # regression test for conda/conda#3467 + string = dals(""" + proxy_servers: bad values + """) + data = odict(s1=YamlRawParameter.make_raw_parameters('s1', yaml_load(string))) + config = SampleConfiguration()._add_raw_data(data) + raises(InvalidTypeError, config.validate_all)
Unable to conda update --all An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: ``` https://github.com/conda/conda/issues ``` Current conda install: ``` platform : win-64 conda version : 4.2.6 conda is private : False conda-env version : 4.2.6 conda-build version : 2.0.1 python version : 3.5.2.final.0 requests version : 2.11.1 root environment : C:\Anaconda3 (writable) default environment : C:\Anaconda3 envs directories : C:\Anaconda3\envs package cache : C:\Anaconda3\pkgs channel URLs : https://repo.continuum.io/pkgs/free/win-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/win-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://repo.continuum.io/pkgs/msys2/win-64/ https://repo.continuum.io/pkgs/msys2/noarch/ config file : c:\users\gvdeynde\.condarc offline mode : False ``` `$ C:\Anaconda3\Scripts\conda-script.py update --all` ``` Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\conda\exceptions.py", line 472, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 144, in _main exit_code = args.func(args, p) File "C:\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 65, in execute install(args, parser, 'update') File "C:\Anaconda3\lib\site-packages\conda\cli\install.py", line 139, in install context.validate_all() File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 752, in validate_all for source in self.raw_data)) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 752, in <genexpr> for source in self.raw_data)) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 739, in check_source collected_errors = parameter.collect_errors(self, typed_value, match.source) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 642, in collect_errors for key, val in iteritems(value) if not isinstance(val, element_type)) File "C:\Anaconda3\lib\site-packages\conda\compat.py", line 148, in iteritems return iter(getattr(d, _iteritems)()) AttributeError: 'str' object has no attribute 'items' ``` Unable to conda update --all An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: ``` https://github.com/conda/conda/issues ``` Current conda install: ``` platform : win-64 conda version : 4.2.6 conda is private : False conda-env version : 4.2.6 conda-build version : 2.0.1 python version : 3.5.2.final.0 requests version : 2.11.1 root environment : C:\Anaconda3 (writable) default environment : C:\Anaconda3 envs directories : C:\Anaconda3\envs package cache : C:\Anaconda3\pkgs channel URLs : https://repo.continuum.io/pkgs/free/win-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/win-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://repo.continuum.io/pkgs/msys2/win-64/ https://repo.continuum.io/pkgs/msys2/noarch/ config file : c:\users\gvdeynde\.condarc offline mode : False ``` `$ C:\Anaconda3\Scripts\conda-script.py update --all` ``` Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\conda\exceptions.py", line 472, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 144, in _main exit_code = args.func(args, p) File "C:\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 65, in execute install(args, parser, 'update') File "C:\Anaconda3\lib\site-packages\conda\cli\install.py", line 139, in install context.validate_all() File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 752, in validate_all for source in self.raw_data)) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 752, in <genexpr> for source in self.raw_data)) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 739, in check_source collected_errors = parameter.collect_errors(self, typed_value, match.source) File "C:\Anaconda3\lib\site-packages\conda\common\configuration.py", line 642, in collect_errors for key, val in iteritems(value) if not isinstance(val, element_type)) File "C:\Anaconda3\lib\site-packages\conda\compat.py", line 148, in iteritems return iter(getattr(d, _iteritems)()) AttributeError: 'str' object has no attribute 'items' ```
2016-09-26T20:38:04
conda/conda
3,524
conda__conda-3524
[ "3492" ]
4f96dbd1d29ad9b9476be67217f63edd066b26b0
diff --git a/conda/base/constants.py b/conda/base/constants.py --- a/conda/base/constants.py +++ b/conda/base/constants.py @@ -99,6 +99,9 @@ class _Null(object): def __nonzero__(self): return False + def __bool__(self): + return False + NULL = _Null() UTF8 = 'UTF-8'
diff --git a/tests/base/test_constants.py b/tests/base/test_constants.py new file mode 100644 --- /dev/null +++ b/tests/base/test_constants.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from conda.base.constants import NULL +from logging import getLogger + +log = getLogger(__name__) + + +def test_null_is_falsey(): + assert not NULL
Progress bar broken ![image](https://cloud.githubusercontent.com/assets/1882046/18741247/576de78c-80ae-11e6-8604-2af7117b9cdd.png) ``` C:\Users\Korijn\dev\myproject>conda info Current conda install: platform : win-64 conda version : 4.2.7 conda is private : False conda-env version : 4.2.7 conda-build version : 2.0.1 python version : 3.5.1.final.0 requests version : 2.9.1 root environment : C:\Users\Korijn\Miniconda3 (writable) default environment : C:\Users\Korijn\Miniconda3 envs directories : C:\Users\Korijn\Miniconda3\envs package cache : C:\Users\Korijn\Miniconda3\pkgs channel URLs : https://repo.continuum.io/pkgs/free/win-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/win-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://repo.continuum.io/pkgs/msys2/win-64/ https://repo.continuum.io/pkgs/msys2/noarch/ config file : C:\Users\Korijn\.condarc offline mode : False ```
I am also having this problem, although only with `conda env` commands (e.g. `conda env create` or `conda env update`). `conda install` works fine. ``` bash $ conda info Current conda install: platform : linux-64 conda version : 4.2.7 conda is private : False conda-env version : 4.2.7 conda-build version : 2.0.1 python version : 3.5.2.final.0 requests version : 2.11.1 root environment : /home/alan/anaconda (writable) default environment : /home/alan/anaconda/envs/test envs directories : /home/alan/anaconda/envs package cache : /home/alan/anaconda/pkgs channel URLs : https://conda.anaconda.org/conda-forge/linux-64/ https://conda.anaconda.org/conda-forge/noarch/ https://conda.anaconda.org/conda-canary/linux-64/ https://conda.anaconda.org/conda-canary/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /home/alan/.condarc offline mode : False ```
2016-09-26T22:02:12
conda/conda
3,537
conda__conda-3537
[ "3536", "3536" ]
4f96dbd1d29ad9b9476be67217f63edd066b26b0
diff --git a/conda_env/cli/main.py b/conda_env/cli/main.py --- a/conda_env/cli/main.py +++ b/conda_env/cli/main.py @@ -1,4 +1,7 @@ from __future__ import print_function, division, absolute_import + +from logging import getLogger, CRITICAL + import os import sys @@ -66,6 +69,14 @@ def main(): parser = create_parser() args = parser.parse_args() context._add_argparse_args(args) + if getattr(args, 'json', False): + # # Silence logging info to avoid interfering with JSON output + # for logger in Logger.manager.loggerDict: + # if logger not in ('fetch', 'progress'): + # getLogger(logger).setLevel(CRITICAL + 1) + for logger in ('print', 'dotupdate', 'stdoutlog', 'stderrlog'): + getLogger(logger).setLevel(CRITICAL + 1) + return conda_exception_handler(args.func, args, parser)
Conda prints stuff in stdout even with --json flag on Conda commands with the `--json` should not print to the console anything unless it is proper json, otherwise assumptions made by parsing clients (Like the Navigator import functionality) break. Something like `conda env create -n qatest -f environment.yaml --json` prints to the standard output ``` Fetching package metadata ......... Solving package specifications: .......... {"progress": 0, "finished": false, "maxval": 10} {"name": "openssl", "progress": 0, "finished": false, "maxval": 10} {"name": "readline", "progress": 1, "finished": false, "maxval": 10} {"name": "sqlite", "progress": 2, "finished": false, "maxval": 10} {"name": "tk", "progress": 3, "finished": false, "maxval": 10} {"name": "xz", "progress": 4, "finished": false, "maxval": 10} {"name": "zlib", "progress": 5, "finished": false, "maxval": 10} {"name": "python", "progress": 6, "finished": false, "maxval": 10} {"name": "setuptools", "progress": 7, "finished": false, "maxval": 10} {"name": "wheel", "progress": 8, "finished": false, "maxval": 10} {"name": "pip", "progress": 9, "finished": false, "maxval": 10} {"progress": 10, "finished": true, "maxval": 10} ``` Conda prints stuff in stdout even with --json flag on Conda commands with the `--json` should not print to the console anything unless it is proper json, otherwise assumptions made by parsing clients (Like the Navigator import functionality) break. Something like `conda env create -n qatest -f environment.yaml --json` prints to the standard output ``` Fetching package metadata ......... Solving package specifications: .......... {"progress": 0, "finished": false, "maxval": 10} {"name": "openssl", "progress": 0, "finished": false, "maxval": 10} {"name": "readline", "progress": 1, "finished": false, "maxval": 10} {"name": "sqlite", "progress": 2, "finished": false, "maxval": 10} {"name": "tk", "progress": 3, "finished": false, "maxval": 10} {"name": "xz", "progress": 4, "finished": false, "maxval": 10} {"name": "zlib", "progress": 5, "finished": false, "maxval": 10} {"name": "python", "progress": 6, "finished": false, "maxval": 10} {"name": "setuptools", "progress": 7, "finished": false, "maxval": 10} {"name": "wheel", "progress": 8, "finished": false, "maxval": 10} {"name": "pip", "progress": 9, "finished": false, "maxval": 10} {"progress": 10, "finished": true, "maxval": 10} ```
2016-09-27T18:39:23
conda/conda
3,538
conda__conda-3538
[ "3525", "3525" ]
4f96dbd1d29ad9b9476be67217f63edd066b26b0
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -1046,7 +1046,8 @@ def messages(prefix): path = join(prefix, '.messages.txt') try: with open(path) as fi: - sys.stdout.write(fi.read()) + fh = sys.stderr if context.json else sys.stdout + fh.write(fi.read()) except IOError: pass finally:
Invalid JSON output When installing `Jupyter` I sometimes see the following error: ``` post-link :: /etc/machine-id not found .. bus post-link :: .. using /proc/sys/kernel/random/boot_id ``` When installing with the `--json` flag the error output causes the json to be invalid. Example: ``` root@head:~# conda create -n test_env2 python jupyter -y --json -q dbus post-link :: /etc/machine-id not found .. dbus post-link :: .. using /proc/sys/kernel/random/boot_id { "actions": { "LINK": [ "expat-2.1.0-0 1", ... ], "PREFIX": "/opt/a/b/c/muunitnoc/anaconda/envs/test_env2", "SYMLINK_CONDA": [ "/opt/a/b/c/muunitnoc/anaconda" ], "op_order": [ "RM_FETCHED", "FETCH", "RM_EXTRACTED", "EXTRACT", "UNLINK", "LINK", "SYMLINK_CONDA" ] }, "success": true } ``` In my opinion this is a fairly critical -- I need to depend on valid JSON output cc @kalefranz @koverholt @mingwandroid Invalid JSON output When installing `Jupyter` I sometimes see the following error: ``` post-link :: /etc/machine-id not found .. bus post-link :: .. using /proc/sys/kernel/random/boot_id ``` When installing with the `--json` flag the error output causes the json to be invalid. Example: ``` root@head:~# conda create -n test_env2 python jupyter -y --json -q dbus post-link :: /etc/machine-id not found .. dbus post-link :: .. using /proc/sys/kernel/random/boot_id { "actions": { "LINK": [ "expat-2.1.0-0 1", ... ], "PREFIX": "/opt/a/b/c/muunitnoc/anaconda/envs/test_env2", "SYMLINK_CONDA": [ "/opt/a/b/c/muunitnoc/anaconda" ], "op_order": [ "RM_FETCHED", "FETCH", "RM_EXTRACTED", "EXTRACT", "UNLINK", "LINK", "SYMLINK_CONDA" ] }, "success": true } ``` In my opinion this is a fairly critical -- I need to depend on valid JSON output cc @kalefranz @koverholt @mingwandroid
Which jupyter package and recipe? Need to see the post-link scripts... > jupyter 4.2.0 py27_0 defaults @mingwandroid mentioned that this was a warning, which seems fine as long as the output can be valid JSON I don't see a jupyter 4.2.0 at http://repo.continuum.io/pkgs/free/linux-64/ Can you give me the link to the package? The first thing I need to verify is that this isn't something dumb that jupyter is doing with their post-link scripts. I'm not aware of conda itself ever writing output like `dbus post-link :: /etc/machine-id not found ..`. My first guess write now is that jupyter pre-/post-link scripts are writing directly to stdout, in violation of the rules for these scripts: http://conda.pydata.org/docs/building/build-scripts.html I made a mistake: > jupyter 1.0.0 py27_3 defaults http://repo.continuum.io/pkgs/free/linux-64/jupyter-1.0.0-py27_3.tar.bz2 apologies https://github.com/ContinuumIO/anaconda-recipes/blob/master/dbus/post-link.sh.Linux Oh, it's doing it correctly. Yes, this could be a problem that I can fix within conda. So what should we do here? If follks put `echo` statements in in post-links is there anything conda can do to capture and output as JSON? Here's the offending line: https://github.com/conda/conda/blob/4.2.8/conda/install.py#L1049 Would a fix for you be to write to `stderr` if the `--json` flag is passed? That would definitely work! Which jupyter package and recipe? Need to see the post-link scripts... > jupyter 4.2.0 py27_0 defaults @mingwandroid mentioned that this was a warning, which seems fine as long as the output can be valid JSON I don't see a jupyter 4.2.0 at http://repo.continuum.io/pkgs/free/linux-64/ Can you give me the link to the package? The first thing I need to verify is that this isn't something dumb that jupyter is doing with their post-link scripts. I'm not aware of conda itself ever writing output like `dbus post-link :: /etc/machine-id not found ..`. My first guess write now is that jupyter pre-/post-link scripts are writing directly to stdout, in violation of the rules for these scripts: http://conda.pydata.org/docs/building/build-scripts.html I made a mistake: > jupyter 1.0.0 py27_3 defaults http://repo.continuum.io/pkgs/free/linux-64/jupyter-1.0.0-py27_3.tar.bz2 apologies https://github.com/ContinuumIO/anaconda-recipes/blob/master/dbus/post-link.sh.Linux Oh, it's doing it correctly. Yes, this could be a problem that I can fix within conda. So what should we do here? If follks put `echo` statements in in post-links is there anything conda can do to capture and output as JSON? Here's the offending line: https://github.com/conda/conda/blob/4.2.8/conda/install.py#L1049 Would a fix for you be to write to `stderr` if the `--json` flag is passed? That would definitely work!
2016-09-27T18:40:12
conda/conda
3,625
conda__conda-3625
[ "3600" ]
63c67adc0fd9cd187bec79abdd5ca23f8ff73297
diff --git a/conda/common/disk.py b/conda/common/disk.py --- a/conda/common/disk.py +++ b/conda/common/disk.py @@ -6,7 +6,7 @@ from itertools import chain from logging import getLogger from os import W_OK, access, chmod, getpid, listdir, lstat, makedirs, rename, unlink, walk -from os.path import abspath, basename, dirname, isdir, join, lexists +from os.path import abspath, basename, dirname, isdir, isfile, islink, join, lexists from shutil import rmtree from stat import S_IEXEC, S_IMODE, S_ISDIR, S_ISLNK, S_ISREG, S_IWRITE from time import sleep @@ -192,10 +192,10 @@ def rm_rf(path, max_retries=5, trash=True): backoff_rmdir(path) finally: # If path was removed, ensure it's not in linked_data_ - if not isdir(path): + if islink(path) or isfile(path): from conda.install import delete_linked_data_any delete_linked_data_any(path) - elif lexists(path): + if lexists(path): try: backoff_unlink(path) return True
diff --git a/tests/common/test_disk.py b/tests/common/test_disk.py new file mode 100644 --- /dev/null +++ b/tests/common/test_disk.py @@ -0,0 +1,58 @@ +import unittest +import pytest +from os.path import join, abspath +import os + +from conda.utils import on_win +from conda.compat import text_type +from conda.common.disk import rm_rf +from conda.base.context import context + + +def can_not_symlink(): + return on_win and context.default_python[0] == '2' + + +def _write_file(path, content): + with open(path, "w") as fh: + fh.write(content) + + +def test_remove_file(tmpdir): + test_file = "test.txt" + path = join(text_type(tmpdir), test_file) + _write_file(path, "welcome to the ministry of silly walks") + assert rm_rf(path) is True + + [email protected](not on_win, reason="Testing case for windows is different then Unix") +def test_remove_file_to_trash(tmpdir): + test_file = "test.txt" + path = join(text_type(tmpdir), test_file) + _write_file(path, "welcome to the ministry of silly walks") + assert rm_rf(path) is True + + +def test_remove_dir(tmpdir): + test_dir = "test" + tmpdir.mkdir(test_dir) + path = join(text_type(tmpdir), test_dir) + assert rm_rf(path) is True + + [email protected](can_not_symlink(), reason="symlink function not available") +def test_remove_link_to_file(tmpdir): + dst_link = join(text_type(tmpdir), "test_link") + src_file = join(text_type(tmpdir), "test_file") + _write_file(src_file, "welcome to the ministry of silly walks") + os.symlink(src_file, dst_link) + assert rm_rf(dst_link) is True + + [email protected](can_not_symlink(), reason="symlink function not available") +def test_remove_link_to_dir(tmpdir): + dst_link = join(text_type(tmpdir), "test_link") + src_dir = join(text_type(tmpdir), "test_dir") + tmpdir.mkdir("test_dir") + os.symlink(src_dir, dst_link) + assert rm_rf(dst_link) is True
conda update icu (54.1-0 --> 56.1-4 conda-forge) In a new installation, it appears that going from icu 54 to 56 will fail unless the following is done (at least on linux): bash Anaconda2-4.2.0-Linux-x86_64.sh conda remove icu rm -r $HOME/anaconda2/lib/icu conda install -c conda-forge icu=56.1 In other words, using the first and fourth lines alone fails with: CondaOSError: OS error: failed to link (src=u'/home/anaconda2/pkgs/icu-56.1-4/lib/icu/current', dst='/home/anaconda2/lib/icu/current', type=3, error=OSError(17, 'File exists'))
@rickedanielson could you share the output from `conda info` and the full stack trace for the case when you get the error? ``` > conda info Current conda install: platform : linux-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : 2.0.2 python version : 2.7.12.final.0 requests version : 2.11.1 root environment : $HOME/anaconda2 (writable) default environment : $HOME/anaconda2 envs directories : $HOME/anaconda2/envs package cache : $HOME/anaconda2/pkgs channel URLs : https://conda.anaconda.org/conda-forge/linux-64/ https://conda.anaconda.org/conda-forge/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : $HOME/.condarc offline mode : False > conda install -c conda-forge icu=56.1 Fetching package metadata ......... Solving package specifications: .......... Package plan for installation in environment $HOME/anaconda2: The following packages will be downloaded: package | build ---------------------------|----------------- icu-56.1 | 4 21.9 MB conda-forge conda-env-2.5.2 | py27_0 26 KB conda-forge conda-4.1.11 | py27_1 204 KB conda-forge ------------------------------------------------------------ Total: 22.1 MB The following NEW packages will be INSTALLED: conda-env: 2.5.2-py27_0 conda-forge The following packages will be UPDATED: icu: 54.1-0 --> 56.1-4 conda-forge The following packages will be SUPERCEDED by a higher-priority channel: conda: 4.2.9-py27_0 --> 4.1.11-py27_1 conda-forge Proceed ([y]/n)? Fetching packages ... icu-56.1-4.tar 100% |#############################################################################################################################################| Time: 0:00:39 583.39 kB/s conda-env-2.5. 100% |#############################################################################################################################################| Time: 0:00:00 164.50 kB/s conda-4.1.11-p 100% |#############################################################################################################################################| Time: 0:00:00 303.18 kB/s Extracting packages ... [ COMPLETE ]|################################################################################################################################################################| 100% Unlinking packages ... [ COMPLETE ]|################################################################################################################################################################| 100% Linking packages ... CondaOSError: OS error: failed to link (src=u'$HOME/anaconda2/pkgs/icu-56.1-4/lib/icu/current', dst='$HOME/anaconda2/lib/icu/current', type=3, error=OSError(17, 'File exists')) > ls -al $HOME/anaconda2/pkgs/icu-56.1-4/lib/icu/current $HOME/anaconda2/lib/icu/current lrwxrwxrwx 1 here now 4 okt. 10 22:14 $HOME/anaconda2/lib/icu/current -> 54.1 lrwxrwxrwx 1 here now 4 okt. 10 22:16 $HOME/anaconda2/pkgs/icu-56.1-4/lib/icu/current -> 56.1 > cat $HOME/.condarc channels: - conda-forge - defaults ```
2016-10-13T23:53:09
conda/conda
3,633
conda__conda-3633
[ "3533" ]
2d850dc7ce6ded5c7573ce470dca81517a6f9b94
diff --git a/conda/common/configuration.py b/conda/common/configuration.py --- a/conda/common/configuration.py +++ b/conda/common/configuration.py @@ -23,7 +23,7 @@ from itertools import chain from logging import getLogger from os import environ, stat -from os.path import join +from os.path import join, basename from stat import S_IFDIR, S_IFMT, S_IFREG try: @@ -343,7 +343,7 @@ def load_file_configs(search_path): # returns an ordered map of filepath and dict of raw parameter objects def _file_yaml_loader(fullpath): - assert fullpath.endswith(".yml") or fullpath.endswith("condarc"), fullpath + assert fullpath.endswith((".yml", ".yaml")) or "condarc" in basename(fullpath), fullpath yield fullpath, YamlRawParameter.make_raw_parameters_from_file(fullpath) def _dir_yaml_loader(fullpath):
BUG: CONDARC env var broken in latest conda After upgrading to conda version 4.2.7 the CONDARC env var no longer supports filenames of any format. It appears to only support filenames that end with .yml or .condarc. This is a functionality regression bug. Can this be fixed immediately!? **conda info** Current conda install: ``` platform : osx-64 conda version : 4.2.7 conda is private : False conda-env version : 4.2.7 conda-build version : 1.21.3 python version : 2.7.12.final.0 requests version : 2.9.1 root environment : /opt/anaconda (writable) default environment : /opt/anaconda envs directories : /opt/anaconda/envs package cache : /opt/anaconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/osx-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/osx-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://conda.anaconda.org/r/osx-64/ https://conda.anaconda.org/r/noarch/ config file : /Users/jhull/.condarc offline mode : False ``` **export CONDARC=~/.condarc.cloud** **conda info** Traceback (most recent call last): File "/opt/anaconda/bin/conda", line 4, in <module> import conda.cli File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/**init**.py", line 8, in <module> from .main import main # NOQA File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 46, in <module> from ..base.context import context File "/opt/anaconda/lib/python2.7/site-packages/conda/base/context.py", line 252, in <module> context = Context(SEARCH_PATH, conda, None) File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 692, in **init** self._add_search_path(search_path) File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 699, in _add_search_path return self._add_raw_data(load_file_configs(search_path)) File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 371, in load_file_configs raw_data = odict(kv for kv in chain.from_iterable(load_paths)) File "/opt/anaconda/lib/python2.7/collections.py", line 69, in __init__ self.__update(_args, *_kwds) File "/opt/anaconda/lib/python2.7/_abcoll.py", line 571, in update for key, value in other: File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 371, in <genexpr> raw_data = odict(kv for kv in chain.from_iterable(load_paths)) File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 346, in _file_yaml_loader **assert fullpath.endswith(".yml") or fullpath.endswith("condarc"), fullpath AssertionError: /Users/jhull/.condarc.cloud**
Added to my list to talk through with @mcg1969 tomorrow.
2016-10-14T16:07:18
conda/conda
3,654
conda__conda-3654
[ "3651" ]
08fcffebd379914df4e3ba781d100d48cde11650
diff --git a/conda/exports.py b/conda/exports.py new file mode 100644 --- /dev/null +++ b/conda/exports.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from functools import partial +from warnings import warn + +from conda import compat, plan +compat = compat +plan = plan + +from conda.api import get_index # NOQA +get_index = get_index + +from conda.cli.common import (Completer, InstalledPackages, add_parser_channels, add_parser_prefix, # NOQA + specs_from_args, spec_from_line, specs_from_url) # NOQA +Completer, InstalledPackages = Completer, InstalledPackages +add_parser_channels, add_parser_prefix = add_parser_channels, add_parser_prefix +specs_from_args, spec_from_line = specs_from_args, spec_from_line +specs_from_url = specs_from_url + +from conda.cli.conda_argparse import ArgumentParser # NOQA +ArgumentParser = ArgumentParser + +from conda.compat import (PY3, StringIO, configparser, input, iteritems, lchmod, string_types, # NOQA + text_type, TemporaryDirectory) # NOQA +PY3, StringIO, configparser, input = PY3, StringIO, configparser, input +iteritems, lchmod, string_types = iteritems, lchmod, string_types +text_type, TemporaryDirectory = text_type, TemporaryDirectory + +from conda.connection import CondaSession # NOQA +CondaSession = CondaSession + +from conda.fetch import TmpDownload, download, fetch_index # NOQA +TmpDownload, download, fetch_index = TmpDownload, download, fetch_index +handle_proxy_407 = lambda x, y: warn("handle_proxy_407 is deprecated. " + "Now handled by CondaSession.") + +from conda.install import (delete_trash, is_linked, linked, linked_data, move_to_trash, # NOQA + prefix_placeholder, rm_rf, symlink_conda, rm_fetched, package_cache) # NOQA +delete_trash, is_linked, linked = delete_trash, is_linked, linked +linked_data, move_to_trash = linked_data, move_to_trash +prefix_placeholder, rm_rf, symlink_conda = prefix_placeholder, rm_rf, symlink_conda +rm_fetched, package_cache = rm_fetched, package_cache + +from conda.lock import Locked # NOQA +Locked = Locked + +from conda.misc import untracked, walk_prefix # NOQA +untracked, walk_prefix = untracked, walk_prefix + +from conda.resolve import MatchSpec, NoPackagesFound, Resolve, Unsatisfiable, normalized_version # NOQA +MatchSpec, NoPackagesFound, Resolve = MatchSpec, NoPackagesFound, Resolve +Unsatisfiable, normalized_version = Unsatisfiable, normalized_version + +from conda.signature import KEYS, KEYS_DIR, hash_file, verify # NOQA +KEYS, KEYS_DIR = KEYS, KEYS_DIR +hash_file, verify = hash_file, verify + +from conda.utils import (human_bytes, hashsum_file, md5_file, memoized, unix_path_to_win, # NOQA + win_path_to_unix, url_path) # NOQA +human_bytes, hashsum_file, md5_file = human_bytes, hashsum_file, md5_file +memoized, unix_path_to_win = memoized, unix_path_to_win +win_path_to_unix, url_path = win_path_to_unix, url_path + +from conda.config import sys_rc_path # NOQA +sys_rc_path = sys_rc_path + +from conda.version import VersionOrder # NOQA +VersionOrder = VersionOrder + + +import conda.base.context # NOQA +import conda.exceptions # NOQA +from conda.base.context import get_prefix as context_get_prefix, non_x86_linux_machines # NOQA +non_x86_linux_machines = non_x86_linux_machines + +from conda.base.constants import DEFAULT_CHANNELS # NOQA +get_prefix = partial(context_get_prefix, conda.base.context.context) +get_default_urls = lambda: DEFAULT_CHANNELS + +arch_name = conda.base.context.context.arch_name +binstar_upload = conda.base.context.context.binstar_upload +bits = conda.base.context.context.bits +default_prefix = conda.base.context.context.default_prefix +default_python = conda.base.context.context.default_python +envs_dirs = conda.base.context.context.envs_dirs +pkgs_dirs = conda.base.context.context.pkgs_dirs +platform = conda.base.context.context.platform +root_dir = conda.base.context.context.root_dir +root_writable = conda.base.context.context.root_writable +subdir = conda.base.context.context.subdir +from conda.models.channel import get_conda_build_local_url # NOQA +get_rc_urls = lambda: list(conda.base.context.context.channels) +get_local_urls = lambda: list(get_conda_build_local_url()) or [] +load_condarc = lambda fn: conda.base.context.reset_context([fn]) +PaddingError = conda.exceptions.PaddingError
diff --git a/tests/test_exports.py b/tests/test_exports.py new file mode 100644 --- /dev/null +++ b/tests/test_exports.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + + +def test_exports(): + import conda.exports + assert conda.exports.PaddingError
Removal of handle_proxy_407 breaks conda-build Elevating as issue from https://github.com/conda/conda/commit/b993816b39a48d807e7a9659246266f6035c3dcd#commitcomment-19452072 so that it does not get lost. Removal of handle_proxy_407 breaks conda-build (it is used in pypi skeleton code for some reason.) Is there an alternative that I can use instead? Please provide example code.
2016-10-17T17:47:56
conda/conda
3,656
conda__conda-3656
[ "3655", "3655" ]
08fcffebd379914df4e3ba781d100d48cde11650
diff --git a/conda/models/channel.py b/conda/models/channel.py --- a/conda/models/channel.py +++ b/conda/models/channel.py @@ -5,7 +5,7 @@ from logging import getLogger from requests.packages.urllib3.util import Url -from ..base.constants import DEFAULT_CHANNELS_UNIX, DEFAULT_CHANNELS_WIN +from ..base.constants import DEFAULT_CHANNELS_UNIX, DEFAULT_CHANNELS_WIN, UTF8 from ..base.context import context from ..common.compat import iteritems, odict, with_metaclass from ..common.url import (has_scheme, is_url, is_windows_path, join_url, on_win, path_to_url, @@ -203,7 +203,9 @@ def from_channel_name(channel_name): def from_value(value): if value is None: return Channel(name="<unknown>") - elif has_scheme(value): + if hasattr(value, 'decode'): + value = value.decode(UTF8) + if has_scheme(value): if value.startswith('file:') and on_win: value = value.replace('\\', '/') return Channel.from_url(value)
error while searching for `notebook` I recently installed `ipykernel`, after which, commands `ipython notebook` produced "ImportError: No module named 'notebook'", and `jupyter notebook` produced "jupyter: 'notebook' is not a Jupyter command". So, I ran `conda search notebook` and got the following message: > Current conda install: ``` platform : linux-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : 1.14.1 python version : 3.4.5.final.0 requests version : 2.9.1 root environment : /usr1/eclark/anaconda3 (writable) default environment : /usr1/eclark/anaconda3 envs directories : /usr1/eclark/anaconda3/envs package cache : /usr1/eclark/anaconda3/pkgs channel URLs : https://conda.anaconda.org/anaconda/linux-64/ https://conda.anaconda.org/anaconda/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /nfs/jet/home/eclark/.condarc offline mode : False ``` `$ /usr1/eclark/anaconda3/bin/conda search notebook` ``` Traceback (most recent call last): File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/exceptions.py", line 473, in conda_exception_handler return_value = func(*args, **kwargs) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main_search.py", line 126, in execute execute_search(args, parser) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main_search.py", line 268, in execute_search Channel(pkg.channel).canonical_name, File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/models/channel.py", line 44, in __call__ elif value.endswith('.tar.bz2'): TypeError: endswith first arg must be bytes or a tuple of bytes, not str ``` error while searching for `notebook` I recently installed `ipykernel`, after which, commands `ipython notebook` produced "ImportError: No module named 'notebook'", and `jupyter notebook` produced "jupyter: 'notebook' is not a Jupyter command". So, I ran `conda search notebook` and got the following message: > Current conda install: ``` platform : linux-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : 1.14.1 python version : 3.4.5.final.0 requests version : 2.9.1 root environment : /usr1/eclark/anaconda3 (writable) default environment : /usr1/eclark/anaconda3 envs directories : /usr1/eclark/anaconda3/envs package cache : /usr1/eclark/anaconda3/pkgs channel URLs : https://conda.anaconda.org/anaconda/linux-64/ https://conda.anaconda.org/anaconda/noarch/ https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : /nfs/jet/home/eclark/.condarc offline mode : False ``` `$ /usr1/eclark/anaconda3/bin/conda search notebook` ``` Traceback (most recent call last): File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/exceptions.py", line 473, in conda_exception_handler return_value = func(*args, **kwargs) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main_search.py", line 126, in execute execute_search(args, parser) File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/cli/main_search.py", line 268, in execute_search Channel(pkg.channel).canonical_name, File "/usr1/eclark/anaconda3/lib/python3.4/site-packages/conda/models/channel.py", line 44, in __call__ elif value.endswith('.tar.bz2'): TypeError: endswith first arg must be bytes or a tuple of bytes, not str ```
2016-10-17T20:41:12
conda/conda
3,683
conda__conda-3683
[ "3646", "3646" ]
94e75d401e415e17d20a0b789a03f1f0bc85b7dc
diff --git a/conda/install.py b/conda/install.py --- a/conda/install.py +++ b/conda/install.py @@ -281,7 +281,7 @@ def replace(match): def replace_long_shebang(mode, data): - if mode is FileMode.text: + if mode == FileMode.text: shebang_match = SHEBANG_REGEX.match(data) if shebang_match: whole_shebang, executable, options = shebang_match.groups() @@ -350,7 +350,7 @@ def replace_pyzzer_entry_point_shebang(all_data, placeholder, new_prefix): def replace_prefix(mode, data, placeholder, new_prefix): - if mode is FileMode.text: + if mode == FileMode.text: data = data.replace(placeholder.encode(UTF8), new_prefix.encode(UTF8)) elif mode == FileMode.binary: data = binary_replace(data, placeholder.encode(UTF8), new_prefix.encode(UTF8)) @@ -360,7 +360,7 @@ def replace_prefix(mode, data, placeholder, new_prefix): def update_prefix(path, new_prefix, placeholder=PREFIX_PLACEHOLDER, mode=FileMode.text): - if on_win and mode is FileMode.text: + if on_win and mode == FileMode.text: # force all prefix replacements to forward slashes to simplify need to escape backslashes # replace with unix-style path separators new_prefix = new_prefix.replace('\\', '/')
Installing ompython-2.0.7 Current conda install: ``` platform : osx-64 conda version : 4.2.7 conda is private : False conda-env version : 4.2.7 conda-build version : not installed python version : 2.7.12.final.0 requests version : 2.11.1 root environment : /Library/Frameworks/Python.framework/Versions/2.7 (writable) default environment : /Library/Frameworks/Python.framework/Versions/2.7 envs directories : /Library/Frameworks/Python.framework/Versions/2.7/envs package cache : /Library/Frameworks/Python.framework/Versions/2.7/pkgs channel URLs : https://repo.continuum.io/pkgs/free/osx-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/osx-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False ``` `$ /Library/Frameworks/Python.framework/Versions/2.7/bin/conda install -c mutirri ompython=2.0.7` ``` Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/exceptions.py", line 472, in conda_exception_handler return_value = func(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/main_install.py", line 80, in execute install(args, parser, 'install') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/install.py", line 420, in install raise CondaRuntimeError('RuntimeError: %s' % e) CondaRuntimeError: Runtime error: RuntimeError: Invalid mode: <conda.install.FileMode object at 0x10846b110> ``` Installing ompython-2.0.7 Current conda install: ``` platform : osx-64 conda version : 4.2.7 conda is private : False conda-env version : 4.2.7 conda-build version : not installed python version : 2.7.12.final.0 requests version : 2.11.1 root environment : /Library/Frameworks/Python.framework/Versions/2.7 (writable) default environment : /Library/Frameworks/Python.framework/Versions/2.7 envs directories : /Library/Frameworks/Python.framework/Versions/2.7/envs package cache : /Library/Frameworks/Python.framework/Versions/2.7/pkgs channel URLs : https://repo.continuum.io/pkgs/free/osx-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/osx-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False ``` `$ /Library/Frameworks/Python.framework/Versions/2.7/bin/conda install -c mutirri ompython=2.0.7` ``` Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/exceptions.py", line 472, in conda_exception_handler return_value = func(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/main_install.py", line 80, in execute install(args, parser, 'install') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/conda/cli/install.py", line 420, in install raise CondaRuntimeError('RuntimeError: %s' % e) CondaRuntimeError: Runtime error: RuntimeError: Invalid mode: <conda.install.FileMode object at 0x10846b110> ```
Same here when trying to go through 30-minute tutorial: ``` Current conda install: platform : linux-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : not installed python version : 2.7.12.final.0 requests version : 2.7.0 root environment : /home/andrews/miniconda2 (writable) default environment : /home/andrews/miniconda2 envs directories : /home/andrews/miniconda2/envs package cache : /home/andrews/miniconda2/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False `$ /home/andrews/miniconda2/bin/conda create --name snowflakes biopython` Traceback (most recent call last): File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 473, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/main_create.py", line 68, in execute install(args, parser, 'create') File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/install.py", line 420, in install raise CondaRuntimeError('RuntimeError: %s' % e) CondaRuntimeError: Runtime error: RuntimeError: Invalid mode: <conda.install.FileMode object at 0x7f6d7d6deb10> ``` Try installing it through pip. I only tried it through conda because the pip install leads to a problem with omcidl stubs version on Mac OS X. Let me know if that works on Linux. I just went the second time through the tutorial and did not update conda with 'conda update conda'. So conda version is 4.1.11. This time it works. Looks like a regression. But does it work? Do you get an error message omniidl stubs version incompatibility (version 4.2 installed, version 3.0 supported)? I did not use omniidl, notice that my command is different - it is one from http://conda.pydata.org/docs/test-drive.html I don’t mean the conda part, I mean when you eventually run it in a python program and put “omc=OMCSession()”? Does it work? On 19 Oct 2016, at 9:05 PM, Andrew Skiba <[email protected]<mailto:[email protected]>> wrote: I did not use omniidl, notice that my command is different - it is one from http://conda.pydata.org/docs/test-drive.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3646#issuecomment-254806374, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVyiz7rRO2UrdQ253bmn20cHOSOlVLWUks5q1hWUgaJpZM4KYLf4. I don't use ompython either. So far I progress through the tutorial I referred in the previous message, works as expected with conda 4.1.11. Same here when trying to go through 30-minute tutorial: ``` Current conda install: platform : linux-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : not installed python version : 2.7.12.final.0 requests version : 2.7.0 root environment : /home/andrews/miniconda2 (writable) default environment : /home/andrews/miniconda2 envs directories : /home/andrews/miniconda2/envs package cache : /home/andrews/miniconda2/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/linux-64/ https://repo.continuum.io/pkgs/pro/noarch/ config file : None offline mode : False `$ /home/andrews/miniconda2/bin/conda create --name snowflakes biopython` Traceback (most recent call last): File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 473, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/main.py", line 144, in _main exit_code = args.func(args, p) File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/main_create.py", line 68, in execute install(args, parser, 'create') File "/home/andrews/miniconda2/lib/python2.7/site-packages/conda/cli/install.py", line 420, in install raise CondaRuntimeError('RuntimeError: %s' % e) CondaRuntimeError: Runtime error: RuntimeError: Invalid mode: <conda.install.FileMode object at 0x7f6d7d6deb10> ``` Try installing it through pip. I only tried it through conda because the pip install leads to a problem with omcidl stubs version on Mac OS X. Let me know if that works on Linux. I just went the second time through the tutorial and did not update conda with 'conda update conda'. So conda version is 4.1.11. This time it works. Looks like a regression. But does it work? Do you get an error message omniidl stubs version incompatibility (version 4.2 installed, version 3.0 supported)? I did not use omniidl, notice that my command is different - it is one from http://conda.pydata.org/docs/test-drive.html I don’t mean the conda part, I mean when you eventually run it in a python program and put “omc=OMCSession()”? Does it work? On 19 Oct 2016, at 9:05 PM, Andrew Skiba <[email protected]<mailto:[email protected]>> wrote: I did not use omniidl, notice that my command is different - it is one from http://conda.pydata.org/docs/test-drive.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3646#issuecomment-254806374, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVyiz7rRO2UrdQ253bmn20cHOSOlVLWUks5q1hWUgaJpZM4KYLf4. I don't use ompython either. So far I progress through the tutorial I referred in the previous message, works as expected with conda 4.1.11.
2016-10-20T20:14:18
conda/conda
3,684
conda__conda-3684
[ "3517", "3517" ]
94e75d401e415e17d20a0b789a03f1f0bc85b7dc
diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -142,7 +142,7 @@ def install(args, parser, command='install'): isinstall = bool(command == 'install') if newenv: common.ensure_name_or_prefix(args, command) - prefix = context.prefix if newenv else context.prefix_w_legacy_search + prefix = context.prefix if newenv or args.mkdir else context.prefix_w_legacy_search if newenv: check_prefix(prefix, json=context.json) if context.force_32bit and is_root_prefix(prefix):
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -20,6 +20,7 @@ from conda.cli.main_remove import configure_parser as remove_configure_parser from conda.cli.main_search import configure_parser as search_configure_parser from conda.cli.main_update import configure_parser as update_configure_parser +from conda.common.disk import rm_rf from conda.common.io import captured, disable_logger, replace_log_streams, stderr_log_level from conda.common.url import path_to_url from conda.common.yaml import yaml_load @@ -801,3 +802,18 @@ def test_clean_index_cache(self): # now clear it run_command(Commands.CLEAN, prefix, "--index-cache") assert not glob(join(index_cache_dir, "*.json")) + + def test_install_mkdir(self): + try: + prefix = make_temp_prefix() + assert isdir(prefix) + run_command(Commands.INSTALL, prefix, "python=3.5", "--mkdir") + assert_package_is_installed(prefix, "python-3.5") + + rm_rf(prefix) + assert not isdir(prefix) + run_command(Commands.INSTALL, prefix, "python=3.5", "--mkdir") + assert_package_is_installed(prefix, "python-3.5") + + finally: + rmtree(prefix, ignore_errors=True)
--mkdir no longer works After upgrading to `conda=4.2`: ``` C:\> conda install --mkdir -n name python=3.5 CondaEnvironmentNotFoundError: Could not find environment: name . You can list all discoverable environments with `conda info --envs`. ``` --mkdir no longer works After upgrading to `conda=4.2`: ``` C:\> conda install --mkdir -n name python=3.5 CondaEnvironmentNotFoundError: Could not find environment: name . You can list all discoverable environments with `conda info --envs`. ```
2016-10-20T20:34:10
conda/conda
3,685
conda__conda-3685
[ "3469", "3469" ]
94e75d401e415e17d20a0b789a03f1f0bc85b7dc
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -104,6 +104,9 @@ class Context(Configuration): binstar_upload = PrimitiveParameter(None, aliases=('anaconda_upload',), parameter_type=(bool, NoneType)) + _envs_dirs = SequenceParameter(string_types, aliases=('envs_dirs', 'envs_path'), + string_delimiter=os.pathsep) + @property def default_python(self): ver = sys.version_info @@ -156,8 +159,6 @@ def root_dir(self): def root_writable(self): return try_write(self.root_dir) - _envs_dirs = SequenceParameter(string_types, aliases=('envs_dirs',)) - @property def envs_dirs(self): return tuple(abspath(expanduser(p)) diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -289,6 +289,7 @@ def execute_config(args, parser): 'debug', 'default_channels', 'disallow', + 'envs_dirs', 'json', 'offline', 'proxy_servers',
diff --git a/tests/base/test_context.py b/tests/base/test_context.py --- a/tests/base/test_context.py +++ b/tests/base/test_context.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals +import os + import pytest from conda._vendor.auxlib.ish import dals from conda.base.context import context, reset_context @@ -8,6 +10,7 @@ from conda.common.configuration import YamlRawParameter from conda.common.yaml import yaml_load from conda.models.channel import Channel +from conda.utils import on_win from unittest import TestCase @@ -58,3 +61,23 @@ def test_old_channel_alias(self): "ftp://new.url:8082/conda-forge/label/dev/linux-64", "ftp://new.url:8082/conda-forge/label/dev/noarch", ] + + def test_conda_envs_path(self): + saved_envs_path = os.environ.get('CONDA_ENVS_PATH') + beginning = "C:" + os.sep if on_win else os.sep + path1 = beginning + os.sep.join(['my', 'envs', 'dir', '1']) + path2 = beginning + os.sep.join(['my', 'envs', 'dir', '2']) + try: + os.environ['CONDA_ENVS_PATH'] = path1 + reset_context() + assert context.envs_dirs[0] == path1 + + os.environ['CONDA_ENVS_PATH'] = os.pathsep.join([path1, path2]) + reset_context() + assert context.envs_dirs[0] == path1 + assert context.envs_dirs[1] == path2 + finally: + if saved_envs_path: + os.environ['CONDA_ENVS_PATH'] = saved_envs_path + else: + del os.environ['CONDA_ENVS_PATH']
Conda 4.2.x attempts to create lock files in readonly file-based channels and does not respect CONDA_ENVS_PATH I am getting warnings and eventually an error after upgrading from 4.1.11 to 4.2.7 relating to lock files and packages attempting to write to shared read-only directories in our continuous build. I modified `/shared/path/to/miniconda/lib/python2.7/site-packages/conda/lock.py` to find out where conda 4.2.x was putting lock files and found the following: `WARNING conda.lock:touch(55): Failed to create lock, do not run conda in parallel processes [errno 13] /shared/path/to/vendor/conda/linux-64.pid24915.conda_lock` `WARNING conda.lock:touch(55): Failed to create lock, do not run conda in parallel processes [errno 13] /shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.pid24915.conda_lock` `/shared/path/to` is read-only because it is used by multiple build-agents concurrently. Additional I encountered the following error: `CondaRuntimeError: Runtime error: RuntimeError: Runtime error: Could not open u'/shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.part' for writing ([Errno 13] Permission denied: u'/shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.part').` In conda <= 4.1.11 we were able to set the `CONDA_ENVS_PATH` to have a shared installation of conda, but with separate package caches/lock files per build agent on our continuous build server, in order to avoid concurrent use of the package cache. Two questions: - How do we disable lock files being placed in read-only shared file-based channels. - Does `CONDA_ENVS_PATH` no longer override the package cache/lock file directory from the root? Conda 4.2.x attempts to create lock files in readonly file-based channels and does not respect CONDA_ENVS_PATH I am getting warnings and eventually an error after upgrading from 4.1.11 to 4.2.7 relating to lock files and packages attempting to write to shared read-only directories in our continuous build. I modified `/shared/path/to/miniconda/lib/python2.7/site-packages/conda/lock.py` to find out where conda 4.2.x was putting lock files and found the following: `WARNING conda.lock:touch(55): Failed to create lock, do not run conda in parallel processes [errno 13] /shared/path/to/vendor/conda/linux-64.pid24915.conda_lock` `WARNING conda.lock:touch(55): Failed to create lock, do not run conda in parallel processes [errno 13] /shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.pid24915.conda_lock` `/shared/path/to` is read-only because it is used by multiple build-agents concurrently. Additional I encountered the following error: `CondaRuntimeError: Runtime error: RuntimeError: Runtime error: Could not open u'/shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.part' for writing ([Errno 13] Permission denied: u'/shared/path/to/miniconda/pkgs/python-dateutil-2.4.2-py27_0.tar.bz2.part').` In conda <= 4.1.11 we were able to set the `CONDA_ENVS_PATH` to have a shared installation of conda, but with separate package caches/lock files per build agent on our continuous build server, in order to avoid concurrent use of the package cache. Two questions: - How do we disable lock files being placed in read-only shared file-based channels. - Does `CONDA_ENVS_PATH` no longer override the package cache/lock file directory from the root?
Re: lock files, ran into the same problem today -- conda tries to create lock files for readonly file-based channels which yields a ton of warnings: ``` sh $ conda create -p ./foobar python=3.5 WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] ``` This is a regression from 4.1.x, please fix. @HugoTian @kalefranz ping By the way, why does it try to lock at all when all we're doing is reading from an external channel? I get that package cache lock makes sense since it's inherently a mutable thing, but why this? Anyone?.. We're bumping into this one as well. Has anyone got any info yet? This is blocking our upgrade to 4.2 as well. This issue with creating locks in read-only filesystem channels is a breaking our workflow as well @kalefranz :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: @aldanor , I just check the history, previously, failing create lock will be handled with debug level logging . So there is no warning info. I think there may be 2 solutions, first we change it back to debug, and there will be no warning. Second, we give another detailed warning based on exception types. @gnarlie , @eyew , can you give us more info about the exception or error that you encountered during upgrade or workflow ? Thanks in advance @HugoTian why does Conda attempt to put a lockfile in a file-based channel in the first place? Are you saying all clients of a file-based channel need write access? How does that work with http channels? @HugoTian The error message I get is: Runtime error: Could not open u/path_to_package/pkgs/packagename.tar.bz2.part' for writing ([Errno 13] Permission denied: ...) The pkgs directory (and miniconda installation itself) is on a shared filesystem and read-only because that conda instance is shared among multiple continuous build agents. In conda 4.1.x each build agent can maintain its own (temporary) package cache and locks by setting `CONDA_ENVS_PATH`. If we're going about this incorrectly, what is the proper way to share a conda installation among many agents? Having them each install miniconda to a temporary location before running a build is too slow to be workable in our case. There's two separate issues discussed here: 1) locking `pkgs` directory which generally is a legit thing to do and which may require further discussion 2) locking remote file channels -- which is a very strange thing to do, anyone care to explain? 1) Locking the package directory makes sense. However, in versions < 4.2.x, one could specify where the package directory was located via CONDA_ENV_PATH. This no longer seems to work as of 4.2.x 2) Agreed. I think we may bring back the CONDA_ENV_PATH setting, and I am not quite familiar with the cases when dealing with remote file-based channels. When I design the filelock and directory lock, the primary goal is to lock local file and directory to avoid parallel execution. Sorry that I did not consider the remote file channel case. This has affected me too. I install to a known location using `-p` so even having to set the `CONDA_ENV_PATH` to a writable location is counter-intuitive. However, it's the only workaround I have, and in 4.2 it's gone too. Hi there, we seem to run into the same issue. How is the CONDA_ENV_PATH variable supposed to work? I set "env_dirs" in .condarc to two values: envs_dirs: - ~/conda-envs - /location/of/conda/installation/envs This works so far as expected (so users installing something get this installed into their home directories (~/conda-envs)). But obviously some locking is still done in the installation dir of conda (which is not writeable for the users). Would setting "CONDA_ENV_PATH" to some directory solve this issue (if it worked for 4.2.0)? Cheers, ocarino Re: lock files, ran into the same problem today -- conda tries to create lock files for readonly file-based channels which yields a ton of warnings: ``` sh $ conda create -p ./foobar python=3.5 WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13] ``` This is a regression from 4.1.x, please fix. @HugoTian @kalefranz ping By the way, why does it try to lock at all when all we're doing is reading from an external channel? I get that package cache lock makes sense since it's inherently a mutable thing, but why this? Anyone?.. We're bumping into this one as well. Has anyone got any info yet? This is blocking our upgrade to 4.2 as well. This issue with creating locks in read-only filesystem channels is a breaking our workflow as well @kalefranz :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: :panda_face: @aldanor , I just check the history, previously, failing create lock will be handled with debug level logging . So there is no warning info. I think there may be 2 solutions, first we change it back to debug, and there will be no warning. Second, we give another detailed warning based on exception types. @gnarlie , @eyew , can you give us more info about the exception or error that you encountered during upgrade or workflow ? Thanks in advance @HugoTian why does Conda attempt to put a lockfile in a file-based channel in the first place? Are you saying all clients of a file-based channel need write access? How does that work with http channels? @HugoTian The error message I get is: Runtime error: Could not open u/path_to_package/pkgs/packagename.tar.bz2.part' for writing ([Errno 13] Permission denied: ...) The pkgs directory (and miniconda installation itself) is on a shared filesystem and read-only because that conda instance is shared among multiple continuous build agents. In conda 4.1.x each build agent can maintain its own (temporary) package cache and locks by setting `CONDA_ENVS_PATH`. If we're going about this incorrectly, what is the proper way to share a conda installation among many agents? Having them each install miniconda to a temporary location before running a build is too slow to be workable in our case. There's two separate issues discussed here: 1) locking `pkgs` directory which generally is a legit thing to do and which may require further discussion 2) locking remote file channels -- which is a very strange thing to do, anyone care to explain? 1) Locking the package directory makes sense. However, in versions < 4.2.x, one could specify where the package directory was located via CONDA_ENV_PATH. This no longer seems to work as of 4.2.x 2) Agreed. I think we may bring back the CONDA_ENV_PATH setting, and I am not quite familiar with the cases when dealing with remote file-based channels. When I design the filelock and directory lock, the primary goal is to lock local file and directory to avoid parallel execution. Sorry that I did not consider the remote file channel case. This has affected me too. I install to a known location using `-p` so even having to set the `CONDA_ENV_PATH` to a writable location is counter-intuitive. However, it's the only workaround I have, and in 4.2 it's gone too. Hi there, we seem to run into the same issue. How is the CONDA_ENV_PATH variable supposed to work? I set "env_dirs" in .condarc to two values: envs_dirs: - ~/conda-envs - /location/of/conda/installation/envs This works so far as expected (so users installing something get this installed into their home directories (~/conda-envs)). But obviously some locking is still done in the installation dir of conda (which is not writeable for the users). Would setting "CONDA_ENV_PATH" to some directory solve this issue (if it worked for 4.2.0)? Cheers, ocarino
2016-10-20T20:55:54
conda/conda
3,686
conda__conda-3686
[ "3560" ]
94e75d401e415e17d20a0b789a03f1f0bc85b7dc
diff --git a/conda/cli/main_info.py b/conda/cli/main_info.py --- a/conda/cli/main_info.py +++ b/conda/cli/main_info.py @@ -11,6 +11,7 @@ import re import sys from collections import OrderedDict +from conda.common.url import mask_anaconda_token from os import listdir from os.path import exists, expanduser, join @@ -225,6 +226,7 @@ def execute(args, parser): if not context.json: channels = [c + ('' if offline_keep(c) else ' (offline)') for c in channels] + channels = [mask_anaconda_token(c) for c in channels] info_dict = dict( platform=context.subdir, diff --git a/conda/common/url.py b/conda/common/url.py --- a/conda/common/url.py +++ b/conda/common/url.py @@ -135,6 +135,11 @@ def strip_scheme(url): return url.split('://', 1)[-1] +def mask_anaconda_token(url): + _, token = split_anaconda_token(url) + return url.replace(token, "<TOKEN>", 1) if token else url + + def split_anaconda_token(url): """ Examples:
conda info exposing tokens Hi, the conda info command is exposing tokens again. Por ejemplo: ``` Current conda install: platform : win-64 conda version : 4.2.9 conda is private : False conda-env version : 4.2.9 conda-build version : 2.0.2 python version : 2.7.12.final.0 requests version : 2.11.1 root environment : C:\Anaconda2 (writable) default environment : C:\Anaconda2 envs directories : C:\Anaconda2\envs package cache : C:\Anaconda2\pkgs channel URLs : https://conda.anaconda.org/t/**EXPOSED TOKEN**/topper/win-64/ https://conda.anaconda.org/t/**EXPOSED TOKEN**/topper/noarch/ https://repo.continuum.io/pkgs/free/win-64/ https://repo.continuum.io/pkgs/free/noarch/ https://repo.continuum.io/pkgs/pro/win-64/ https://repo.continuum.io/pkgs/pro/noarch/ https://repo.continuum.io/pkgs/msys2/win-64/ https://repo.continuum.io/pkgs/msys2/noarch/ config file : d:\Usuarios\108630\.condarc offline mode : False ```
Definitely a bug. Thanks for the report.
2016-10-20T21:23:45
conda/conda
3,698
conda__conda-3698
[ "3664" ]
a5d9c1739f7743a0dc795250beb6ad9b26a786d2
diff --git a/conda/common/disk.py b/conda/common/disk.py --- a/conda/common/disk.py +++ b/conda/common/disk.py @@ -20,6 +20,8 @@ log = getLogger(__name__) +MAX_TRIES = 7 + def try_write(dir_path, heavy=False): """Test write access to a directory. @@ -50,20 +52,21 @@ def try_write(dir_path, heavy=False): return access(dir_path, W_OK) -def backoff_unlink(file_or_symlink_path): +def backoff_unlink(file_or_symlink_path, max_tries=MAX_TRIES): def _unlink(path): make_writable(path) unlink(path) try: - exp_backoff_fn(lambda f: lexists(f) and _unlink(f), file_or_symlink_path) + exp_backoff_fn(lambda f: lexists(f) and _unlink(f), file_or_symlink_path, + max_tries=max_tries) except (IOError, OSError) as e: if e.errno not in (ENOENT,): # errno.ENOENT File not found error / No such file or directory raise -def backoff_rmdir(dirpath): +def backoff_rmdir(dirpath, max_tries=MAX_TRIES): if not isdir(dirpath): return @@ -75,13 +78,13 @@ def backoff_rmdir(dirpath): def retry(func, path, exc_info): if getattr(exc_info[1], 'errno', None) == ENOENT: return - recursive_make_writable(dirname(path)) + recursive_make_writable(dirname(path), max_tries=max_tries) func(path) def _rmdir(path): try: recursive_make_writable(path) - exp_backoff_fn(rmtree, path, onerror=retry) + exp_backoff_fn(rmtree, path, onerror=retry, max_tries=max_tries) except (IOError, OSError) as e: if e.errno == ENOENT: log.debug("no such file or directory: %s", path) @@ -120,7 +123,7 @@ def make_writable(path): raise -def recursive_make_writable(path): +def recursive_make_writable(path, max_tries=MAX_TRIES): # The need for this function was pointed out at # https://github.com/conda/conda/issues/3266#issuecomment-239241915 # Especially on windows, file removal will often fail because it is marked read-only @@ -128,25 +131,25 @@ def recursive_make_writable(path): for root, dirs, files in walk(path): for path in chain.from_iterable((files, dirs)): try: - exp_backoff_fn(make_writable, join(root, path)) + exp_backoff_fn(make_writable, join(root, path), max_tries=max_tries) except (IOError, OSError) as e: if e.errno == ENOENT: log.debug("no such file or directory: %s", path) else: raise else: - exp_backoff_fn(make_writable, path) + exp_backoff_fn(make_writable, path, max_tries=max_tries) def exp_backoff_fn(fn, *args, **kwargs): """Mostly for retrying file operations that fail on Windows due to virus scanners""" + max_tries = kwargs.pop('max_tries', MAX_TRIES) if not on_win: return fn(*args, **kwargs) import random # with max_tries = 6, max total time ~= 3.2 sec # with max_tries = 7, max total time ~= 6.5 sec - max_tries = 7 for n in range(max_tries): try: result = fn(*args, **kwargs) @@ -228,9 +231,9 @@ def delete_trash(prefix=None): path = join(trash_dir, p) try: if isdir(path): - backoff_rmdir(path) + backoff_rmdir(path, max_tries=1) else: - backoff_unlink(path) + backoff_unlink(path, max_tries=1) except (IOError, OSError) as e: log.info("Could not delete path in trash dir %s\n%r", path, e) if listdir(trash_dir):
conda appears to be stuck during update/install: Access Denied Error on Windows Hi, At work we have on occasion noticed that some of our build workers were taking unusually long during some `conda update` and `conda install` operations. After enabling debugging with `-vv` and `-debug`, we identified that Conda was having trouble removing the `pkgs/.trash` folder. Here's the output we were seeing: ``` 10:49:00 INFO conda.common.disk:delete_trash(235): Could not delete path in trash dir W:\Miniconda\pkgs\.trash\b095ce24-6c5c-4df1-aeb1-b726106d1f2b 10:49:00 WindowsError(5, 'Access is denied') 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 0.147886 sec 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 0.252876 sec 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 0.43156 sec 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:00 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 0.834403 sec 10:49:01 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:01 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 1.69182 sec 10:49:03 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:03 DEBUG conda.common.disk:exp_backoff_fn(163): retrying disk.py/59 <lambda>() in 3.20222 sec 10:49:06 DEBUG conda.common.disk:exp_backoff_fn(154): WindowsError(5, 'Access is denied') 10:49:06 INFO conda.common.disk:delete_trash(235): Could not delete path in trash dir W:\Miniconda\pkgs\.trash\b1e43e9c-d723-4323-8ceb-3b834d67e4e4 10:49:06 WindowsError(5, 'Access is denied') ``` This could go on for dozens of minutes. Looking at this worker we noticed a few things: - `conda` was the only Python process running at the time; - Looking at code we noticed the docs for `exp_backoff_fn`: ``` python """Mostly for retrying file operations that fail on Windows due to virus scanners""" ``` Some issues (#2947, #2983) also mention virus scanners, so we disabled the virus scanner we have ("ESET Endpoint Antivirus") but the problem persisted. Here's the output of `conda info`: ``` Current conda install: platform : win-64 conda version : 4.2.9+1 conda is private : False conda-env version : 4.2.9+1 conda-build version : 1.20.0+1 python version : 2.7.12.final.0 requests version : 2.11.1 root environment : W:\Miniconda (writable) default environment : W:\Miniconda envs directories : W:\Miniconda\envs package cache : W:\Miniconda\pkgs channel URLs : https://eden.esss.com.br/conda-channel/esss/win-64/ https://eden.esss.com.br/conda-channel/esss/noarch/ https://eden.esss.com.br/conda-channel/mirror/win-64/ https://eden.esss.com.br/conda-channel/mirror/noarch/ https://eden.esss.com.br/conda-channel/mirror-conda-forge/win-64/ https://eden.esss.com.br/conda-channel/mirror-conda-forge/noarch/ config file : W:\Miniconda\.condarc offline mode : False ``` Our current workaround was to remove the `pkgs/.trash` folder just before calling `conda update` or `conda install`. Any ideas on how to debug this perhaps? Any help is greatly appreciated.
First, thanks for the awesome, detailed report. I wish every issue filed was this descriptive :) As you can tell from our code, we've been battling permissions issues like this on windows for a while now. Question 1: What are the details of your file system/mount for your `W:\` drive? Local? Network? NTFS? Other? Question 2: > Our current workaround was to remove the pkgs/.trash folder just before calling conda update or conda install. Are you doing this with the same automated script that is calling `conda update` or `conda install`? What is the actual command you're using? > First, thanks for the awesome, detailed report. I wish every issue filed was this descriptive :) Thanks, it's the least I can do. 😁 > Question 1: What are the details of your file system/mount for your W:\ drive? Local? Network? NTFS? Other? That is a normal, local partition. In almost all of our slaves that's a separate hard-drive than the one where the system is installed. A detail that perhaps it wasn't very clear is that we checked the permissions of the `.trash` folder and the files on it and they were fine. We can delete the files normally when logging in with the same user which runs our CI job once we kill the python/conda process. > Are you doing this with the same automated script that is calling conda update or conda install? > What is the actual command you're using? Yes, we are doing that in two scripts at the moment: 1. A powershell script which is run daily to provision the workers (ensure that conda is installed, update some choco packages, cleanup some workspaces, etc). That script is now running this command right before attempting to execute `conda install`: ``` ps $cir = conda info --root $trash_dir = "$($cir)\pkgs\.trash" if (Test-Path $trash_dir){ Remove-Item -Recurse -Force $trash_dir } conda --debug update --all --yes --quiet ``` 2. A "setup worker" BAT file which executed at the start of each job, and calls `conda env update` to create a conda-environment: ``` bat for /F %%i in ('conda info --root') do set CONDA_ROOT=%%i set CONDA_TRASH=%CONDA_ROOT%\pkgs\.trash if exist %CONDA_TRASH% ( echo Removing %CONDA_TRASH% rd /s /q %CONDA_TRASH% ) @REM update conda and conda-env to the versions specified on this branch call conda install -n root --file "%WORKSPACE%\eden\conda_version.txt" || goto ERROR ``` The `conda install/update` calls above are the points where we were observing that conda was getting stuck. We have a separate `W:` drive because we can easily quick format it and run the provisioning script to "wipe" a slave. The `W:` drive contains Miniconda, all packages and environments, as well as the jobs' workspaces. Helpful comment from @ChrisBarker-NOAA on the conda message board. https://groups.google.com/a/continuum.io/forum/#!msg/conda/9dPHBsAGqoQ/CrKdGLyfBgAJ > Windows file locking in a pain in the %#^% > > We have had problems that we have never been able to resolve. On my workstation, I ended up installing "unlocker" > > http://www.iobit.com/en/iobit-unlocker.php > > which is very nice for interactive GUI use -- but not helpful for conda. But I wll say that I end up using it a LOT! > > Anyway, aside from virus scanners, backup software can be a really pain this way: > > it detects a change in some files. > it locks them while updating the backup > now you can't delete them until it is done. > > The proper solution here is configure your backup software to not back up stuff it shouldn't, but conda has no control over that. > > However, it looks like at least in this case it's a .trash folder that's causing the problem ,so it seems conda should just give up (quickly) if it can't delete that -- it's not fatal, is it? > > Also -- maybe there is a way to make a system call to unlock files? woudl conda have the permission to do that?
2016-10-22T20:17:25
conda/conda
3,740
conda__conda-3740
[ "3738", "3738" ]
c82d2b307f00db63fb344b1e9089352b1fc452f3
diff --git a/conda_env/yaml.py b/conda_env/yaml.py --- a/conda_env/yaml.py +++ b/conda_env/yaml.py @@ -5,7 +5,9 @@ """ from __future__ import absolute_import, print_function from collections import OrderedDict -import yaml + +from conda.common.yaml import get_yaml +yaml = get_yaml() def represent_ordereddict(dumper, data):
conda env create giving ImportError for yaml package `conda env create` suddenly started giving `"ImportError: No module named 'yaml'"` with latest miniconda on my TravisCI builbs: https://travis-ci.org/leouieda/website/builds/170917743 I changed nothing significant in my code. Tried rebuilding previous passing builds and started getting the same error. Is this something from a recent release? conda env create giving ImportError for yaml package `conda env create` suddenly started giving `"ImportError: No module named 'yaml'"` with latest miniconda on my TravisCI builbs: https://travis-ci.org/leouieda/website/builds/170917743 I changed nothing significant in my code. Tried rebuilding previous passing builds and started getting the same error. Is this something from a recent release?
Wow. Thanks for the report. I thought we had patched conda_env to use `ruamel_yaml`. I guess not. If you want to fix your build until we get this patched, you can add `conda install pyyaml`. Wow. Thanks for the report. I thought we had patched conda_env to use `ruamel_yaml`. I guess not. If you want to fix your build until we get this patched, you can add `conda install pyyaml`.
2016-10-27T00:06:46
conda/conda
3,747
conda__conda-3747
[ "3732", "3732" ]
2604c2bd504996d1acf627ae9dcc1158a1d73fa5
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -243,7 +243,6 @@ def local_build_root_channel(self): location, name = url_parts.path.rsplit('/', 1) if not location: location = '/' - assert name == 'conda-bld' return Channel(scheme=url_parts.scheme, location=location, name=name) @memoizedproperty
diff --git a/tests/base/test_context.py b/tests/base/test_context.py --- a/tests/base/test_context.py +++ b/tests/base/test_context.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals +from os.path import basename, dirname + import os import pytest @@ -8,6 +10,7 @@ from conda.base.context import context, reset_context from conda.common.compat import odict from conda.common.configuration import YamlRawParameter +from conda.common.url import path_to_url, join_url from conda.common.yaml import yaml_load from conda.models.channel import Channel from conda.utils import on_win @@ -81,3 +84,96 @@ def test_conda_envs_path(self): os.environ['CONDA_ENVS_PATH'] = saved_envs_path else: del os.environ['CONDA_ENVS_PATH'] + + + def test_conda_bld_path_1(self): + saved_envs_path = os.environ.get('CONDA_BLD_PATH') + beginning = "C:" + os.sep if on_win else os.sep + path = beginning + os.sep.join(['tmp', 'conda-bld']) + url = path_to_url(path) + try: + os.environ['CONDA_BLD_PATH'] = path + reset_context() + + channel = Channel('local') + assert channel.channel_name == "local" + assert channel.channel_location is None + assert channel.platform is None + assert channel.package_filename is None + assert channel.auth is None + assert channel.token is None + assert channel.scheme is None + assert channel.canonical_name == "local" + assert channel.url() is None + assert channel.urls() == [ + join_url(url, context.subdir), + join_url(url, 'noarch'), + ] + + channel = Channel(url) + assert channel.canonical_name == "local" + assert channel.platform is None + assert channel.package_filename is None + assert channel.auth is None + assert channel.token is None + assert channel.scheme == "file" + assert channel.urls() == [ + join_url(url, context.subdir), + join_url(url, 'noarch'), + ] + assert channel.url() == join_url(url, context.subdir) + assert channel.channel_name == basename(path) + assert channel.channel_location == path_to_url(dirname(path)).replace('file://', '', 1) + assert channel.canonical_name == "local" + + finally: + if saved_envs_path: + os.environ['CONDA_BLD_PATH'] = saved_envs_path + else: + del os.environ['CONDA_BLD_PATH'] + + def test_conda_bld_path_2(self): + saved_envs_path = os.environ.get('CONDA_BLD_PATH') + beginning = "C:" + os.sep if on_win else os.sep + path = beginning + os.sep.join(['random', 'directory']) + url = path_to_url(path) + try: + os.environ['CONDA_BLD_PATH'] = path + reset_context() + + channel = Channel('local') + assert channel.channel_name == "local" + assert channel.channel_location is None + assert channel.platform is None + assert channel.package_filename is None + assert channel.auth is None + assert channel.token is None + assert channel.scheme is None + assert channel.canonical_name == "local" + assert channel.url() is None + assert channel.urls() == [ + join_url(url, context.subdir), + join_url(url, 'noarch'), + ] + + channel = Channel(url) + assert channel.canonical_name == "local" + assert channel.platform is None + assert channel.package_filename is None + assert channel.auth is None + assert channel.token is None + assert channel.scheme == "file" + assert channel.urls() == [ + join_url(url, context.subdir), + join_url(url, 'noarch'), + ] + assert channel.url() == join_url(url, context.subdir) + assert channel.channel_name == basename(path) + assert channel.channel_location == path_to_url(dirname(path)).replace('file://', '', 1) + assert channel.canonical_name == "local" + + finally: + if saved_envs_path: + os.environ['CONDA_BLD_PATH'] = saved_envs_path + else: + del os.environ['CONDA_BLD_PATH']
Document that $CONDA_BLD_PATH must end with "/conda-bld" (and stop breaking stuff with minor releases) On September 30, @kalefranz inserted a new assertion (`name == 'conda-bld'`) into `context.py` ([see here](https://github.com/conda/conda/blame/master/conda/base/context.py#L299)) causing `conda info` to fail when `CONDA_BLD_PATH` does not end with `/conda-bld`: ``` console $ CONDA_BLD_PATH=/tmp conda info An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues `$ /home/user/conda/bin/conda info` Traceback (most recent call last): File "/home/user/conda/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main exit_code = args.func(args, p) File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main_info.py", line 225, in execute channels = list(prioritize_channels(channels).keys()) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 380, in prioritize_channels channel = Channel(chn) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 161, in __call__ c = Channel.from_value(value) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 211, in from_value return Channel.from_url(value) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 196, in from_url return parse_conda_channel_url(url) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 132, in parse_conda_channel_url configured_token) = _read_channel_configuration(scheme, host, port, path) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 97, in _read_channel_configuration for name, channel in sorted(context.custom_channels.items(), reverse=True, File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget cache[inner_attname] = func(self) File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 265, in custom_channels all_sources = self.default_channels, (self.local_build_root_channel,), custom_channels File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget cache[inner_attname] = func(self) File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 246, in local_build_root_channel assert name == 'conda-bld' AssertionError ``` This change was not documented and led to a hard to trace failure of our test suite (we set `$CONDA_BLD_PATH` in our test suite and `conda info` is, e.g., run by `conda build`). Unfortunately, this was not the first time that conda/conda-build introduced subtle, but breaking changes in a patch release. Document that $CONDA_BLD_PATH must end with "/conda-bld" (and stop breaking stuff with minor releases) On September 30, @kalefranz inserted a new assertion (`name == 'conda-bld'`) into `context.py` ([see here](https://github.com/conda/conda/blame/master/conda/base/context.py#L299)) causing `conda info` to fail when `CONDA_BLD_PATH` does not end with `/conda-bld`: ``` console $ CONDA_BLD_PATH=/tmp conda info An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues `$ /home/user/conda/bin/conda info` Traceback (most recent call last): File "/home/user/conda/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main exit_code = args.func(args, p) File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main_info.py", line 225, in execute channels = list(prioritize_channels(channels).keys()) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 380, in prioritize_channels channel = Channel(chn) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 161, in __call__ c = Channel.from_value(value) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 211, in from_value return Channel.from_url(value) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 196, in from_url return parse_conda_channel_url(url) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 132, in parse_conda_channel_url configured_token) = _read_channel_configuration(scheme, host, port, path) File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 97, in _read_channel_configuration for name, channel in sorted(context.custom_channels.items(), reverse=True, File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget cache[inner_attname] = func(self) File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 265, in custom_channels all_sources = self.default_channels, (self.local_build_root_channel,), custom_channels File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget cache[inner_attname] = func(self) File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 246, in local_build_root_channel assert name == 'conda-bld' AssertionError ``` This change was not documented and led to a hard to trace failure of our test suite (we set `$CONDA_BLD_PATH` in our test suite and `conda info` is, e.g., run by `conda build`). Unfortunately, this was not the first time that conda/conda-build introduced subtle, but breaking changes in a patch release.
Noting the origin is related to https://github.com/conda/conda/issues/3717, and specifically https://github.com/conda/conda/issues/3717#issuecomment-255830103 and subsequent discussion. I also thought I posted one reply to this already. I guess the comment didn't stick. This is definitely a bug. Any assertion error is a bug, and we let assertion errors slip through the exception handler and provide an ugly stack trace to emphasize that point. An assertion error is a bug. Full stop. That's why we let assertion errors have the big ugly stack trace. I'll work on a fix today. > On Oct 26, 2016, at 3:58 AM, Stefan Scherfke [email protected] wrote: > > On September 30, @kalefranz inserted a new assertion (name == 'conda-bld') into context.py (see here) causing conda info to fail when CONDA_BLD_PATH does not end with /conda-bld: > > $ CONDA_BLD_PATH=/tmp conda info > An unexpected error has occurred. > Please consider posting the following information to the > conda GitHub issue tracker at: > > ``` > https://github.com/conda/conda/issues > ``` > > `$ /home/user/conda/bin/conda info` > > ``` > Traceback (most recent call last): > File "/home/user/conda/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler > return_value = func(*args, **kwargs) > File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main > exit_code = args.func(args, p) > File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main_info.py", line 225, in execute > channels = list(prioritize_channels(channels).keys()) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 380, in prioritize_channels > channel = Channel(chn) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 161, in __call__ > c = Channel.from_value(value) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 211, in from_value > return Channel.from_url(value) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 196, in from_url > return parse_conda_channel_url(url) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 132, in parse_conda_channel_url > configured_token) = _read_channel_configuration(scheme, host, port, path) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 97, in _read_channel_configuration > for name, channel in sorted(context.custom_channels.items(), reverse=True, > File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget > cache[inner_attname] = func(self) > File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 265, in custom_channels > all_sources = self.default_channels, (self.local_build_root_channel,), custom_channels > File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget > cache[inner_attname] = func(self) > File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 246, in local_build_root_channel > assert name == 'conda-bld' > AssertionError > ``` > > This change was not documented and led to a hard to trace failure of our test suite (we set $CONDA_BLD_PATH in our test suite and conda info is, e.g., run by conda build). > > Unfortunately, this was not the first time that conda/conda-build introduced subtle, but breaking changes in a patch release. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread. Noting the origin is related to https://github.com/conda/conda/issues/3717, and specifically https://github.com/conda/conda/issues/3717#issuecomment-255830103 and subsequent discussion. I also thought I posted one reply to this already. I guess the comment didn't stick. This is definitely a bug. Any assertion error is a bug, and we let assertion errors slip through the exception handler and provide an ugly stack trace to emphasize that point. An assertion error is a bug. Full stop. That's why we let assertion errors have the big ugly stack trace. I'll work on a fix today. > On Oct 26, 2016, at 3:58 AM, Stefan Scherfke [email protected] wrote: > > On September 30, @kalefranz inserted a new assertion (name == 'conda-bld') into context.py (see here) causing conda info to fail when CONDA_BLD_PATH does not end with /conda-bld: > > $ CONDA_BLD_PATH=/tmp conda info > An unexpected error has occurred. > Please consider posting the following information to the > conda GitHub issue tracker at: > > ``` > https://github.com/conda/conda/issues > ``` > > `$ /home/user/conda/bin/conda info` > > ``` > Traceback (most recent call last): > File "/home/user/conda/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler > return_value = func(*args, **kwargs) > File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main > exit_code = args.func(args, p) > File "/home/user/conda/lib/python3.5/site-packages/conda/cli/main_info.py", line 225, in execute > channels = list(prioritize_channels(channels).keys()) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 380, in prioritize_channels > channel = Channel(chn) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 161, in __call__ > c = Channel.from_value(value) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 211, in from_value > return Channel.from_url(value) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 196, in from_url > return parse_conda_channel_url(url) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 132, in parse_conda_channel_url > configured_token) = _read_channel_configuration(scheme, host, port, path) > File "/home/user/conda/lib/python3.5/site-packages/conda/models/channel.py", line 97, in _read_channel_configuration > for name, channel in sorted(context.custom_channels.items(), reverse=True, > File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget > cache[inner_attname] = func(self) > File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 265, in custom_channels > all_sources = self.default_channels, (self.local_build_root_channel,), custom_channels > File "/home/user/conda/lib/python3.5/site-packages/conda/_vendor/auxlib/decorators.py", line 265, in new_fget > cache[inner_attname] = func(self) > File "/home/user/conda/lib/python3.5/site-packages/conda/base/context.py", line 246, in local_build_root_channel > assert name == 'conda-bld' > AssertionError > ``` > > This change was not documented and led to a hard to trace failure of our test suite (we set $CONDA_BLD_PATH in our test suite and conda info is, e.g., run by conda build). > > Unfortunately, this was not the first time that conda/conda-build introduced subtle, but breaking changes in a patch release. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread.
2016-10-27T18:45:20
conda/conda
3,748
conda__conda-3748
[ "3717", "3717" ]
2604c2bd504996d1acf627ae9dcc1158a1d73fa5
diff --git a/conda/models/channel.py b/conda/models/channel.py --- a/conda/models/channel.py +++ b/conda/models/channel.py @@ -73,9 +73,14 @@ def _get_channel_for_name_helper(name): def _read_channel_configuration(scheme, host, port, path): # return location, name, scheme, auth, token - test_url = Url(host=host, port=port, path=path).url.rstrip('/') + path = path and path.rstrip('/') + test_url = Url(host=host, port=port, path=path).url - # Step 1. migrated_custom_channels matches + # Step 1. No path given; channel name is None + if not path: + return Url(host=host, port=port).url.rstrip('/'), None, scheme or None, None, None + + # Step 2. migrated_custom_channels matches for name, location in sorted(context.migrated_custom_channels.items(), reverse=True, key=lambda x: len(x[0])): location, _scheme, _auth, _token = split_scheme_auth_token(location) @@ -86,14 +91,14 @@ def _read_channel_configuration(scheme, host, port, path): channel = _get_channel_for_name(channel_name) return channel.location, channel_name, channel.scheme, channel.auth, channel.token - # Step 2. migrated_channel_aliases matches + # Step 3. migrated_channel_aliases matches for migrated_alias in context.migrated_channel_aliases: if test_url.startswith(migrated_alias.location): name = test_url.replace(migrated_alias.location, '', 1).strip('/') ca = context.channel_alias return ca.location, name, ca.scheme, ca.auth, ca.token - # Step 3. custom_channels matches + # Step 4. custom_channels matches for name, channel in sorted(context.custom_channels.items(), reverse=True, key=lambda x: len(x[0])): that_test_url = join_url(channel.location, channel.name) @@ -102,13 +107,13 @@ def _read_channel_configuration(scheme, host, port, path): return (channel.location, join_url(channel.name, subname), scheme, channel.auth, channel.token) - # Step 4. channel_alias match + # Step 5. channel_alias match ca = context.channel_alias if ca.location and test_url.startswith(ca.location): name = test_url.replace(ca.location, '', 1).strip('/') or None return ca.location, name, scheme, ca.auth, ca.token - # Step 5. not-otherwise-specified file://-type urls + # Step 6. not-otherwise-specified file://-type urls if host is None: # this should probably only happen with a file:// type url assert port is None @@ -118,7 +123,7 @@ def _read_channel_configuration(scheme, host, port, path): _scheme, _auth, _token = 'file', None, None return location, name, _scheme, _auth, _token - # Step 6. fall through to host:port as channel_location and path as channel_name + # Step 7. fall through to host:port as channel_location and path as channel_name return (Url(host=host, port=port).url.rstrip('/'), path.strip('/') or None, scheme or None, None, None) @@ -250,7 +255,7 @@ def canonical_name(self): return multiname for that_name in context.custom_channels: - if tokenized_startswith(self.name.split('/'), that_name.split('/')): + if self.name and tokenized_startswith(self.name.split('/'), that_name.split('/')): return self.name if any(c.location == self.location @@ -259,7 +264,7 @@ def canonical_name(self): # fall back to the equivalent of self.base_url # re-defining here because base_url for MultiChannel is None - return "%s://%s/%s" % (self.scheme, self.location, self.name) + return "%s://%s" % (self.scheme, join_url(self.location, self.name)) def urls(self, with_credentials=False, platform=None): base = [self.location]
diff --git a/tests/models/test_channel.py b/tests/models/test_channel.py --- a/tests/models/test_channel.py +++ b/tests/models/test_channel.py @@ -5,6 +5,7 @@ from conda.base.context import context, reset_context from conda.common.compat import odict from conda.common.configuration import YamlRawParameter +from conda.common.url import join_url from conda.common.yaml import yaml_load from conda.models.channel import Channel from conda.utils import on_win @@ -85,6 +86,22 @@ def test_url_channel_w_platform(self): 'https://repo.continuum.io/pkgs/free/noarch', ] + def test_bare_channel(self): + url = "http://conda-01" + channel = Channel(url) + assert channel.scheme == "http" + assert channel.location == "conda-01" + assert channel.platform is None + assert channel.canonical_name == url + assert channel.name is None + + assert channel.base_url == url + assert channel.url() == join_url(url, context.subdir) + assert channel.urls() == [ + join_url(url, context.subdir), + join_url(url, 'noarch'), + ] + class AnacondaServerChannelTests(TestCase):
regression bug: https://github.com/conda/conda/issues/3235 appears to have resurrected itself in another place The bug was that conda handled the channel "http://conda-01" incorrectly. Here's the stack trace in conda 4.2.11: ``` Traceback (most recent call last): File "C:\Miniconda3\lib\site-packages\conda\exceptions.py", line 479, in c onda_exception_handler return_value = func(*args, **kwargs) File "C:\Miniconda3\lib\site-packages\conda\cli\main.py", line 145, in _ma in exit_code = args.func(args, p) File "C:\Miniconda3\lib\site-packages\conda\cli\main_update.py", line 65, in execute install(args, parser, 'update') File "C:\Miniconda3\lib\site-packages\conda\cli\install.py", line 308, in install update_deps=context.update_dependencies) File "C:\Miniconda3\lib\site-packages\conda\plan.py", line 526, in install _actions force=force, always_copy=always_copy) File "C:\Miniconda3\lib\site-packages\conda\plan.py", line 308, in ensure_ linked_actions fetched_in = is_fetched(dist) File "C:\Miniconda3\lib\site-packages\conda\install.py", line 727, in is_f etched for fn in package_cache().get(dist, {}).get('files', ()): File "C:\Miniconda3\lib\site-packages\conda\install.py", line 675, in pack age_cache add_cached_package(pdir, url) File "C:\Miniconda3\lib\site-packages\conda\install.py", line 633, in add_ cached_package schannel = Channel(url).canonical_name File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 161, in __call__ c = Channel.from_value(value) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 211, in from_value return Channel.from_url(value) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 196, in from_url return parse_conda_channel_url(url) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 132, in parse_conda_channel_url configured_token) = _read_channel_configuration(scheme, host, port, path ) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 122, in _read_channel_configuration return (Url(host=host, port=port).url.rstrip('/'), path.strip('/') or No ne, AttributeError: 'NoneType' object has no attribute 'strip' ``` regression bug: https://github.com/conda/conda/issues/3235 appears to have resurrected itself in another place The bug was that conda handled the channel "http://conda-01" incorrectly. Here's the stack trace in conda 4.2.11: ``` Traceback (most recent call last): File "C:\Miniconda3\lib\site-packages\conda\exceptions.py", line 479, in c onda_exception_handler return_value = func(*args, **kwargs) File "C:\Miniconda3\lib\site-packages\conda\cli\main.py", line 145, in _ma in exit_code = args.func(args, p) File "C:\Miniconda3\lib\site-packages\conda\cli\main_update.py", line 65, in execute install(args, parser, 'update') File "C:\Miniconda3\lib\site-packages\conda\cli\install.py", line 308, in install update_deps=context.update_dependencies) File "C:\Miniconda3\lib\site-packages\conda\plan.py", line 526, in install _actions force=force, always_copy=always_copy) File "C:\Miniconda3\lib\site-packages\conda\plan.py", line 308, in ensure_ linked_actions fetched_in = is_fetched(dist) File "C:\Miniconda3\lib\site-packages\conda\install.py", line 727, in is_f etched for fn in package_cache().get(dist, {}).get('files', ()): File "C:\Miniconda3\lib\site-packages\conda\install.py", line 675, in pack age_cache add_cached_package(pdir, url) File "C:\Miniconda3\lib\site-packages\conda\install.py", line 633, in add_ cached_package schannel = Channel(url).canonical_name File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 161, in __call__ c = Channel.from_value(value) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 211, in from_value return Channel.from_url(value) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 196, in from_url return parse_conda_channel_url(url) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 132, in parse_conda_channel_url configured_token) = _read_channel_configuration(scheme, host, port, path ) File "C:\Miniconda3\lib\site-packages\conda\models\channel.py", line 122, in _read_channel_configuration return (Url(host=host, port=port).url.rstrip('/'), path.strip('/') or No ne, AttributeError: 'NoneType' object has no attribute 'strip' ```
Adding some print statements gives the following specific variable values from split_conda_url_easy_parts in the innermost calls: ``` url=http://conda-01/win-64/qt5-5.6.1.1-msvc2015rel_2.tar.bz2 host=conda-01 port=None path=None query=None scheme=http ``` Yeah I know where the bug is. 4.2.11 introduced the requirement that every channel have a "name." At least one directory level beyond the host and port. I guess I didn't remember #3235, and was hoping everyone had at least one directory layer. We need this to allow channels to have locations. That is, we need to uniquely identify channels, but they also need to be able to move locations. Each channel needs a deterministic name. 4.2.11 does that, but it assumes at least one directory level beyond the network location. Cool, I guess the fix is to allow an empty string as the unique name, replacing None? Maybe. I'm not sure just yet. Thinking... Need to chat with @mcg1969 about this. But I'm out of the office today. @mwiebe How invasive would it be to your infrastructure to add one directory level? Even if I hack a fix here, I think you're going to want to do this in the future. We're progressively moving toward making "channel" a first-class-citizen in a package specification. You'll be able to specify channel along with package on the command line. Likely something similar to ``` conda install channel_name/package_name ``` Note there I have `channel_name`, because channels fundamentally need to move locations with proper configuration. The no-channel-name/empty-channel-name case just really doesn't work here. I'm still thinking on solutions though... Either way this is definitely a bug. Whether we ultimately find a way to handle no-name channels cleanly, or just need to alert that the specified channel is invalid. It's definitely something we can do, just in a phased way. This bug basically trickled down to the "reinstall miniconda" fix. In the system you're moving towards, how is a channel on anaconda.org distinguished from a channel on someone's local server? If we make http://conda-01/stable the location where we put packages once we're happy with them for development environments, how should that interact with the wholly separate anaconda/"defaults" set of channels? There's very robust configuration for all of that. New in 4.2. The docs are behind; still working on those. But, to answer your exact question, all you would do is add ``` custom_channels: stable: http://conda-01 ``` in your condarc file. (There are now multiple places for condarc configs, including in activated env directories.) I'm seeing this also. I reference a channel of the form 'http://conda.ourserver.com' that I don't have control over right now. Any work around? ``` platform : linux-64 conda version : 4.2.11 conda is private : False conda-env version : 4.2.11 conda-build version : 1.18.2 python version : 2.7.11.final.0 requests version : 2.11.1 ``` Best workaround I've come up with is to wipe out all the contents of the `<anaconda>/pkgs` directory, then downgrade to 4.2.9. Adding some print statements gives the following specific variable values from split_conda_url_easy_parts in the innermost calls: ``` url=http://conda-01/win-64/qt5-5.6.1.1-msvc2015rel_2.tar.bz2 host=conda-01 port=None path=None query=None scheme=http ``` Yeah I know where the bug is. 4.2.11 introduced the requirement that every channel have a "name." At least one directory level beyond the host and port. I guess I didn't remember #3235, and was hoping everyone had at least one directory layer. We need this to allow channels to have locations. That is, we need to uniquely identify channels, but they also need to be able to move locations. Each channel needs a deterministic name. 4.2.11 does that, but it assumes at least one directory level beyond the network location. Cool, I guess the fix is to allow an empty string as the unique name, replacing None? Maybe. I'm not sure just yet. Thinking... Need to chat with @mcg1969 about this. But I'm out of the office today. @mwiebe How invasive would it be to your infrastructure to add one directory level? Even if I hack a fix here, I think you're going to want to do this in the future. We're progressively moving toward making "channel" a first-class-citizen in a package specification. You'll be able to specify channel along with package on the command line. Likely something similar to ``` conda install channel_name/package_name ``` Note there I have `channel_name`, because channels fundamentally need to move locations with proper configuration. The no-channel-name/empty-channel-name case just really doesn't work here. I'm still thinking on solutions though... Either way this is definitely a bug. Whether we ultimately find a way to handle no-name channels cleanly, or just need to alert that the specified channel is invalid. It's definitely something we can do, just in a phased way. This bug basically trickled down to the "reinstall miniconda" fix. In the system you're moving towards, how is a channel on anaconda.org distinguished from a channel on someone's local server? If we make http://conda-01/stable the location where we put packages once we're happy with them for development environments, how should that interact with the wholly separate anaconda/"defaults" set of channels? There's very robust configuration for all of that. New in 4.2. The docs are behind; still working on those. But, to answer your exact question, all you would do is add ``` custom_channels: stable: http://conda-01 ``` in your condarc file. (There are now multiple places for condarc configs, including in activated env directories.) I'm seeing this also. I reference a channel of the form 'http://conda.ourserver.com' that I don't have control over right now. Any work around? ``` platform : linux-64 conda version : 4.2.11 conda is private : False conda-env version : 4.2.11 conda-build version : 1.18.2 python version : 2.7.11.final.0 requests version : 2.11.1 ``` Best workaround I've come up with is to wipe out all the contents of the `<anaconda>/pkgs` directory, then downgrade to 4.2.9.
2016-10-27T19:38:37
conda/conda
3,811
conda__conda-3811
[ "3807" ]
d5af6bb5798b69beb27bb670d01fb5621bae0e4d
diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -13,6 +13,7 @@ from .common import (Completer, add_parser_json, stdout_json_success) from .. import CondaError from .._vendor.auxlib.compat import isiterable +from .._vendor.auxlib.entity import EntityEncoder from .._vendor.auxlib.type_coercion import boolify from ..base.context import context from ..common.configuration import pretty_list, pretty_map @@ -303,7 +304,8 @@ def execute_config(args, parser): 'verbosity', ))) if context.json: - print(json.dumps(d, sort_keys=True, indent=2, separators=(',', ': '))) + print(json.dumps(d, sort_keys=True, indent=2, separators=(',', ': '), + cls=EntityEncoder)) else: print('\n'.join(format_dict(d))) context.validate_configuration() diff --git a/conda/models/channel.py b/conda/models/channel.py --- a/conda/models/channel.py +++ b/conda/models/channel.py @@ -335,6 +335,9 @@ def __nonzero__(self): def __bool__(self): return self.__nonzero__() + def __json__(self): + return self.__dict__ + @property def url_channel_wtf(self): return self.base_url, self.canonical_name
conda config --show --json fails with TypeError is not JSON serializable. ``` $conda config --show --json { "error": "Traceback (most recent call last):\n File \"C:\\Anaconda\\lib\\site-packages\\conda\\exceptions.py\", line 479, in conda_exception_handler\n return_value = func(*args, **kwargs)\n File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main.py\", line 145, in _main\n exit_code = args.func(args, p)\n File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main_config.py\", line 230, in execute\n execute_config(args, parser)\n File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main_config.py\", line 306, in execute_config\n print(json.dumps(d, sort_keys=True, indent=2, separators=(',', ': ')))\n File \"C:\\Anaconda\\lib\\json\\__init__.py\", line 251, in dumps\n sort_keys=sort_keys, **kw).encode(obj)\n File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 209, in encode\n chunks = list(chunks)\n File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 434, in _iterencode\n for chunk in _iterencode_dict(o, _current_indent_level):\n File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 408, in _iterencode_dict\n for chunk in chunks:\n File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 442, in _iterencode\n o = _default(o)\n File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 184, in default\n raise TypeError(repr(o) + \" is not JSON serializable\")\nTypeError: Channel(scheme=https, auth=None, location=conda.anaconda.org, token=None, name=None, platform=None, package_filename=None) is not JSON serializable\n" } ``` expanding the traceback for better readability: ``` Traceback (most recent call last): File \"C:\\Anaconda\\lib\\site-packages\\conda\\exceptions.py\", line 479, in conda_exception_handler return_value = func(*args, **kwargs) File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main.py\", line 145, in _main exit_code = args.func(args, p) File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main_config.py\", line 230, in execute execute_config(args, parser) File \"C:\\Anaconda\\lib\\site-packages\\conda\\cli\\main_config.py\", line 306, in execute_config print(json.dumps(d, sort_keys=True, indent=2, separators=(',', ': '))) File \"C:\\Anaconda\\lib\\json\\__init__.py\", line 251, in dumps sort_keys=sort_keys, **kw).encode(obj) File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 209, in encode chunks = list(chunks) File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 434, in _iterencode for chunk in _iterencode_dict(o, _current_indent_level): File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 408, in _iterencode_dict for chunk in chunks: File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 442, in _iterencode o = _default(o) File \"C:\\Anaconda\\lib\\json\\encoder.py\", line 184, in default raise TypeError(repr(o) + \" is not JSON serializable\") TypeError: Channel(scheme=https, auth=None, location=conda.anaconda.org, token=None, name=None, platform=None, package_filename=None) is not JSON serializable ``` `conda config --show` works fine. Tested with: ``` Current conda install: platform : win-64 conda version : 4.2.11 conda is private : False conda-env version : 4.2.11 conda-build version : 1.21.3 python version : 2.7.12.final.0 requests version : 2.11.1 ``` and ``` Current conda install: platform : linux-64 conda version : 4.2.12 conda is private : False conda-env version : 4.2.12 conda-build version : 1.20.0 python version : 2.7.12.final.0 requests version : 2.9.1 ``` `conda config --json --show-sources` works fine.
2016-11-04T19:30:17
conda/conda
3,813
conda__conda-3813
[ "3801" ]
d5af6bb5798b69beb27bb670d01fb5621bae0e4d
diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -77,17 +77,17 @@ def explicit(specs, prefix, verbose=False, force_extract=True, index_args=None, # is_local: if the tarball is stored locally (file://) # is_cache: if the tarball is sitting in our cache is_local = not is_url(url) or url.startswith('file://') - prefix = cached_url(url) if is_local else None - is_cache = prefix is not None + url_prefix = cached_url(url) if is_local else None + is_cache = url_prefix is not None if is_cache: # Channel information from the cache - schannel = DEFAULTS if prefix == '' else prefix[:-2] + schannel = DEFAULTS if url_prefix == '' else url_prefix[:-2] else: # Channel information from the URL channel, schannel = Channel(url).url_channel_wtf - prefix = '' if schannel == DEFAULTS else schannel + '::' + url_prefix = '' if schannel == DEFAULTS else schannel + '::' - fn = prefix + fn + fn = url_prefix + fn dist = Dist(fn[:-8]) # Add explicit file to index so we'll be sure to see it later if is_local:
local install create file: folder Hi, A folder named `file:` is always created if I installed conda package locally. `conda install /local/path/bz2` related to: https://github.com/conda/conda/issues/3770 ```bash $ conda info Current conda install: platform : linux-64 conda version : 4.2.11 conda is private : False conda-env version : 4.2.11 conda-build version : 2.0.7 python version : 3.5.1.final.0 requests version : 2.9.1 root environment : /home/haichit/anaconda3 (writable) default environment : /home/haichit/anaconda3 envs directories : /home/haichit/anaconda3/envs package cache : /home/haichit/anaconda3/pkgs channel URLs : https://conda.anaconda.org/conda-canary/linux-64 https://conda.anaconda.org/conda-canary/noarch https://repo.continuum.io/pkgs/free/linux-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/pro/linux-64 https://repo.continuum.io/pkgs/pro/noarch https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/ambermd/linux-64 https://conda.anaconda.org/ambermd/noarch config file : /home/haichit/.condarc offline mode : False ```
2016-11-04T23:30:56
conda/conda
3,832
conda__conda-3832
[ "3830" ]
1fcd3e169389e8add2f7e4d0fda0aa984c816c24
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -79,6 +79,8 @@ class Context(Configuration): _channel_alias = PrimitiveParameter(DEFAULT_CHANNEL_ALIAS, aliases=('channel_alias',), validation=channel_alias_validation) + http_connect_timeout_secs = PrimitiveParameter(6.1) + http_read_timeout_secs = PrimitiveParameter(60.) # channels channels = SequenceParameter(string_types, default=('defaults',)) diff --git a/conda/core/index.py b/conda/core/index.py --- a/conda/core/index.py +++ b/conda/core/index.py @@ -130,8 +130,9 @@ def fetch_repodata(url, cache_dir=None, use_cache=False, session=None): filename = 'repodata.json' try: + timeout = context.http_connect_timeout_secs, context.http_read_timeout_secs resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies, - timeout=(3.05, 60)) + timeout=timeout) if log.isEnabledFor(DEBUG): log.debug(stringify(resp)) resp.raise_for_status() diff --git a/conda/core/package_cache.py b/conda/core/package_cache.py --- a/conda/core/package_cache.py +++ b/conda/core/package_cache.py @@ -321,7 +321,8 @@ def download(url, dst_path, session=None, md5=None, urlstxt=False, retries=None) with FileLock(dst_path): rm_rf(dst_path) try: - resp = session.get(url, stream=True, proxies=session.proxies, timeout=(3.05, 27)) + timeout = context.http_connect_timeout_secs, context.http_read_timeout_secs + resp = session.get(url, stream=True, proxies=session.proxies, timeout=timeout) resp.raise_for_status() except requests.exceptions.HTTPError as e: msg = "HTTPError: %s: %s\n" % (e, url)
Make http timeouts configurable http://docs.python-requests.org/en/master/user/advanced/#timeouts Also set defaults to 2x current defaults. CC @quasiben
2016-11-08T03:08:28
conda/conda
3,931
conda__conda-3931
[ "3910" ]
5621882c6fd06ee263738c8981e419df772150b4
diff --git a/conda/common/url.py b/conda/common/url.py --- a/conda/common/url.py +++ b/conda/common/url.py @@ -68,6 +68,8 @@ def url_to_s3_info(url): def is_url(url): + if not url: + return False try: p = urlparse(url) return p.netloc is not None or p.scheme == "file"
Regression: cannot install from explicit conda package filenames This command used to work, but now it gives the following error/traceback: Example: `conda install bzip2-1.0.6-vc14_3.tar.bz2 --dry-run` ``` An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at: https://github.com/conda/conda/issues Current conda install: platform : win-64 conda version : 4.2.12 conda is private : False conda-env version : 4.2.12 conda-build version : 2.0.7 python version : 3.5.2.final.0 requests version : 2.10.0 root environment : C:\Miniconda3 (writable) default environment : C:\Miniconda3\envs\test_conda envs directories : C:\Miniconda3\envs package cache : C:\Miniconda3\pkgs channel URLs : https://repo.continuum.io/pkgs/free/win-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/pro/win-64 https://repo.continuum.io/pkgs/pro/noarch https://repo.continuum.io/pkgs/msys2/win-64 https://repo.continuum.io/pkgs/msys2/noarch config file : None offline mode : False `$ C:\Miniconda3\Scripts\conda-script.py install bzip2-1.0.6-vc14_3.tar.bz2 --dry-run` Traceback (most recent call last): File "C:\Miniconda3\lib\site-packages\conda\exceptions.py", line 479, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Miniconda3\lib\site-packages\conda\cli\main.py", line 145, in _main exit_code = args.func(args, p) File "C:\Miniconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute install(args, parser, 'install') File "C:\Miniconda3\lib\site-packages\conda\cli\install.py", line 209, in install explicit(args.packages, prefix, verbose=not context.quiet) File "C:\Miniconda3\lib\site-packages\conda\misc.py", line 66, in explicit if not is_url(url_p): File "C:\Miniconda3\lib\site-packages\conda\common\url.py", line 72, in is_url p = urlparse(url) File "C:\Miniconda3\lib\site-packages\conda\_vendor\auxlib\decorators.py", line 56, in _memoized_func result = func(*args, **kwargs) File "C:\Miniconda3\lib\site-packages\conda\common\url.py", line 55, in urlparse if on_win and url.startswith('file:'): AttributeError: 'NoneType' object has no attribute 'startswith' ```
Definitely looks like a bug. And I'm really confused why regression tests didn't already catch this. What happens if you actually install the file and don't use `--dry-run`? ``` conda install bzip2-1.0.6-vc14_3.tar.bz2 ``` Same thing? It happens the same thing, with the same traceback. I've tried a lot of other different options (`--force`, `--use-local`, etc.), with no avail. This just bit me as well. I'm working in an air-gapped environment, and can't install anything. @soapy1 If you have time, this is definitely fair game for you to find a fix for. And also figure out why all of the integration tests for this in `test_create.py` aren't catching it!!! This has to be due to a regression in `is_url` used on [this line](https://github.com/conda/conda/blob/master/conda/misc.py#L69). For a local tarball, `url_p` should be `None`, so `is_url` needs to be able to handle that case. Yes, that's exactly the problem. The [current version of `is_url`](https://github.com/conda/conda/blob/master/conda/common/url.py#L73) no longer handles a `None` input. The [previous version](https://github.com/conda/conda/commit/90a79764482dcfeb075c3b6b30164ceb86d3bebe#diff-32acb1ec31b5dbb2bafea7655667e908L178) explicitly did so. Thanks @mcg1969
2016-11-22T06:05:22
conda/conda
3,969
conda__conda-3969
[ "4378" ]
ca57ef2a1ac70355d1aeb58ddc2da78f655c4fbc
diff --git a/conda/egg_info.py b/conda/egg_info.py --- a/conda/egg_info.py +++ b/conda/egg_info.py @@ -30,6 +30,10 @@ def get_site_packages_dir(installed_pkgs): def get_egg_info_files(sp_dir): for fn in os.listdir(sp_dir): + if fn.endswith('.egg-link'): + with open(join(sp_dir, fn), 'r') as reader: + for egg in get_egg_info_files(reader.readline().strip()): + yield egg if not fn.endswith(('.egg', '.egg-info', '.dist-info')): continue path = join(sp_dir, fn) diff --git a/conda_env/installers/pip.py b/conda_env/installers/pip.py --- a/conda_env/installers/pip.py +++ b/conda_env/installers/pip.py @@ -1,13 +1,56 @@ from __future__ import absolute_import + +import os +import os.path as op import subprocess +import tempfile from conda_env.pip_util import pip_args from conda.exceptions import CondaValueError -def install(prefix, specs, args, env, prune=False): - pip_cmd = pip_args(prefix) + ['install', ] + specs - process = subprocess.Popen(pip_cmd, universal_newlines=True) - process.communicate() +def _pip_install_via_requirements(prefix, specs, args, *_): + """ + Installs the pip dependencies in specs using a temporary pip requirements file. + + Args + ---- + prefix: string + The path to the python and pip executables. + + specs: iterable of strings + Each element should be a valid pip dependency. + See: https://pip.pypa.io/en/stable/user_guide/#requirements-files + https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format + """ + try: + pip_workdir = op.dirname(op.abspath(args.file)) + except AttributeError: + pip_workdir = None + requirements = None + try: + # Generate the temporary requirements file + requirements = tempfile.NamedTemporaryFile(mode='w', + prefix='condaenv.', + suffix='.requirements.txt', + dir=pip_workdir, + delete=False) + requirements.write('\n'.join(specs)) + requirements.close() + # pip command line... + pip_cmd = pip_args(prefix) + ['install', '-r', requirements.name] + # ...run it + process = subprocess.Popen(pip_cmd, + cwd=pip_workdir, + universal_newlines=True) + process.communicate() + if process.returncode != 0: + raise CondaValueError("pip returned an error") + finally: + # Win/Appveyor does not like it if we use context manager + delete=True. + # So we delete the temporary file in a finally block. + if requirements is not None and op.isfile(requirements.name): + os.remove(requirements.name) + - if process.returncode != 0: - raise CondaValueError("pip returned an error.") +# Conform to Installers API +install = _pip_install_via_requirements
diff --git a/tests/conda_env/installers/test_pip.py b/tests/conda_env/installers/test_pip.py --- a/tests/conda_env/installers/test_pip.py +++ b/tests/conda_env/installers/test_pip.py @@ -4,21 +4,40 @@ except ImportError: import mock +import os from conda_env.installers import pip from conda.exceptions import CondaValueError + class PipInstallerTest(unittest.TestCase): def test_straight_install(self): - with mock.patch.object(pip.subprocess, 'Popen') as popen: - popen.return_value.returncode = 0 - with mock.patch.object(pip, 'pip_args') as pip_args: - pip_args.return_value = ['pip'] - pip.install('/some/prefix', ['foo'], '', '') + # To check that the correct file would be written + written_deps = [] + + def log_write(text): + written_deps.append(text) + return mock.DEFAULT - popen.assert_called_with(['pip', 'install', 'foo'], - universal_newlines=True) - self.assertEqual(1, popen.return_value.communicate.call_count) + with mock.patch.object(pip.subprocess, 'Popen') as mock_popen, \ + mock.patch.object(pip, 'pip_args') as mock_pip_args, \ + mock.patch('tempfile.NamedTemporaryFile', mock.mock_open()) as mock_namedtemp: + # Mock + mock_popen.return_value.returncode = 0 + mock_pip_args.return_value = ['pip'] + mock_namedtemp.return_value.write.side_effect = log_write + mock_namedtemp.return_value.name = 'tmp-file' + args = mock.Mock() + root_dir = '/whatever' if os.name != 'nt' else 'C:\\whatever' + args.file = os.path.join(root_dir, 'environment.yml') + # Run + pip.install('/some/prefix', ['foo', '-e ./bar'], args) + # Check expectations + mock_popen.assert_called_with(['pip', 'install', '-r', 'tmp-file'], + cwd=root_dir, + universal_newlines=True) + self.assertEqual(1, mock_popen.return_value.communicate.call_count) + self.assertEqual(written_deps, ['foo\n-e ./bar']) def test_stops_on_exception(self): with mock.patch.object(pip.subprocess, 'Popen') as popen: @@ -28,4 +47,4 @@ def test_stops_on_exception(self): pip_args.return_value = ['pip'] self.assertRaises(CondaValueError, pip.install, - '/some/prefix', ['foo'], '', '') + '/some/prefix', ['foo'], None) diff --git a/tests/conda_env/support/advanced-pip/.gitignore b/tests/conda_env/support/advanced-pip/.gitignore new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/advanced-pip/.gitignore @@ -0,0 +1 @@ +src diff --git a/tests/conda_env/support/advanced-pip/another-project-requirements.txt b/tests/conda_env/support/advanced-pip/another-project-requirements.txt new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/advanced-pip/another-project-requirements.txt @@ -0,0 +1 @@ +six diff --git a/tests/conda_env/support/advanced-pip/environment.yml b/tests/conda_env/support/advanced-pip/environment.yml new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/advanced-pip/environment.yml @@ -0,0 +1,29 @@ +name: advanced-pip-example + +dependencies: + - pip + - pip: + + # Global options can be tweaked. + # For example, if you want to use a pypi mirror first: + - --index-url https://pypi.doubanio.com/simple + - --extra-index-url https://pypi.python.org/simple + # (check https://www.pypi-mirrors.org/) + + # Current syntax still works + - xmltodict==0.10.2 + + # Install in editable mode. + # More natural than - "--editable=git+https://github.com/neithere/argh.git#egg=argh + - -e git+https://github.com/neithere/argh.git#egg=argh + + # You could also specify a package in a directory. + # The directory can be relative to this environment file. + - -e ./module_to_install_in_editable_mode + + # Use another requirements file. + # Note that here also we can use relative paths. + # pip will be run from the environment file directory, if provided. + - -r another-project-requirements.txt + + # Anything else that pip requirement files allows should work seamlessly... diff --git a/tests/conda_env/support/advanced-pip/module_to_install_in_editable_mode/setup.py b/tests/conda_env/support/advanced-pip/module_to_install_in_editable_mode/setup.py new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/advanced-pip/module_to_install_in_editable_mode/setup.py @@ -0,0 +1,6 @@ +from setuptools import setup + +setup( + name='module_to_install_in_editable_mode', + packages=[], +) diff --git a/tests/conda_env/test_create.py b/tests/conda_env/test_create.py --- a/tests/conda_env/test_create.py +++ b/tests/conda_env/test_create.py @@ -2,10 +2,12 @@ from __future__ import absolute_import, division, print_function from argparse import ArgumentParser +from unittest import TestCase from conda.base.context import reset_context from conda.common.io import env_var +from conda.egg_info import get_egg_info from conda.exports import text_type from contextlib import contextmanager from logging import getLogger, Handler @@ -13,7 +15,6 @@ from shlex import split from shutil import rmtree from tempfile import mkdtemp -from unittest import TestCase from uuid import uuid4 import pytest @@ -60,7 +61,7 @@ class Commands: } -def run_command(command, envs_dir, env_name, *arguments): +def run_command(command, env_name, *arguments): p = ArgumentParser() sub_parsers = p.add_subparsers(metavar='command', dest='cmd') parser_config[command](sub_parsers) @@ -81,8 +82,8 @@ def make_temp_envs_dir(): rmtree(envs_dir, ignore_errors=True) -def package_is_installed(prefix, dist, exact=False): - packages = list(linked(prefix)) +def package_is_installed(prefix, dist, exact=False, pip=False): + packages = list(get_egg_info(prefix) if pip else linked(prefix)) if '::' not in text_type(dist): packages = [p.dist_name for p in packages] if exact: @@ -90,8 +91,8 @@ def package_is_installed(prefix, dist, exact=False): return any(p.startswith(dist) for p in packages) -def assert_package_is_installed(prefix, package, exact=False): - if not package_is_installed(prefix, package, exact): +def assert_package_is_installed(prefix, package, exact=False, pip=False): + if not package_is_installed(prefix, package, exact, pip): print(list(linked(prefix))) raise AssertionError("package {0} is not in prefix".format(package)) @@ -112,10 +113,25 @@ def test_create_update(self): prefix = join(envs_dir, env_name) python_path = join(prefix, PYTHON_BINARY) - run_command(Commands.CREATE, envs_dir, env_name, utils.support_file('example/environment_pinned.yml')) + run_command(Commands.CREATE, env_name, utils.support_file('example/environment_pinned.yml')) assert exists(python_path) assert_package_is_installed(prefix, 'flask-0.9') - run_command(Commands.UPDATE, envs_dir, env_name, utils.support_file('example/environment_pinned_updated.yml')) + run_command(Commands.UPDATE, env_name, utils.support_file('example/environment_pinned_updated.yml')) assert_package_is_installed(prefix, 'flask-0.10.1') assert not package_is_installed(prefix, 'flask-0.9') + + def test_create_advanced_pip(self): + with make_temp_envs_dir() as envs_dir: + with env_var('CONDA_ENVS_DIRS', envs_dir, reset_context): + env_name = str(uuid4())[:8] + prefix = join(envs_dir, env_name) + python_path = join(prefix, PYTHON_BINARY) + + run_command(Commands.CREATE, env_name, + utils.support_file('advanced-pip/environment.yml')) + assert exists(python_path) + assert_package_is_installed(prefix, 'argh', exact=False, pip=True) + assert_package_is_installed(prefix, 'module-to-install-in-editable-mode', exact=False, pip=True) + assert_package_is_installed(prefix, 'six', exact=False, pip=True) + assert_package_is_installed(prefix, 'xmltodict-0.10.2-<pip>', exact=True, pip=True)
Invalid requirement while trying to use pip options Hi! I have in my pip section inside envrionment.yaml file this line ```- rep --install-option='--no-deps'``` while I am trying to update my environment I am getting this error ```Invalid requirement: 'rep --install-option='--no-deps''``` if I do pip -r requirements.txt and I have that line as it is in requirements.txt it works.
2016-11-30T07:37:55
conda/conda
4,100
conda__conda-4100
[ "4097", "4097" ]
cdd0d5ab8ec583768875aab047de65040bead9cf
diff --git a/conda/base/constants.py b/conda/base/constants.py --- a/conda/base/constants.py +++ b/conda/base/constants.py @@ -12,7 +12,10 @@ from os.path import join on_win = bool(sys.platform == "win32") -PREFIX_PLACEHOLDER = '/opt/anaconda1anaconda2anaconda3' +PREFIX_PLACEHOLDER = ('/opt/anaconda1anaconda2' + # this is intentionally split into parts, such that running + # this program on itself will leave it unchanged + 'anaconda3') machine_bits = 8 * tuple.__itemsize__
diff --git a/tests/core/test_portability.py b/tests/core/test_portability.py --- a/tests/core/test_portability.py +++ b/tests/core/test_portability.py @@ -51,11 +51,11 @@ def test_shebang_regex_matches(self): def test_replace_long_shebang(self): content_line = b"content line " * 5 - # # simple shebang no replacement - # shebang = b"#!/simple/shebang/escaped\\ space --and --flags -x" - # data = b'\n'.join((shebang, content_line, content_line, content_line)) - # new_data = replace_long_shebang(FileMode.text, data) - # assert data == new_data + # simple shebang no replacement + shebang = b"#!/simple/shebang/escaped\\ space --and --flags -x" + data = b'\n'.join((shebang, content_line, content_line, content_line)) + new_data = replace_long_shebang(FileMode.text, data) + assert data == new_data # long shebang with truncation # executable name is 'escaped space'
On Windows, conda 4.0.5-py35_0 cannot be updated to 4.3.0-py35_1 On a fresh install of the latest Miniconda on Windows, the following fails: `conda update -c conda-canary --all` Giving: ``` Fetching package metadata: ...... Solving package specifications: ......... Package plan for installation in environment C:\Users\ray\m2-x64-3.5: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.6.0 | 0 498 B vs2015_runtime-14.0.25123 | 0 1.9 MB python-3.5.2 | 0 30.3 MB pycosat-0.6.1 | py35_1 80 KB pycrypto-2.6.1 | py35_4 481 KB pywin32-220 | py35_1 10.4 MB pyyaml-3.12 | py35_0 118 KB requests-2.12.4 | py35_0 791 KB ruamel_yaml-0.11.14 | py35_0 217 KB setuptools-27.2.0 | py35_1 761 KB menuinst-1.4.2 | py35_1 108 KB pip-9.0.1 | py35_1 1.7 MB conda-4.3.0 | py35_1 510 KB ------------------------------------------------------------ Total: 47.3 MB The following NEW packages will be INSTALLED: pywin32: 220-py35_1 ruamel_yaml: 0.11.14-py35_0 The following packages will be UPDATED: conda: 4.0.5-py35_0 --> 4.3.0-py35_1 conda-env: 2.4.5-py35_0 --> 2.6.0-0 menuinst: 1.3.2-py35_0 --> 1.4.2-py35_1 pip: 8.1.1-py35_1 --> 9.0.1-py35_1 pycosat: 0.6.1-py35_0 --> 0.6.1-py35_1 pycrypto: 2.6.1-py35_3 --> 2.6.1-py35_4 python: 3.5.1-4 --> 3.5.2-0 pyyaml: 3.11-py35_3 --> 3.12-py35_0 requests: 2.9.1-py35_0 --> 2.12.4-py35_0 setuptools: 20.3-py35_0 --> 27.2.0-py35_1 vs2015_runtime: 14.00.23026.0-0 --> 14.0.25123-0 Proceed ([y]/n)? y menuinst-1.4.2 100% |###############################| Time: 0:00:00 2.35 MB/s Fetching packages ... conda-env-2.6. 100% |###############################| Time: 0:00:00 0.00 B/s vs2015_runtime 100% |###############################| Time: 0:00:00 9.24 MB/s python-3.5.2-0 100% |###############################| Time: 0:00:02 11.57 MB/s pycosat-0.6.1- 100% |###############################| Time: 0:00:00 2.61 MB/s pycrypto-2.6.1 100% |###############################| Time: 0:00:00 4.51 MB/s pywin32-220-py 100% |###############################| Time: 0:00:00 10.85 MB/s pyyaml-3.12-py 100% |###############################| Time: 0:00:00 2.57 MB/s requests-2.12. 100% |###############################| Time: 0:00:00 5.76 MB/s ruamel_yaml-0. 100% |###############################| Time: 0:00:00 2.84 MB/s setuptools-27. 100% |###############################| Time: 0:00:00 4.53 MB/s pip-9.0.1-py35 100% |###############################| Time: 0:00:00 5.70 MB/s conda-4.3.0-py 100% |###############################| Time: 0:00:00 530.91 kB/s Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 516, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 84, in _main from ..base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\Scripts\conda-script.py", line 5, in <module> sys.exit(conda.cli.main()) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 152, in main return conda_exception_handler(_main) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 532, in conda_exception_handler print_unexpected_error_message(e) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 463, in print_unexpected_error_message from conda.base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 516, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 84, in _main from ..base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\Scripts\conda-script.py", line 5, in <module> sys.exit(conda.cli.main()) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 152, in main return conda_exception_handler(_main) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 532, in conda_exception_handler print_unexpected_error_message(e) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 463, in print_unexpected_error_message from conda.base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape ``` On Windows, conda 4.0.5-py35_0 cannot be updated to 4.3.0-py35_1 On a fresh install of the latest Miniconda on Windows, the following fails: `conda update -c conda-canary --all` Giving: ``` Fetching package metadata: ...... Solving package specifications: ......... Package plan for installation in environment C:\Users\ray\m2-x64-3.5: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.6.0 | 0 498 B vs2015_runtime-14.0.25123 | 0 1.9 MB python-3.5.2 | 0 30.3 MB pycosat-0.6.1 | py35_1 80 KB pycrypto-2.6.1 | py35_4 481 KB pywin32-220 | py35_1 10.4 MB pyyaml-3.12 | py35_0 118 KB requests-2.12.4 | py35_0 791 KB ruamel_yaml-0.11.14 | py35_0 217 KB setuptools-27.2.0 | py35_1 761 KB menuinst-1.4.2 | py35_1 108 KB pip-9.0.1 | py35_1 1.7 MB conda-4.3.0 | py35_1 510 KB ------------------------------------------------------------ Total: 47.3 MB The following NEW packages will be INSTALLED: pywin32: 220-py35_1 ruamel_yaml: 0.11.14-py35_0 The following packages will be UPDATED: conda: 4.0.5-py35_0 --> 4.3.0-py35_1 conda-env: 2.4.5-py35_0 --> 2.6.0-0 menuinst: 1.3.2-py35_0 --> 1.4.2-py35_1 pip: 8.1.1-py35_1 --> 9.0.1-py35_1 pycosat: 0.6.1-py35_0 --> 0.6.1-py35_1 pycrypto: 2.6.1-py35_3 --> 2.6.1-py35_4 python: 3.5.1-4 --> 3.5.2-0 pyyaml: 3.11-py35_3 --> 3.12-py35_0 requests: 2.9.1-py35_0 --> 2.12.4-py35_0 setuptools: 20.3-py35_0 --> 27.2.0-py35_1 vs2015_runtime: 14.00.23026.0-0 --> 14.0.25123-0 Proceed ([y]/n)? y menuinst-1.4.2 100% |###############################| Time: 0:00:00 2.35 MB/s Fetching packages ... conda-env-2.6. 100% |###############################| Time: 0:00:00 0.00 B/s vs2015_runtime 100% |###############################| Time: 0:00:00 9.24 MB/s python-3.5.2-0 100% |###############################| Time: 0:00:02 11.57 MB/s pycosat-0.6.1- 100% |###############################| Time: 0:00:00 2.61 MB/s pycrypto-2.6.1 100% |###############################| Time: 0:00:00 4.51 MB/s pywin32-220-py 100% |###############################| Time: 0:00:00 10.85 MB/s pyyaml-3.12-py 100% |###############################| Time: 0:00:00 2.57 MB/s requests-2.12. 100% |###############################| Time: 0:00:00 5.76 MB/s ruamel_yaml-0. 100% |###############################| Time: 0:00:00 2.84 MB/s setuptools-27. 100% |###############################| Time: 0:00:00 4.53 MB/s pip-9.0.1-py35 100% |###############################| Time: 0:00:00 5.70 MB/s conda-4.3.0-py 100% |###############################| Time: 0:00:00 530.91 kB/s Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100% Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 516, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 84, in _main from ..base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\Scripts\conda-script.py", line 5, in <module> sys.exit(conda.cli.main()) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 152, in main return conda_exception_handler(_main) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 532, in conda_exception_handler print_unexpected_error_message(e) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 463, in print_unexpected_error_message from conda.base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 516, in conda_exception_handler return_value = func(*args, **kwargs) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 84, in _main from ..base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\ray\m2-x64-3.5\Scripts\conda-script.py", line 5, in <module> sys.exit(conda.cli.main()) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\cli\main.py", line 152, in main return conda_exception_handler(_main) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 532, in conda_exception_handler print_unexpected_error_message(e) File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\exceptions.py", line 463, in print_unexpected_error_message from conda.base.context import context File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\context.py", line 12, in <module> from .constants import (APP_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS, ROOT_ENV_NAME, File "C:\Users\ray\m2-x64-3.5\lib\site-packages\conda\base\constants.py", line 15 PREFIX_PLACEHOLDER = 'C:\Users\ray\m2-x64-3.5' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape ```
2016-12-19T01:03:44
conda/conda
4,175
conda__conda-4175
[ "4152", "4152" ]
d01341e40f358753db6ce549977835ab84cfd454
diff --git a/conda_env/env.py b/conda_env/env.py --- a/conda_env/env.py +++ b/conda_env/env.py @@ -36,10 +36,9 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False): name: The name of environment prefix: The path of prefix no_builds: Whether has build requirement - ignore_channels: whether ingore_channels - - Returns: Environment obejct + ignore_channels: whether ignore_channels + Returns: Environment object """ installed = linked(prefix, ignore_channels=ignore_channels) conda_pkgs = copy(installed) @@ -58,7 +57,7 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False): # this doesn't dump correctly using pyyaml channels = list(context.channels) if not ignore_channels: - for dist in installed: + for dist in conda_pkgs: if dist.channel not in channels: channels.insert(0, dist.channel) return Environment(name=name, dependencies=dependencies, channels=channels, prefix=prefix)
conda env export failure Under conda 4.3.1, `conda env export` returns the backtrace: ```Python Traceback (most recent call last): File "/home/alan/anaconda/lib/python3.5/site-packages/conda/exceptions.py", line 515, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/alan/anaconda/lib/python3.5/site-packages/conda_env/cli/main_export.py", line 94, in execute ignore_channels=args.ignore_channels) File "/home/alan/anaconda/lib/python3.5/site-packages/conda_env/env.py", line 62, in from_environment for dist in installed: AttributeError: 'str' object has no attribute 'channel' ``` My current conda information: ``` Current conda install: platform : linux-64 conda version : 4.3.1 conda is private : False conda-env version : 4.3.1 conda-build version : 2.0.12 python version : 3.5.2.final.0 requests version : 2.12.4 root environment : /home/alan/anaconda (writable) default environment : /home/alan/anaconda/envs/labs envs directories : /home/alan/anaconda/envs package cache : /home/alan/anaconda/pkgs channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/conda-canary/linux-64 https://conda.anaconda.org/conda-canary/noarch https://repo.continuum.io/pkgs/free/linux-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/r/linux-64 https://repo.continuum.io/pkgs/r/noarch https://repo.continuum.io/pkgs/pro/linux-64 https://repo.continuum.io/pkgs/pro/noarch config file : /home/alan/.condarc offline mode : False user-agent : conda/4.3.1 requests/2.12.4 CPython/3.5.2 Linux/4.4.0-57-generic debian/stretch/sid glibc/2.23 UID:GID : 1000:1000 ``` conda env export failure Under conda 4.3.1, `conda env export` returns the backtrace: ```Python Traceback (most recent call last): File "/home/alan/anaconda/lib/python3.5/site-packages/conda/exceptions.py", line 515, in conda_exception_handler return_value = func(*args, **kwargs) File "/home/alan/anaconda/lib/python3.5/site-packages/conda_env/cli/main_export.py", line 94, in execute ignore_channels=args.ignore_channels) File "/home/alan/anaconda/lib/python3.5/site-packages/conda_env/env.py", line 62, in from_environment for dist in installed: AttributeError: 'str' object has no attribute 'channel' ``` My current conda information: ``` Current conda install: platform : linux-64 conda version : 4.3.1 conda is private : False conda-env version : 4.3.1 conda-build version : 2.0.12 python version : 3.5.2.final.0 requests version : 2.12.4 root environment : /home/alan/anaconda (writable) default environment : /home/alan/anaconda/envs/labs envs directories : /home/alan/anaconda/envs package cache : /home/alan/anaconda/pkgs channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/conda-canary/linux-64 https://conda.anaconda.org/conda-canary/noarch https://repo.continuum.io/pkgs/free/linux-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/r/linux-64 https://repo.continuum.io/pkgs/r/noarch https://repo.continuum.io/pkgs/pro/linux-64 https://repo.continuum.io/pkgs/pro/noarch config file : /home/alan/.condarc offline mode : False user-agent : conda/4.3.1 requests/2.12.4 CPython/3.5.2 Linux/4.4.0-57-generic debian/stretch/sid glibc/2.23 UID:GID : 1000:1000 ```
2017-01-04T16:42:50
conda/conda
4,241
conda__conda-4241
[ "4235" ]
329161ebd54d23d64ba7d156697d2b254da0c28b
diff --git a/conda/misc.py b/conda/misc.py --- a/conda/misc.py +++ b/conda/misc.py @@ -224,9 +224,10 @@ def clone_env(prefix1, prefix2, verbose=True, quiet=False, index_args=None): if filter: if not quiet: - print('The following packages cannot be cloned out of the root environment:') + fh = sys.stderr if context.json else sys.stdout + print('The following packages cannot be cloned out of the root environment:', file=fh) for pkg in itervalues(filter): - print(' - ' + pkg.dist_name) + print(' - ' + pkg.dist_name, file=fh) drecs = {dist: info for dist, info in iteritems(drecs) if info['name'] not in filter} # Resolve URLs for packages that do not have URLs
non json output on root clone I understand that cloning root env is probably a not very good idea... but even then with the json flag, we get this non json output ``` $ conda create -n rootclone --clone root --json` The following packages cannot be cloned out of the root environment: - conda-build-2.0.2-py35_0 - conda-4.2.13-py35_0 ... (valid Json output) ``` Possible fixes according to @kalefranz - Send that output to stderr - Just eat that output - Please fill in with your suggestion ...
2017-01-09T18:37:31
conda/conda
4,311
conda__conda-4311
[ "4299" ]
6b683eee6e5db831327d317b2ab766548c26d9ea
diff --git a/conda/gateways/download.py b/conda/gateways/download.py --- a/conda/gateways/download.py +++ b/conda/gateways/download.py @@ -95,9 +95,10 @@ def download(url, target_full_path, md5sum): Content-Length: %(content_length)d downloaded bytes: %(downloaded_bytes)d """) - raise CondaError(message, url=url, target_path=target_full_path, - content_length=content_length, - downloaded_bytes=streamed_bytes) + # raise CondaError(message, url=url, target_path=target_full_path, + # content_length=content_length, + # downloaded_bytes=streamed_bytes) + log.info(message) except (IOError, OSError) as e: if e.errno == 104:
Conda 4.3.4 seems to be broken ``` bag@bag ~ % conda --version conda 4.3.4 bag@bag ~ % conda install -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/master/bioconda_utils/bioconda_utils-requirements.txt CondaError: Downloaded bytes did not match Content-Length url: https://raw.githubusercontent.com/bioconda/bioconda-utils/master/bioconda_utils/bioconda_utils-requirements.txt target_path: /tmp/tmpUp36pQ/bioconda_utils-requirements.txt Content-Length: 195 downloaded bytes: 310 bag@bag ~ % ```
Seems like https://github.com/conda/conda/commit/24ad4709#diff-e524c3264718c66b34ea0dadbfc2559fR88 introduced the bug. The request header sent by `requests.session` in this case has: ```bash 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*' ``` AFAIK, the `Content-Length` header holds the raw length of the HTTP body. So, in this case, it will show 195 bytes, which is the size of the compressed 310 bytes. If you do: `print(len(resp.raw.data))` you will see 195. Sort of relevant discussion at: https://github.com/kennethreitz/requests/issues/2155
2017-01-16T04:26:26