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 | 5,452 | conda__conda-5452 | [
"5451"
] | 2dd2233452e96adf3c2b2af232b3fb457ec6a51d | 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
@@ -120,7 +120,7 @@ def rm_tarballs(args, pkgs_dirs, totalsize, verbose=True):
print(fmt % ('Total:', human_bytes(totalsize)))
print()
- if not context.json or not context.yes:
+ if not context.json or not context.always_yes:
confirm_yn(args)
if context.json and args.dry_run:
return
@@ -218,7 +218,7 @@ def rm_pkgs(args, pkgs_dirs, warnings, totalsize, pkgsizes,
print(fmt % ('Total:', human_bytes(totalsize)))
print()
- if not context.json or not context.yes:
+ if not context.json or not context.always_yes:
confirm_yn(args)
if context.json and args.dry_run:
return
@@ -279,7 +279,7 @@ def rm_source_cache(args, cache_dirs, warnings, cache_sizes, total_size):
print("%-40s %10s" % ("Total:", human_bytes(total_size)))
- if not context.json or not context.yes:
+ if not context.json or not context.always_yes:
confirm_yn(args)
if context.json and args.dry_run:
return
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -1072,8 +1072,11 @@ def test_clean_tarballs_and_packages(self):
assert any(basename(d).startswith('flask-') for d in pkgs_dir_dirs)
assert any(basename(f).startswith('flask-') for f in pkgs_dir_tarballs)
- run_command(Commands.CLEAN, prefix, "--packages --yes")
- run_command(Commands.CLEAN, prefix, "--tarballs --yes")
+ # --json flag is regression test for #5451
+ run_command(Commands.CLEAN, prefix, "--packages --yes --json")
+
+ # --json flag is regression test for #5451
+ run_command(Commands.CLEAN, prefix, "--tarballs --yes --json")
pkgs_dir_contents = [join(pkgs_dir, d) for d in os.listdir(pkgs_dir)]
pkgs_dir_dirs = [d for d in pkgs_dir_contents if isdir(d)]
@@ -1102,7 +1105,8 @@ def test_clean_source_cache(self):
assert all(isdir(d) for d in itervalues(cache_dirs))
- run_command(Commands.CLEAN, '', "--source-cache --yes")
+ # --json flag is regression test for #5451
+ run_command(Commands.CLEAN, '', "--source-cache --yes --json")
assert not all(isdir(d) for d in itervalues(cache_dirs))
| conda clean --json error
`conda clean -t --json --dry-run
{
"error": "Traceback (most recent call last):\n File \"C:\\Anaconda27\\lib\\site-packages\\conda\\exceptions.py\", line 632, in conda_exception_handler\n return_value = func(*args, **kwargs)\n File \"C:\\Anaconda27\\lib\\site-packages\\conda\\cli\\main.py\", line 137, in _main\n exit_code = args.func(args, p)\n File \"C:\\Anaconda27\\lib\\site-packages\\conda\\cli\\main_clean.py\", line 306, in execute\n rm_tarballs(args, pkgs_dirs, totalsize, verbose=not context.json)\n File \"C:\\Anaconda27\\lib\\site-packages\\conda\\cli\\main_clean.py\", line 123, in rm_tarballs\n if not context.json or not context.yes:\nAttributeError: 'Context' object has no attribute 'yes'\n"
}
conda info --all
Current conda install:
platform : win-64
conda version : 4.3.21
conda is private : False
conda-env version : 4.3.21
conda-build version : 2.1.15
python version : 2.7.13.final.0
requests version : 2.12.4
root environment : C:\Anaconda27 (writable)
default environment : C:\Anaconda27
envs directories : C:\Anaconda27\envs
C:\Users\Oammous\AppData\Local\conda\conda\envs
C:\Users\Oammous\.conda\envs
package cache : C:\Anaconda27\pkgs
C:\Users\Oammous\AppData\Local\conda\conda\pkgs
channel URLs : http://conda/prod/win-64
http://conda/prod/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
config file : C:\Users\Oammous\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.21 requests/2.12.4 CPython/2.7.13 Windows/10 Windows/10.0.10586
administrator : False
# conda environments:
#
_test C:\Anaconda27\envs\_test
gulbis C:\Anaconda27\envs\gulbis
py3 C:\Anaconda27\envs\py3
root * C:\Anaconda27
sys.version: 2.7.13 |Anaconda custom (64-bit)| (defau...
sys.prefix: C:\Anaconda27
sys.executable: C:\Anaconda27\python.exe
conda location: C:\Anaconda27\lib\site-packages\conda
conda-build: C:\Anaconda27\Scripts\conda-build.exe
conda-convert: C:\Anaconda27\Scripts\conda-convert.exe
conda-develop: C:\Anaconda27\Scripts\conda-develop.exe
conda-env: C:\Anaconda27\Scripts\conda-env.exe
conda-index: C:\Anaconda27\Scripts\conda-index.exe
conda-inspect: C:\Anaconda27\Scripts\conda-inspect.exe
conda-metapackage: C:\Anaconda27\Scripts\conda-metapackage.exe
conda-render: C:\Anaconda27\Scripts\conda-render.exe
conda-server: C:\Anaconda27\Scripts\conda-server.exe
conda-sign: C:\Anaconda27\Scripts\conda-sign.exe
conda-skeleton: C:\Anaconda27\Scripts\conda-skeleton.exe
conda-verify: C:\Anaconda27\Scripts\conda-verify.exe
`
| 2017-05-30T16:03:00 |
|
conda/conda | 5,467 | conda__conda-5467 | [
"5466",
"5466"
] | 79e79bdbbf2e783eb6092e7e16493e4bfbc7a82e | diff --git a/conda/models/channel.py b/conda/models/channel.py
--- a/conda/models/channel.py
+++ b/conda/models/channel.py
@@ -16,10 +16,10 @@
try:
from cytoolz.functoolz import excepts
- from cytoolz.itertoolz import concatv, topk
+ from cytoolz.itertoolz import concatv, drop
except ImportError: # pragma: no cover
from .._vendor.toolz.functoolz import excepts # NOQA
- from .._vendor.toolz.itertoolz import concatv, topk # NOQA
+ from .._vendor.toolz.itertoolz import concatv, drop # NOQA
log = getLogger(__name__)
@@ -420,7 +420,13 @@ def _read_channel_configuration(scheme, host, port, path):
return location, name, _scheme, _auth, _token
# 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,
+ # but bump the first token of paths starting with /conda for compatibility with
+ # Anaconda Enterprise Repository software.
+ bump = None
+ path_parts = path.strip('/').split('/')
+ if path_parts and path_parts[0] == 'conda':
+ bump, path = 'conda', '/'.join(drop(1, path_parts))
+ return (Url(host=host, port=port, path=bump).url.rstrip('/'), path.strip('/') or None,
scheme or None, None, None)
| 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
@@ -20,7 +20,6 @@
from conda.utils import on_win
from logging import getLogger
from unittest import TestCase
-import conda.models.channel
try:
from unittest.mock import patch
@@ -248,6 +247,31 @@ def test_canonicalized_url_gets_correct_token(self):
"https://10.2.3.4:8080/conda/t/x1029384756/bioconda/noarch",
]
+ def test_token_in_custom_channel(self):
+ channel = Channel("https://10.2.8.9:8080/conda/t/tk-987-321/bioconda/label/dev")
+ assert channel.name == "bioconda/label/dev"
+ assert channel.location == "10.2.8.9:8080/conda"
+ assert channel.urls() == [
+ "https://10.2.8.9:8080/conda/bioconda/label/dev/%s" % self.platform,
+ "https://10.2.8.9:8080/conda/bioconda/label/dev/noarch",
+ ]
+ assert channel.urls(with_credentials=True) == [
+ "https://10.2.8.9:8080/conda/t/tk-987-321/bioconda/label/dev/%s" % self.platform,
+ "https://10.2.8.9:8080/conda/t/tk-987-321/bioconda/label/dev/noarch",
+ ]
+
+ channel = Channel("https://10.2.8.9:8080/conda/t/tk-987-321/bioconda")
+ assert channel.name == "bioconda"
+ assert channel.location == "10.2.8.9:8080/conda"
+ assert channel.urls() == [
+ "https://10.2.8.9:8080/conda/bioconda/%s" % self.platform,
+ "https://10.2.8.9:8080/conda/bioconda/noarch",
+ ]
+ assert channel.urls(with_credentials=True) == [
+ "https://10.2.8.9:8080/conda/t/tk-987-321/bioconda/%s" % self.platform,
+ "https://10.2.8.9:8080/conda/t/tk-987-321/bioconda/noarch",
+ ]
+
class CustomConfigChannelTests(TestCase):
"""
| scrambled URL of non-alias channel with token
The URL parsing would swap around locations of URL parts if passed a `/t/<TOKEN>` URL that was not the `channel_alias`.
scrambled URL of non-alias channel with token
The URL parsing would swap around locations of URL parts if passed a `/t/<TOKEN>` URL that was not the `channel_alias`.
| 2017-06-01T23:48:30 |
|
conda/conda | 5,471 | conda__conda-5471 | [
"5470",
"5470"
] | 79e79bdbbf2e783eb6092e7e16493e4bfbc7a82e | diff --git a/conda/cli/python_api.py b/conda/cli/python_api.py
--- a/conda/cli/python_api.py
+++ b/conda/cli/python_api.py
@@ -8,7 +8,7 @@
from ..base.constants import APP_NAME, SEARCH_PATH
from ..base.context import context
from ..cli.main import generate_parser
-from ..common.io import captured, replace_log_streams, argv
+from ..common.io import captured, replace_log_streams, argv, CaptureTarget
from ..common.path import win_path_double_escape
from ..exceptions import conda_exception_handler
from ..gateways.logging import initialize_std_loggers
@@ -28,6 +28,10 @@ class Commands:
UPDATE = "update"
+STRING = CaptureTarget.STRING
+STDOUT = CaptureTarget.STDOUT
+
+
def get_configure_parser_function(command):
module = 'conda.cli.main_' + command
return import_module(module).configure_parser
@@ -49,8 +53,16 @@ def run_command(command, *arguments, **kwargs):
has occured, and instead give a non-zero return code
search_path: an optional non-standard search path for configuration information
that overrides the default SEARCH_PATH
+ stdout: Define capture behavior for stream sys.stdout. Defaults to STRING.
+ STRING captures as a string. None leaves stream untouched.
+ Otherwise redirect to file-like object stdout.
+ stderr: Define capture behavior for stream sys.stderr. Defaults to STRING.
+ STRING captures as a string. None leaves stream untouched.
+ STDOUT redirects to stdout target and returns None as stderr value.
+ Otherwise redirect to file-like object stderr.
- Returns: a tuple of stdout, stderr, and return_code
+ Returns: a tuple of stdout, stderr, and return_code.
+ stdout, stderr are either strings, None or the corresponding file-like function argument.
Examples:
>> run_command(Commands.CREATE, "-n newenv python=3 flask", use_exception_handler=True)
@@ -62,6 +74,8 @@ def run_command(command, *arguments, **kwargs):
initialize_std_loggers()
use_exception_handler = kwargs.get('use_exception_handler', False)
configuration_search_path = kwargs.get('search_path', SEARCH_PATH)
+ stdout = kwargs.get('stdout', STRING)
+ stderr = kwargs.get('stderr', STRING)
p, sub_parsers = generate_parser()
get_configure_parser_function(command)(sub_parsers)
@@ -78,7 +92,8 @@ def run_command(command, *arguments, **kwargs):
)
log.debug("executing command >>> conda %s", command_line)
try:
- with argv(['python_api'] + split_command_line), captured() as c, replace_log_streams():
+ python_api_command_line = ['python_api'] + split_command_line
+ with argv(python_api_command_line), captured(stdout, stderr) as c, replace_log_streams():
if use_exception_handler:
return_code = conda_exception_handler(args.func, args, p)
else:
diff --git a/conda/common/io.py b/conda/common/io.py
--- a/conda/common/io.py
+++ b/conda/common/io.py
@@ -2,6 +2,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from contextlib import contextmanager
+from enum import Enum
import logging
from logging import CRITICAL, Formatter, NOTSET, StreamHandler, WARN, getLogger
import os
@@ -17,6 +18,15 @@
_FORMATTER = Formatter("%(levelname)s %(name)s:%(funcName)s(%(lineno)d): %(message)s")
+class CaptureTarget(Enum):
+ """Constants used for contextmanager captured.
+
+ Used similarily like the constants PIPE, STDOUT for stdlib's subprocess.Popen.
+ """
+ STRING = -1
+ STDOUT = -2
+
+
@contextmanager
def env_var(name, value, callback=None):
# NOTE: will likely want to call reset_context() when using this function, so pass
@@ -69,20 +79,58 @@ def cwd(directory):
@contextmanager
-def captured():
+def captured(stdout=CaptureTarget.STRING, stderr=CaptureTarget.STRING):
+ """Capture outputs of sys.stdout and sys.stderr.
+
+ If stdout is STRING, capture sys.stdout as a string,
+ if stdout is None, do not capture sys.stdout, leaving it untouched,
+ otherwise redirect sys.stdout to the file-like object given by stdout.
+
+ Behave correspondingly for stderr with the exception that if stderr is STDOUT,
+ redirect sys.stderr to stdout target and set stderr attribute of yielded object to None.
+
+ Args:
+ stdout: capture target for sys.stdout, one of STRING, None, or file-like object
+ stderr: capture target for sys.stderr, one of STRING, STDOUT, None, or file-like object
+
+ Yields:
+ CapturedText: has attributes stdout, stderr which are either strings, None or the
+ corresponding file-like function argument.
+ """
# NOTE: This function is not thread-safe. Using within multi-threading may cause spurious
# behavior of not returning sys.stdout and sys.stderr back to their 'proper' state
class CapturedText(object):
pass
saved_stdout, saved_stderr = sys.stdout, sys.stderr
- sys.stdout = outfile = StringIO()
- sys.stderr = errfile = StringIO()
+ if stdout == CaptureTarget.STRING:
+ sys.stdout = outfile = StringIO()
+ else:
+ outfile = stdout
+ if outfile is not None:
+ sys.stdout = outfile
+ if stderr == CaptureTarget.STRING:
+ sys.stderr = errfile = StringIO()
+ elif stderr == CaptureTarget.STDOUT:
+ sys.stderr = errfile = outfile
+ else:
+ errfile = stderr
+ if errfile is not None:
+ sys.stderr = errfile
c = CapturedText()
log.info("overtaking stderr and stdout")
try:
yield c
finally:
- c.stdout, c.stderr = outfile.getvalue(), errfile.getvalue()
+ if stdout == CaptureTarget.STRING:
+ c.stdout = outfile.getvalue()
+ else:
+ c.stdout = outfile
+ if stderr == CaptureTarget.STRING:
+ c.stderr = errfile.getvalue()
+ elif stderr == CaptureTarget.STDOUT:
+ c.stderr = None
+ else:
+ c.stderr = errfile
sys.stdout, sys.stderr = saved_stdout, saved_stderr
log.info("stderr and stdout yielding back")
| diff --git a/tests/common/test_io.py b/tests/common/test_io.py
--- a/tests/common/test_io.py
+++ b/tests/common/test_io.py
@@ -1,8 +1,48 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
-from conda.common.io import attach_stderr_handler, captured
+from conda.common.io import attach_stderr_handler, captured, CaptureTarget
+from io import StringIO
from logging import DEBUG, NOTSET, WARN, getLogger
+import sys
+
+
+def test_captured():
+ stdout_text = "stdout text"
+ stderr_text = "stderr text"
+
+ def print_captured(*args, **kwargs):
+ with captured(*args, **kwargs) as c:
+ print(stdout_text, end="")
+ print(stderr_text, end="", file=sys.stderr)
+ return c
+
+ c = print_captured()
+ assert c.stdout == stdout_text
+ assert c.stderr == stderr_text
+
+ c = print_captured(CaptureTarget.STRING, CaptureTarget.STRING)
+ assert c.stdout == stdout_text
+ assert c.stderr == stderr_text
+
+ c = print_captured(stderr=CaptureTarget.STDOUT)
+ assert c.stdout == stdout_text + stderr_text
+ assert c.stderr is None
+
+ caller_stdout = StringIO()
+ caller_stderr = StringIO()
+ c = print_captured(caller_stdout, caller_stderr)
+ assert c.stdout is caller_stdout
+ assert c.stderr is caller_stderr
+ assert caller_stdout.getvalue() == stdout_text
+ assert caller_stderr.getvalue() == stderr_text
+
+ with captured() as outer_c:
+ inner_c = print_captured(None, None)
+ assert inner_c.stdout is None
+ assert inner_c.stderr is None
+ assert outer_c.stdout == stdout_text
+ assert outer_c.stderr == stderr_text
def test_attach_stderr_handler():
| make stdout/stderr capture in python_api customizable
Let the user customize how and if the standard output/error streams should be captured.
make stdout/stderr capture in python_api customizable
Let the user customize how and if the standard output/error streams should be captured.
| 2017-06-02T00:04:22 |
|
conda/conda | 5,473 | conda__conda-5473 | [
"5400",
"5400"
] | 918933dc6e0e1bfa726ca814d32de46be67dc856 | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -82,8 +82,8 @@ def print_activate(arg):
# To activate this environment, use:
# > activate %s
#
- # To deactivate this environment, use:
- # > deactivate %s
+ # To deactivate an active environment, use:
+ # > deactivate
#
# * for power-users using bash, you must source
#
@@ -96,8 +96,8 @@ def print_activate(arg):
# To activate this environment, use:
# > conda activate %s
#
- # To deactivate this environment, use:
- # > conda deactivate %s
+ # To deactivate an active environment, use:
+ # > conda deactivate
#
""")
else:
@@ -106,12 +106,12 @@ def print_activate(arg):
# To activate this environment, use:
# > source activate %s
#
- # To deactivate this environment, use:
- # > source deactivate %s
+ # To deactivate an active environment, use:
+ # > source deactivate
#
""")
- return message % (arg, arg)
+ return message % arg
def get_revision(arg, json=False):
| Environment Deactivation - Misleading Message?
When I try to create an environment, I get the following message:
```bash
(root) [xyz@unknown ~]$ conda create -yn anacondacon
Fetching package metadata .........
Solving package specifications:
Package plan for installation in environment /conda/envs/anacondacon:
#
# To activate this environment, use:
# > source activate anacondacon
#
# To deactivate this environment, use:
# > source deactivate anacondacon
#
```
The command displayed to deactivate the environment suggests that the name of the environment is an argument to deactivate. But, is it really? I only have to do `source deactivate`, right?
Environment Deactivation - Misleading Message?
When I try to create an environment, I get the following message:
```bash
(root) [xyz@unknown ~]$ conda create -yn anacondacon
Fetching package metadata .........
Solving package specifications:
Package plan for installation in environment /conda/envs/anacondacon:
#
# To activate this environment, use:
# > source activate anacondacon
#
# To deactivate this environment, use:
# > source deactivate anacondacon
#
```
The command displayed to deactivate the environment suggests that the name of the environment is an argument to deactivate. But, is it really? I only have to do `source deactivate`, right?
| 2017-06-02T03:02:21 |
||
conda/conda | 5,475 | conda__conda-5475 | [
"5444"
] | e072cba5e890c24e4557dee2bc6499f8f53162ba | diff --git a/conda_env/cli/main_create.py b/conda_env/cli/main_create.py
--- a/conda_env/cli/main_create.py
+++ b/conda_env/cli/main_create.py
@@ -5,11 +5,11 @@
import sys
import textwrap
+from conda._vendor.auxlib.path import expand
from conda.cli import install as cli_install
from conda.cli.conda_argparse import add_parser_json, add_parser_prefix
from conda.gateways.disk.delete import rm_rf
from conda.misc import touch_nonadmin
-
from .common import get_prefix
from .. import exceptions, specs
from ..installers.base import InvalidInstaller, get_installer
@@ -75,7 +75,7 @@ def execute(args, parser):
name = args.remote_definition or args.name
try:
- spec = specs.detect(name=name, filename=args.file,
+ spec = specs.detect(name=name, filename=expand(args.file),
directory=os.getcwd())
env = spec.environment
diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py
--- a/conda_env/cli/main_update.py
+++ b/conda_env/cli/main_update.py
@@ -3,6 +3,7 @@
import sys
import textwrap
+from conda._vendor.auxlib.path import expand
from conda.cli import install as cli_install
from conda.cli.conda_argparse import add_parser_json, add_parser_prefix
from conda.misc import touch_nonadmin
@@ -66,7 +67,7 @@ def execute(args, parser):
name = args.remote_definition or args.name
try:
- spec = install_specs.detect(name=name, filename=args.file,
+ spec = install_specs.detect(name=name, filename=expand(args.file),
directory=os.getcwd())
env = spec.environment
except exceptions.SpecNotFound:
| Not able to install Udacity car Simulator
(C:\Users\Heeramani\Anaconda2) C:\Users\Heeramani>conda env create -f environments.yml
Using Anaconda API: https://api.anaconda.org
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.3.14
conda is private : False
conda-env version : 4.3.14
conda-build version : not installed
python version : 2.7.13.final.0
requests version : 2.12.4
root environment : C:\Users\Heeramani\Anaconda2 (writable)
default environment : C:\Users\Heeramani\Anaconda2
envs directories : C:\Users\Heeramani\Anaconda2\envs
C:\Users\Heeramani\AppData\Local\conda\conda\envs
C:\Users\Heeramani\.conda\envs
package cache : C:\Users\Heeramani\Anaconda2\pkgs
C:\Users\Heeramani\AppData\Local\conda\conda\pkgs
channel URLs : https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
user-agent : conda/4.3.14 requests/2.12.4 CPython/2.7.13 Windows/10 Windows/10.0.14393
`$ C:\Users\Heeramani\Anaconda2\Scripts\conda-env-script.py create -f environments.yml`
Traceback (most recent call last):
File "C:\Users\Heeramani\Anaconda2\lib\site-packages\conda\exceptions.py", line 573, in conda_exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\Heeramani\Anaconda2\lib\site-packages\conda_env\cli\main_create.py", line 78, in execute
directory=os.getcwd())
File "C:\Users\Heeramani\Anaconda2\lib\site-packages\conda_env\specs\__init__.py", line 23, in detect
raise SpecNotFound(build_message(specs))
SpecNotFound: Runtime error: Can't process without a name
Conda Env Exception: environments.yml file not found
There is no requirements.txt
| 2017-06-02T06:32:46 |
||
conda/conda | 5,477 | conda__conda-5477 | [
"5302",
"5302"
] | 28f8b9d89b3679bf271754039d6bf93cc8e19a68 | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -8,7 +8,7 @@
from difflib import get_close_matches
import errno
-import logging
+from logging import getLogger
import os
from os.path import abspath, basename, exists, isdir, join
import re
@@ -29,7 +29,8 @@
from ..plan import (display_actions, execute_actions, get_pinned_specs, install_actions_list,
is_root_prefix, nothing_to_do, revert_actions)
-log = logging.getLogger(__name__)
+log = getLogger(__name__)
+stderr = getLogger('stderr')
def check_prefix(prefix, json=False):
@@ -47,6 +48,11 @@ def check_prefix(prefix, json=False):
if error:
raise CondaValueError(error, json)
+ if ' ' in prefix:
+ stderr.warn("WARNING: A space was detected in your requested environment path\n"
+ "'%s'\n"
+ "Spaces in paths can sometimes be problematic." % prefix)
+
def clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None):
if os.sep in src_arg:
| Add a warning when creating environments with spaces
From https://github.com/ContinuumIO/navigator/issues/1000.
```
(root) 0316-gpena-castellanos:navigator gpena-castellanos$ conda install -n "test space" qtconsole
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /Users/gpena-castellanos/anaconda/envs/test space:
The following NEW packages will be INSTALLED:
appnope: 0.1.0-py36_0
decorator: 4.0.11-py36_0
icu: 54.1-0
ipykernel: 4.5.2-py36_0
ipython: 5.3.0-py36_0
ipython_genutils: 0.1.0-py36_0
jupyter_client: 5.0.0-py36_0
jupyter_core: 4.3.0-py36_0
path.py: 10.1-py36_0
pexpect: 4.2.1-py36_0
pickleshare: 0.7.4-py36_0
prompt_toolkit: 1.0.13-py36_0
ptyprocess: 0.5.1-py36_0
pygments: 2.2.0-py36_0
pyqt: 5.6.0-py36_2
python-dateutil: 2.6.0-py36_0
pyzmq: 16.0.2-py36_0
qt: 5.6.2-0
qtconsole: 4.2.1-py36_1
simplegeneric: 0.8.1-py36_1
sip: 4.18-py36_0
six: 1.10.0-py36_0
tornado: 4.4.2-py36_0
traitlets: 4.3.2-py36_0
wcwidth: 0.1.7-py36_0
Proceed ([y]/n)? y
ERROR conda.core.link:_execute_actions(335): An error occurred while installing package 'defaults::qt-5.6.2-0'.
LinkError: post-link script failed for package defaults::qt-5.6.2-0
running your command again with `-v` will provide additional information
location of failed script: /Users/gpena-castellanos/anaconda/envs/test space/bin/.qt-post-link.sh
==> script messages <==
<None>
Attempting to roll back.
LinkError: post-link script failed for package defaults::qt-5.6.2-0
running your command again with `-v` will provide additional information
location of failed script: /Users/gpena-castellanos/anaconda/envs/test space/bin/.qt-post-link.sh
==> script messages <==
<None>
```
A warning with something like this to point the cause of the problem for the user to fix:
"Warning: Conda environments with spaces are not supported"
Add a warning when creating environments with spaces
From https://github.com/ContinuumIO/navigator/issues/1000.
```
(root) 0316-gpena-castellanos:navigator gpena-castellanos$ conda install -n "test space" qtconsole
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /Users/gpena-castellanos/anaconda/envs/test space:
The following NEW packages will be INSTALLED:
appnope: 0.1.0-py36_0
decorator: 4.0.11-py36_0
icu: 54.1-0
ipykernel: 4.5.2-py36_0
ipython: 5.3.0-py36_0
ipython_genutils: 0.1.0-py36_0
jupyter_client: 5.0.0-py36_0
jupyter_core: 4.3.0-py36_0
path.py: 10.1-py36_0
pexpect: 4.2.1-py36_0
pickleshare: 0.7.4-py36_0
prompt_toolkit: 1.0.13-py36_0
ptyprocess: 0.5.1-py36_0
pygments: 2.2.0-py36_0
pyqt: 5.6.0-py36_2
python-dateutil: 2.6.0-py36_0
pyzmq: 16.0.2-py36_0
qt: 5.6.2-0
qtconsole: 4.2.1-py36_1
simplegeneric: 0.8.1-py36_1
sip: 4.18-py36_0
six: 1.10.0-py36_0
tornado: 4.4.2-py36_0
traitlets: 4.3.2-py36_0
wcwidth: 0.1.7-py36_0
Proceed ([y]/n)? y
ERROR conda.core.link:_execute_actions(335): An error occurred while installing package 'defaults::qt-5.6.2-0'.
LinkError: post-link script failed for package defaults::qt-5.6.2-0
running your command again with `-v` will provide additional information
location of failed script: /Users/gpena-castellanos/anaconda/envs/test space/bin/.qt-post-link.sh
==> script messages <==
<None>
Attempting to roll back.
LinkError: post-link script failed for package defaults::qt-5.6.2-0
running your command again with `-v` will provide additional information
location of failed script: /Users/gpena-castellanos/anaconda/envs/test space/bin/.qt-post-link.sh
==> script messages <==
<None>
```
A warning with something like this to point the cause of the problem for the user to fix:
"Warning: Conda environments with spaces are not supported"
| Shouldn't the package's post link script quote the `$PREFIX` variable properly, instead of assuming that the environment path will not have a space in it?
Yes it should and I will fix that today but we should also warn since a large amount of critical software (e.g. GNU make) cannot handle spaces very well.
Shouldn't the package's post link script quote the `$PREFIX` variable properly, instead of assuming that the environment path will not have a space in it?
Yes it should and I will fix that today but we should also warn since a large amount of critical software (e.g. GNU make) cannot handle spaces very well. | 2017-06-02T07:33:24 |
|
conda/conda | 5,496 | conda__conda-5496 | [
"5483"
] | d85347ba5d0dcaf58073d0ddd66687e04f482d8d | diff --git a/conda/_vendor/auxlib/path.py b/conda/_vendor/auxlib/path.py
--- a/conda/_vendor/auxlib/path.py
+++ b/conda/_vendor/auxlib/path.py
@@ -6,7 +6,7 @@
from os.path import abspath, dirname, exists, expanduser, expandvars, isdir, isfile, join, sep
try:
import pkg_resources
-except ImportError:
+except Exception:
pkg_resources = None
import sys
| An unexpected error has occurred.
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.3.21
conda is private : False
conda-env version : 4.3.21
conda-build version : not installed
python version : 3.6.1.final.0
requests version : 2.14.2
root environment : C:\ProgramData\Anaconda3 (read only)
default environment : C:\ProgramData\Anaconda3
envs directories : C:\Users\eric\AppData\Local\conda\conda\envs
C:\ProgramData\Anaconda3\envs
C:\Users\eric\.conda\envs
package cache : C:\ProgramData\Anaconda3\pkgs
C:\Users\eric\AppData\Local\conda\conda\pkgs
channel URLs : https://conda.anaconda.org/anaconda-fusion/win-64
https://conda.anaconda.org/anaconda-fusion/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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\eric\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.21 requests/2.14.2 CPython/3.6.1 Windows/10 Windows/10.0.10240
administrator : False
`$ C:\ProgramData\Anaconda3\Scripts\conda-script.py ..checkenv cmd.exe C:\ProgramData\Anaconda3`
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 167, in main
import conda.cli.activate as activate
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\activate.py", line 12, in <module>
from ..utils import shells
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\utils.py", line 13, in <module>
from .gateways.disk.read import compute_md5sum
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 22, in <module>
from ...models.channel import Channel
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\channel.py", line 9, in <module>
from ..base.context import context
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\base\context.py", line 18, in <module>
from .._vendor.auxlib.path import expand
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\_vendor\auxlib\path.py", line 8, in <module>
import pkg_resources
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2985, in <module>
@_call_aside
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2971, in _call_aside
f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 3013, in _initialize_master_working_set
dist.activate(replace=False)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2544, in activate
declare_namespace(pkg)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2118, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2058, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2087, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
C:\Users\eric>
| I ran into similar problem just now. Updating your conda may help.
This is the error I get when I try to update my conda. Has anyone figured out how to fix this? | 2017-06-06T12:49:06 |
|
conda/conda | 5,526 | conda__conda-5526 | [
"5525"
] | cb134f324394dcfc1fed116f4ea1b0c578670d9a | diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -355,6 +355,10 @@ def __init__(self, message, url, status_code, reason, elapsed_time, response=Non
_message += "CF-RAY: %s\n\n" % cf_ray if cf_ray else "\n"
message = _message + message
+ status_code = status_code or '000'
+ reason = reason or 'CONNECTION FAILED'
+ elapsed_time = elapsed_time or '-'
+
from ._vendor.auxlib.logz import stringify
response_details = (stringify(response) or '') if response else ''
| Fix all the `None`s in CondaHTTPError
```
CondaHTTPError: HTTP None None for url https://repo.continuum.io/pkgs/free/win-64/repodata.json.bz2
Elapsed: None
```
| 2017-06-14T18:03:37 |
||
conda/conda | 5,532 | conda__conda-5532 | [
"5515",
"5515"
] | e0718e46b326233c450390d5a9096df071186a3b | diff --git a/conda/__init__.py b/conda/__init__.py
--- a/conda/__init__.py
+++ b/conda/__init__.py
@@ -88,6 +88,9 @@ def dump_map(self):
error="Multiple Errors Encountered.",
)
+ def contains(self, exception_class):
+ return any(isinstance(e, exception_class) for e in self.errors)
+
class CondaExitZero(CondaError):
pass
| CondaMultiError precludes catching more specific exceptions
In trying to narrow Conda-build's exception scope, I find that I cannot directly catch the PaddingError here:
```
===================================================== FAILURES =====================================================
______________________________ test_env_creation_with_short_prefix_does_not_deadlock _______________________________
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/path_actions.py", line 299, in execute
self.file_mode)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 57, in update_prefix
update_file_in_place_as_binary(realpath(path), _update_prefix)
File "/Users/msarahan/code/conda/conda/gateways/disk/update.py", line 33, in update_file_in_place_as_binary
fh.write(callback(data))
File "/Users/msarahan/code/conda/conda/core/portability.py", line 39, in _update_prefix
data = replace_prefix(mode, original_data, placeholder, new_prefix)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 64, in replace_prefix
data = binary_replace(data, placeholder.encode('utf-8'), new_prefix.encode('utf-8'))
File "/Users/msarahan/code/conda/conda/core/portability.py", line 93, in binary_replace
data = pat.sub(replace, data)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 88, in replace
raise _PaddingError
conda.core.portability._PaddingError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/link.py", line 326, in _execute_actions
action.execute()
File "/Users/msarahan/code/conda/conda/core/path_actions.py", line 302, in execute
len(self.prefix_placeholder))
conda.exceptions.PaddingError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/link.py", line 281, in execute
pkg_data, actions)
File "/Users/msarahan/code/conda/conda/core/link.py", line 344, in _execute_actions
reverse_excs,
conda.CondaMultiError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda-build/tests/test_environ.py", line 34, in test_env_creation_with_short_prefix_does_not_deadlock
env='build', config=config, subdir=subdir)
File "/Users/msarahan/code/conda-build/conda_build/environ.py", line 788, in create_env
execute_actions(actions, index, verbose=config.debug)
File "/Users/msarahan/code/conda/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/Users/msarahan/code/conda/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/Users/msarahan/code/conda/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "/Users/msarahan/code/conda/conda/core/link.py", line 297, in execute
rollback_excs,
conda.CondaMultiError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
```
Do you have any advice for how to pull apart a CondaMultiError to look for the specific error types that we want to look for?
CondaMultiError precludes catching more specific exceptions
In trying to narrow Conda-build's exception scope, I find that I cannot directly catch the PaddingError here:
```
===================================================== FAILURES =====================================================
______________________________ test_env_creation_with_short_prefix_does_not_deadlock _______________________________
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/path_actions.py", line 299, in execute
self.file_mode)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 57, in update_prefix
update_file_in_place_as_binary(realpath(path), _update_prefix)
File "/Users/msarahan/code/conda/conda/gateways/disk/update.py", line 33, in update_file_in_place_as_binary
fh.write(callback(data))
File "/Users/msarahan/code/conda/conda/core/portability.py", line 39, in _update_prefix
data = replace_prefix(mode, original_data, placeholder, new_prefix)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 64, in replace_prefix
data = binary_replace(data, placeholder.encode('utf-8'), new_prefix.encode('utf-8'))
File "/Users/msarahan/code/conda/conda/core/portability.py", line 93, in binary_replace
data = pat.sub(replace, data)
File "/Users/msarahan/code/conda/conda/core/portability.py", line 88, in replace
raise _PaddingError
conda.core.portability._PaddingError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/link.py", line 326, in _execute_actions
action.execute()
File "/Users/msarahan/code/conda/conda/core/path_actions.py", line 302, in execute
len(self.prefix_placeholder))
conda.exceptions.PaddingError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda/conda/core/link.py", line 281, in execute
pkg_data, actions)
File "/Users/msarahan/code/conda/conda/core/link.py", line 344, in _execute_actions
reverse_excs,
conda.CondaMultiError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/msarahan/code/conda-build/tests/test_environ.py", line 34, in test_env_creation_with_short_prefix_does_not_deadlock
env='build', config=config, subdir=subdir)
File "/Users/msarahan/code/conda-build/conda_build/environ.py", line 788, in create_env
execute_actions(actions, index, verbose=config.debug)
File "/Users/msarahan/code/conda/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/Users/msarahan/code/conda/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/Users/msarahan/code/conda/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "/Users/msarahan/code/conda/conda/core/link.py", line 297, in execute
rollback_excs,
conda.CondaMultiError: Placeholder of length '80' too short in package /tmp/cb/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/binary-has-prefix.
The package must be rebuilt with conda-build > 2.0.
```
Do you have any advice for how to pull apart a CondaMultiError to look for the specific error types that we want to look for?
| I can add a `contains` method on `CondaMultiError`. In the interim, you could do the same for code locally until we get a few releases out with the addition. Here's what it would look like
```python
def contains(self, exception_class):
return any(isinstance(e, exception_class) for e in self.errors)
```
I can add a `contains` method on `CondaMultiError`. In the interim, you could do the same for code locally until we get a few releases out with the addition. Here's what it would look like
```python
def contains(self, exception_class):
return any(isinstance(e, exception_class) for e in self.errors)
```
| 2017-06-15T07:38:37 |
|
conda/conda | 5,549 | conda__conda-5549 | [
"5523"
] | 672c772c233b8f1639d869fb01f4fb1583090304 | diff --git a/conda/misc.py b/conda/misc.py
--- a/conda/misc.py
+++ b/conda/misc.py
@@ -198,7 +198,7 @@ def append_env(prefix):
os.mkdir(dir_path)
with open(join(dir_path, 'environments.txt'), 'a') as f:
f.write('%s\n' % prefix)
- except IOError:
+ except (IOError, OSError):
pass
| conda fails if a user's home directory doesn't exist
In certain applications that we support, it is possible that a user does not have a home directory within which to create `~/.conda`. This is causing a fatal error in the `append_env` method [here](https://github.com/conda/conda/blob/master/conda/misc.py#L185-L193).
Note that this function is already designed to fail silently if there is an `IOError`. However, if the home directory itself does not exist, the `os.mkdir` command fails with an `OSError` instead. I would suggest that this exception type be included in the `except` line as well.
| 2017-06-19T02:03:45 |
||
conda/conda | 5,703 | conda__conda-5703 | [
"5649",
"5649"
] | 7cab18070a6397cbf2218144edd7fa64c17a5964 | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -163,14 +163,13 @@ def install(args, parser, command='install'):
raise PackageNotInstalledError(prefix, name)
if newenv and not args.no_default_packages:
- default_packages = list(context.create_default_packages)
# Override defaults if they are specified at the command line
+ # TODO: rework in 4.4 branch using MatchSpec
+ args_packages_names = [pkg.replace(' ', '=').split('=', 1)[0] for pkg in args_packages]
for default_pkg in context.create_default_packages:
- 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 = []
+ default_pkg_name = default_pkg.replace(' ', '=').split('=', 1)[0]
+ if default_pkg_name not in args_packages_names:
+ args_packages.append(default_pkg)
common.ensure_use_local(args)
common.ensure_override_channels_requires_channel(args)
@@ -212,9 +211,8 @@ def install(args, parser, command='install'):
" filenames")
if newenv and args.clone:
- package_diff = set(args_packages) - set(default_packages)
- if package_diff:
- raise TooManyArgumentsError(0, len(package_diff), list(package_diff),
+ if args.packages:
+ raise TooManyArgumentsError(0, len(args.packages), list(args.packages),
'did not expect any arguments for --clone')
clone(args.clone, prefix, json=context.json, quiet=context.quiet, index_args=index_args)
| diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -191,7 +191,7 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
def test_activate_deactivate(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 7, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 8, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
@@ -208,7 +208,7 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
def test_activate_root_simple(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 7, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 8, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -674,7 +674,7 @@ def test_update_deps_flag_absent(self):
assert package_is_installed(prefix, 'itsdangerous-0.23')
assert package_is_installed(prefix, 'flask')
- @pytest.mark.xfail(datetime.now() < datetime(2017, 7, 1), reason="#5263", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 8, 1), reason="#5263", strict=True)
def test_update_deps_flag_present(self):
with make_temp_env("python=2 itsdangerous=0.23") as prefix:
assert package_is_installed(prefix, 'python-2')
@@ -794,12 +794,11 @@ def test_create_default_packages(self):
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 yml_obj['create_default_packages'] == ['flask', 'pip']
assert not package_is_installed(prefix, 'python-2')
assert not package_is_installed(prefix, 'pytz')
@@ -818,12 +817,11 @@ def test_create_default_packages_no_default_packages(self):
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 yml_obj['create_default_packages'] == ['flask', 'pip']
assert not package_is_installed(prefix, 'python-2')
assert not package_is_installed(prefix, 'pytz')
diff --git a/tests/test_export.py b/tests/test_export.py
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -31,7 +31,7 @@ def test_basic(self):
output2, error= run_command(Commands.LIST, prefix2, "-e")
self.assertEqual(output, output2)
- @pytest.mark.xfail(datetime.now() < datetime(2017, 7, 1), reason="Bring back `conda list --export` #3445", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 8, 1), reason="Bring back `conda list --export` #3445", strict=True)
def test_multi_channel_export(self):
"""
When try to import from txt
| Conda 4.3 not installing default packages
I have the following `.condarc`:
```
channels:
- conda-forge
- defaults
create_default_packages:
- ipython
```
When creating a new environment with `conda 4.3.22` the `ipython` package is not included:
```
$ conda create -n testenv python=3
Fetching package metadata .............
Solving package specifications: .
Package plan for installation in environment /home/ubuntu/miniconda/envs/OCemptor5:
The following NEW packages will be INSTALLED:
ca-certificates: 2017.4.17-0 conda-forge
certifi: 2017.4.17-py36_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2k-0 conda-forge
pip: 9.0.1-py36_0 conda-forge
python: 3.6.1-3 conda-forge
readline: 6.2-0 conda-forge
setuptools: 33.1.1-py36_0 conda-forge
sqlite: 3.13.0-1 conda-forge
tk: 8.5.19-1 conda-forge
wheel: 0.29.0-py36_0 conda-forge
xz: 5.2.2-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)?
```
And when using latest 4.2.13 version the default packages are included:
```
$ conda create -n testenv python=3
Fetching package metadata ...........
Solving package specifications: ..........
Package plan for installation in environment /home/ubuntu/miniconda/envs/OCemptor5:
The following NEW packages will be INSTALLED:
ca-certificates: 2017.4.17-0 conda-forge
certifi: 2017.4.17-py36_0 conda-forge
decorator: 4.0.11-py36_0 conda-forge
ipython: 6.1.0-py36_0 conda-forge
ipython_genutils: 0.2.0-py36_0 conda-forge
jedi: 0.10.0-py36_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2k-0 conda-forge
pexpect: 4.2.1-py36_0 conda-forge
pickleshare: 0.7.3-py36_0 conda-forge
pip: 9.0.1-py36_0 conda-forge
prompt_toolkit: 1.0.14-py36_0 conda-forge
ptyprocess: 0.5.2-py36_0 conda-forge
pygments: 2.2.0-py36_0 conda-forge
python: 3.6.1-3 conda-forge
readline: 6.2-0 conda-forge
setuptools: 33.1.1-py36_0 conda-forge
simplegeneric: 0.8.1-py36_0 conda-forge
six: 1.10.0-py36_1 conda-forge
sqlite: 3.13.0-1 conda-forge
tk: 8.5.19-1 conda-forge
traitlets: 4.3.2-py36_0 conda-forge
wcwidth: 0.1.7-py36_0 conda-forge
wheel: 0.29.0-py36_0 conda-forge
xz: 5.2.2-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)?
```
Conda 4.3 not installing default packages
I have the following `.condarc`:
```
channels:
- conda-forge
- defaults
create_default_packages:
- ipython
```
When creating a new environment with `conda 4.3.22` the `ipython` package is not included:
```
$ conda create -n testenv python=3
Fetching package metadata .............
Solving package specifications: .
Package plan for installation in environment /home/ubuntu/miniconda/envs/OCemptor5:
The following NEW packages will be INSTALLED:
ca-certificates: 2017.4.17-0 conda-forge
certifi: 2017.4.17-py36_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2k-0 conda-forge
pip: 9.0.1-py36_0 conda-forge
python: 3.6.1-3 conda-forge
readline: 6.2-0 conda-forge
setuptools: 33.1.1-py36_0 conda-forge
sqlite: 3.13.0-1 conda-forge
tk: 8.5.19-1 conda-forge
wheel: 0.29.0-py36_0 conda-forge
xz: 5.2.2-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)?
```
And when using latest 4.2.13 version the default packages are included:
```
$ conda create -n testenv python=3
Fetching package metadata ...........
Solving package specifications: ..........
Package plan for installation in environment /home/ubuntu/miniconda/envs/OCemptor5:
The following NEW packages will be INSTALLED:
ca-certificates: 2017.4.17-0 conda-forge
certifi: 2017.4.17-py36_0 conda-forge
decorator: 4.0.11-py36_0 conda-forge
ipython: 6.1.0-py36_0 conda-forge
ipython_genutils: 0.2.0-py36_0 conda-forge
jedi: 0.10.0-py36_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2k-0 conda-forge
pexpect: 4.2.1-py36_0 conda-forge
pickleshare: 0.7.3-py36_0 conda-forge
pip: 9.0.1-py36_0 conda-forge
prompt_toolkit: 1.0.14-py36_0 conda-forge
ptyprocess: 0.5.2-py36_0 conda-forge
pygments: 2.2.0-py36_0 conda-forge
python: 3.6.1-3 conda-forge
readline: 6.2-0 conda-forge
setuptools: 33.1.1-py36_0 conda-forge
simplegeneric: 0.8.1-py36_0 conda-forge
six: 1.10.0-py36_1 conda-forge
sqlite: 3.13.0-1 conda-forge
tk: 8.5.19-1 conda-forge
traitlets: 4.3.2-py36_0 conda-forge
wcwidth: 0.1.7-py36_0 conda-forge
wheel: 0.29.0-py36_0 conda-forge
xz: 5.2.2-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)?
```
| Conda always prioritizes conda-forge over the default channel by design.
You can either temporarily remove conda-forge from your .condarc or add `-c defaults` in your command.
@tyler-thetyrant By default packages I mean the ones specified in the config `create_default_packages`.
When using conda 4.3 it doesn't honor the `create_default_packages` config.
@kalefranz I see this one too in the testing installer for the next AEN version. Can you take a look on this?
conda_info
```
(/projects/testuser11/test_public/envs/default) conda info
Current conda install:
platform : linux-64
conda version : 4.3.22
conda is private : False
conda-env version : 4.3.22
conda-build version : 3.0.6
python version : 2.7.13.final.0
requests version : 2.14.2
root environment : /opt/wakari/anaconda (read only)
default environment : /projects/testuser11/test_public/envs/default
envs directories : /projects/testuser11/test_public/envs
/projects/testuser11/test_public/DEFAULTS
/home/testuser11/.conda/envs
/opt/wakari/anaconda/envs
package cache : /opt/wakari/anaconda/pkgs
/home/testuser11/.conda/pkgs
channel URLs : https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/wakari/linux-64
https://conda.anaconda.org/wakari/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 : /opt/wakari/anaconda/.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.22 requests/2.14.2 CPython/2.7.13 Linux/2.6.32-696.3.1.el6.x86_64 CentOS/6.9 glibc/2.12
UID:GID : 500:500
```
and `.condarc`
```
(projects/testuser11/test_public/envs/default) cat /opt/wakari/anaconda/.condarc
channels:
- r
- https://conda.anaconda.org/wakari
- defaults
create_default_packages:
- anaconda-client
- ipykernel
auto_update_conda: false
```
And when I try to create a env, it does not contain the default_packages as expected
```
(/projects/testuser11/test_public/envs/default) conda create -n bar
Fetching package metadata .............
Solving package specifications:
Package plan for installation in environment /projects/testuser11/test_public/envs/bar:
Proceed ([y]/n)? y
#
# To activate this environment, use:
# > source activate bar
#
# To deactivate an active environment, use:
# > source deactivate
#
(/projects/testuser11/test_public/envs/default) conda list -n bar
# packages in environment at /projects/testuser11/test_public/envs/bar:
#
(/projects/testuser11/test_public/envs/default) ^C
```
cc @csoja
Conda always prioritizes conda-forge over the default channel by design.
You can either temporarily remove conda-forge from your .condarc or add `-c defaults` in your command.
@tyler-thetyrant By default packages I mean the ones specified in the config `create_default_packages`.
When using conda 4.3 it doesn't honor the `create_default_packages` config.
@kalefranz I see this one too in the testing installer for the next AEN version. Can you take a look on this?
conda_info
```
(/projects/testuser11/test_public/envs/default) conda info
Current conda install:
platform : linux-64
conda version : 4.3.22
conda is private : False
conda-env version : 4.3.22
conda-build version : 3.0.6
python version : 2.7.13.final.0
requests version : 2.14.2
root environment : /opt/wakari/anaconda (read only)
default environment : /projects/testuser11/test_public/envs/default
envs directories : /projects/testuser11/test_public/envs
/projects/testuser11/test_public/DEFAULTS
/home/testuser11/.conda/envs
/opt/wakari/anaconda/envs
package cache : /opt/wakari/anaconda/pkgs
/home/testuser11/.conda/pkgs
channel URLs : https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/wakari/linux-64
https://conda.anaconda.org/wakari/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 : /opt/wakari/anaconda/.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.22 requests/2.14.2 CPython/2.7.13 Linux/2.6.32-696.3.1.el6.x86_64 CentOS/6.9 glibc/2.12
UID:GID : 500:500
```
and `.condarc`
```
(projects/testuser11/test_public/envs/default) cat /opt/wakari/anaconda/.condarc
channels:
- r
- https://conda.anaconda.org/wakari
- defaults
create_default_packages:
- anaconda-client
- ipykernel
auto_update_conda: false
```
And when I try to create a env, it does not contain the default_packages as expected
```
(/projects/testuser11/test_public/envs/default) conda create -n bar
Fetching package metadata .............
Solving package specifications:
Package plan for installation in environment /projects/testuser11/test_public/envs/bar:
Proceed ([y]/n)? y
#
# To activate this environment, use:
# > source activate bar
#
# To deactivate an active environment, use:
# > source deactivate
#
(/projects/testuser11/test_public/envs/default) conda list -n bar
# packages in environment at /projects/testuser11/test_public/envs/bar:
#
(/projects/testuser11/test_public/envs/default) ^C
```
cc @csoja | 2017-07-20T21:28:07 |
conda/conda | 5,726 | conda__conda-5726 | [
"1741"
] | c1af02bb4fcfb8c962bb52d040ba705174345889 | 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
@@ -39,6 +39,12 @@ def list_packages(prefix, installed, regex=None, format='human',
show_channel_urls=None):
res = 0
result = []
+
+ if format == 'human':
+ result.append('# packages in environment at %s:' % prefix)
+ result.append('#')
+ result.append('# %-23s %-15s %15s Channel' % ("Name", "Version", "Build"))
+
for dist in get_packages(installed, regex):
if format == 'canonical':
result.append(dist)
@@ -73,9 +79,6 @@ def print_packages(prefix, regex=None, format='human', piplist=False,
raise EnvironmentLocationNotFound(prefix)
if not json:
- if format == 'human':
- print('# packages in environment at %s:' % prefix)
- print('#')
if format == 'export':
print_export_header(context.subdir)
@@ -88,10 +91,12 @@ def print_packages(prefix, regex=None, format='human', piplist=False,
exitcode, output = list_packages(prefix, installed, regex, format=format,
show_channel_urls=show_channel_urls)
- if not json:
- print('\n'.join(map(text_type, output)))
- else:
+ if context.json:
stdout_json(output)
+
+ else:
+ print('\n'.join(map(text_type, output)))
+
return exitcode
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -546,7 +546,7 @@ def test_create_empty_env(self):
stderr = list_output[1]
expected_output = """# packages in environment at %s:
#
-
+# Name Version Build Channel
""" % prefix
self.assertEqual(stdout, expected_output)
self.assertEqual(stderr, '')
| `conda list` doesn't have column headers
The `conda list` command outputs 3 columns of data for which there are no column headers. The first appears to be `package name`, the second `version`, the third is possibly `feature+build number`? It would be great to have these headers added and could be done so in the already hash-prefixed lines so as not to upset filters/pipes relying on the package list format. Thanks.
| In addition, what would be the fourth column?
| 2017-07-25T23:02:50 |
conda/conda | 5,733 | conda__conda-5733 | [
"5708",
"5708"
] | dce9978e3a226ab407e89f12e693350db4a5fe4f | diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -531,8 +531,8 @@ def version_key(self, dist, vtype=None):
bld = rec.get('build_number', 0)
bs = rec.get('build')
ts = rec.get('timestamp', 0)
- return ((valid, -cpri, ver, bld, bs, ts) if context.channel_priority else
- (valid, ver, -cpri, bld, bs, ts))
+ return ((valid, -cpri, ver, bld, ts, bs) if context.channel_priority else
+ (valid, ver, -cpri, bld, ts, bs))
def features(self, dist):
return set(self.index[dist].get('features', '').split())
@@ -669,7 +669,7 @@ def generate_version_metrics(self, C, specs, include0=False):
elif pkey[3] != version_key[3]:
ib += 1
# last field is timestamp. Use it as differentiator when build numbers are similar
- elif pkey[5] != version_key[5]:
+ elif pkey[4] != version_key[4]:
ib += 1
if iv or include0:
| Local package cache higher in priority than conda-build folders
If I have two recipes, "upstream" and "downstream", I see very undesirable behavior with conda.
1. build upstream - hash abc123, timestamp
2. build downstream
3. change upstream, rebuild - hash (somethingnew)
4. build downstream
The second "downstream" build will use the initial "upstream" package, not the more recent build. I suspect that it is because conda is finding the older version first in the pkgs folder. I have not been able to track down where this happens. Here's where I've traced it:
1. get_index: https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/core/index.py#L39
2. get_channel_priority_map prepends "local": https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/core/index.py#L126
3. 'local' multichannel defined using conda_build_local_urls: https://github.com/conda/conda/blob/301133cb8c804730c218ad8e47f116a8b1af51fc/conda/base/context.py#L453
4. conda_build_local_paths: https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/base/context.py#L197
None of these show pkgs. Where is this coming in?
Local package cache higher in priority than conda-build folders
If I have two recipes, "upstream" and "downstream", I see very undesirable behavior with conda.
1. build upstream - hash abc123, timestamp
2. build downstream
3. change upstream, rebuild - hash (somethingnew)
4. build downstream
The second "downstream" build will use the initial "upstream" package, not the more recent build. I suspect that it is because conda is finding the older version first in the pkgs folder. I have not been able to track down where this happens. Here's where I've traced it:
1. get_index: https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/core/index.py#L39
2. get_channel_priority_map prepends "local": https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/core/index.py#L126
3. 'local' multichannel defined using conda_build_local_urls: https://github.com/conda/conda/blob/301133cb8c804730c218ad8e47f116a8b1af51fc/conda/base/context.py#L453
4. conda_build_local_paths: https://github.com/conda/conda/blob/347b8e5d5c0f8798f950b07d08d9f0c81241843b/conda/base/context.py#L197
None of these show pkgs. Where is this coming in?
| Ping @kalefranz, @csoja, this bug is preventing the new testing mechanism from working since @msarahan has implemented a workaround that deletes the very packages I am testing (`clean_pkg_cache`).
The pkgs folder is not treated as a channel at all so that can't be it. The tarballs there are given the priority assigned to the channels they came from.
(Though that leads to the question: what channel is assigned to packages that are pulled from the local channel? What does urls.txt say about them?)
I'd like to raise the priority of this bug (ping @csoja). It seems not to be related to local vs pkg-cache, or at least I have seen conda pick the older of two packages in the same channel (c3i_test). To reproduce this (on LInux, though Docker for mac would be workable):
```
pushd /tmp
wget -c https://repo.continuum.io/pkgs/misc/preview/Miniconda3-4.3.22.dev3-Linux-x86_64.sh
bash Miniconda3-4.3.22.dev3-Linux-x86_64.sh -bfp /tmp/m
. /tmp/m/bin/activate
# This is just so that the tar.bz2 gets extracted
conda install ${CONDA_PREFIX}/pkgs/conda-4.3.22-py36h274531e_1.tar.bz2
conda update -y conda
```
Here `conda update -y conda` should, AFAICT, do nothing, but instead:
```
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /tmp/m:
The following packages will be UPDATED:
conda: 4.3.22-py36h274531e_1 --> 4.3.22-py36h656d191_1
```
.. despite:
```
find ${CONDA_PREFIX}/pkgs -path "*/conda-4.3.22-*/info/index.json" -exec grep -H timestamp {} \;
```
.. giving:
```
/tmp/m/pkgs/conda-4.3.22-py36h274531e_1/info/index.json: "timestamp": 1500831428589,
/tmp/m/pkgs/conda-4.3.22-py36h656d191_1/info/index.json: "timestamp": 1499976843679,
```
Here `conda` has installed the older version.
I'll follow up with the debug output very soon.
```
conda update conda -v -v -v
DEBUG conda.cli.main:init_loggers(95): verbosity set to 3
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/patchelf-0.9-h12092aa_2.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/jinja2-2.9.5-py36hd692eab_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/idna-2.5-py36h317042d_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libiconv-1.14-h79488b8_5.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/beautifulsoup4-4.5.3-py36ha3e3e50_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pkginfo-1.4.1-py36ha36d807_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/openssl-1.0.2l-h09529b2_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libstdcxx_linux-64-7.1.0-hddd74c5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/requests-2.18.1-py36hfc65a8c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libtool-2.4.6-hee670f0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/jsonschema-2.6.0-py36h553177d_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-4.3.22-py36h274531e_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/python-3.6.2-hc1eee60_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyopenssl-16.2.0-py36ha4e8928_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/setuptools-33.1.1-py36h9531ec0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/filelock-2.0.6-py36hecab0e9_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/perl-5.26.0-had2d7c4_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/wheel-0.29.0-py36h53b1bae_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/asn1crypto-0.22.0-py36h1e05746_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/vcversioner-2.16.0.0-py36hd7ef79c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pycosat-0.6.1-py36hd85b70a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libffi-3.2.1-ha60f83d_3.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/coverage-4.4.1-py36he22ce40_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pkg-config-0.29.2-h3348825_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-build-3.0.8-py36h88d0164_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/expat-2.2.1-hb2eb8a5_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/gdbm-1.13-h1da15e7_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/zlib-1.2.11-hcf0e70e_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/six-1.10.0-py36h5d5a401_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pip-9.0.1-py36h3c3718a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pytest-3.1.3-py36hc61c924_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libgfortran_linux-64-7.1.0-hced3fcd_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/bzip2-1.0.6-h6e5dee2_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/readline-7.0-ha53fe01_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/yaml-0.1.6-h21378f5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cryptography-1.8.1-py36h4724394_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pytest-cov-2.4.0-py36hd80946c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/xz-5.2.3-h0585ff0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/chardet-3.0.2-py36h98ed7fb_2.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pysocks-1.6.7-py36he05b2b2_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/m4-1.4.18-h6a3c4c4_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/automake-1.15.1-pl526h5d1f53f_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/autoconf-2.69-pl526ha670186_5.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-env-2.6.0-h36134e3_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyyaml-3.12-py36h82f6ce8_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ca-certificates-2017.01.19-h758a649_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/glob2-0.5-py36hcccd8a5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pycparser-2.17-py36h2510d72_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-verify-2.0.0-py36hb6ee407_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/urllib3-1.21.1-py36hf62cdc1_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libgcc_linux-64-7.1.0-h98fb546_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/certifi-2017.4.17-py36h91f7e26_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ncurses-6.0-he7fb7a6_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/curl-7.52.1-he4bd48f_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyparsing-2.2.0-py36h614a43e_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ruamel_yaml-0.11.14-py36h2509325_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cffi-1.10.0-py36hd280c6a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/py-1.4.33-py36h884c705_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/sqlite-3.16.2-h1ca8275_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/markupsafe-1.0-py36h9e26fae_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cython-0.25.2-py36hf2b3963_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/packaging-16.8-py36hb3ac33a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/tk-8.6.6-h7240f3b_6.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/git-2.13.2-pl526hfe81c7d_0.json
DEBUG conda.core.index:fetch_index(106): channel_urls=OrderedDict([('https://conda.anaconda.org/c3i_test/linux-64', ('defaults', 0)), ('https://conda.anaconda.org/c3i_test/noarch', ('defaults', 0)), ('https://repo.continuum.io/pkgs/free/linux-64', ('https://repo.continuum.io/pkgs/free', 2)), ('https://repo.continuum.io/pkgs/free/noarch', ('https://repo.continuum.io/pkgs/free', 2)), ('https://repo.continuum.io/pkgs/r/linux-64', ('https://repo.continuum.io/pkgs/r', 3)), ('https://repo.continuum.io/pkgs/r/noarch', ('https://repo.continuum.io/pkgs/r', 3)), ('https://repo.continuum.io/pkgs/pro/linux-64', ('https://repo.continuum.io/pkgs/pro', 4)), ('https://repo.continuum.io/pkgs/pro/noarch', ('https://repo.continuum.io/pkgs/pro', 4))])
Fetching package metadata ...DEBUG urllib3.util.retry:from_int(200): Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
TRACE conda.gateways.disk.test:file_path_is_writable(23): checking path is writable /tmp/m/pkgs/urls.txt
TRACE conda.gateways.disk.test:file_path_is_writable(23): checking path is writable /home/ray/.conda/pkgs/urls.txt
DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://conda.anaconda.org/c3i_test/linux-64 at /tmp/m/pkgs/cache/b416b7b7.json
DEBUG conda.connection:add_binstar_token(144): Adding anaconda token for url <https://conda.anaconda.org/c3i_test/linux-64/repodata.json>
DEBUG urllib3.connectionpool:_new_conn(818): Starting new HTTPS connection (1): conda.anaconda.org
DEBUG urllib3.connectionpool:_make_request(395): https://conda.anaconda.org:443 "GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/linux-64/repodata.json HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/linux-64/repodata.json HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: gzip, deflate, compress, identity
> Connection: keep-alive
> Content-Type: application/json
> If-Modified-Since: Tue, 25 Jul 2017 12:51:26 GMT
<<HTTPS 304 NOT MODIFIED
< CF-RAY: 3846724cedb669f5-LHR
< Date: Wed, 26 Jul 2017 09:49:00 GMT
< Server: cloudflare-nginx
< Set-Cookie: __cfduid=d78c5fd31985d6fb661b882f416ab46421501062540; expires=Thu, 26-Jul-18 09:49:00 GMT; path=/; domain=.anaconda.org; HttpOnly
< Strict-Transport-Security: max-age=31536000
< Connection: keep-alive
< Elapsed: 00:05.558808
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://conda.anaconda.org/c3i_test/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/b416b7b7.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/b416b7b7.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://conda.anaconda.org/c3i_test/noarch at /tmp/m/pkgs/cache/917d14b1.json
DEBUG conda.connection:add_binstar_token(144): Adding anaconda token for url <https://conda.anaconda.org/c3i_test/noarch/repodata.json>
DEBUG urllib3.connectionpool:_make_request(395): https://conda.anaconda.org:443 "GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/noarch/repodata.json HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/noarch/repodata.json HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: gzip, deflate, compress, identity
> Connection: keep-alive
> Content-Type: application/json
> Cookie: __cfduid=d78c5fd31985d6fb661b882f416ab46421501062540
> If-Modified-Since: Tue, 25 Jul 2017 12:51:26 GMT
<<HTTPS 304 NOT MODIFIED
< CF-RAY: 3846724fcef369f5-LHR
< Date: Wed, 26 Jul 2017 09:49:01 GMT
< Server: cloudflare-nginx
< Strict-Transport-Security: max-age=31536000
< Connection: keep-alive
< Elapsed: 00:00.376864
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://conda.anaconda.org/c3i_test/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/917d14b1.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/917d14b1.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/free/linux-64 at /tmp/m/pkgs/cache/db552c1e.json
DEBUG urllib3.connectionpool:_new_conn(818): Starting new HTTPS connection (1): repo.continuum.io
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/free/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/free/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> If-Modified-Since: Tue, 25 Jul 2017 21:38:30 GMT
> If-None-Match: "528db52103850ab1ea421877ce0622b5"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672720cfd1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "528db52103850ab1ea421877ce0622b5"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 21:38:30 GMT
< Server: cloudflare-nginx
< Set-Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546; expires=Thu, 26-Jul-18 09:49:06 GMT; path=/; domain=.continuum.io; HttpOnly
< Vary: Accept-Encoding
< x-amz-id-2: HrQ88aHFkfAQvU3FMBfq3AZmIcGDxTO46nbN5kdQJHaSEWCyo4K+aHvL5gMxOi8qIWJmZF33+L4=
< x-amz-request-id: 6C00A32855FF2A5B
< x-amz-version-id: v88OrIeB9hB3TbY6DI1SeBnNxxjoz8It
< Connection: keep-alive
< Elapsed: 00:05.120355
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/free/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/db552c1e.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/db552c1e.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/free/noarch at /tmp/m/pkgs/cache/9ca791dd.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/free/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/free/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:04:09 GMT
> If-None-Match: "e5e41f3b07a5ae63250ff2c9a1a99f3b"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672733da31377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "e5e41f3b07a5ae63250ff2c9a1a99f3b"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:04:09 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: FDLYjD2Bc7q7L0boRmbiNQDanHzsfgBen/atQMaPbQcb4b2jqe6SWGSqeD+iQnVioaeFV82zbJE=
< x-amz-request-id: 9C3CC975BFDD6619
< x-amz-version-id: 9Zqwri8g_5defKke_hvbGibCznu18KQb
< Connection: keep-alive
< Elapsed: 00:00.018662
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/free/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/9ca791dd.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/9ca791dd.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/r/linux-64 at /tmp/m/pkgs/cache/6bfb14bd.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/r/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/r/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:05:32 GMT
> If-None-Match: "b7bc1b9927fa701bad6c8139397b758c"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672735dbc1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "b7bc1b9927fa701bad6c8139397b758c"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:05:32 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: z+3pUl3L018WMeobXtcBuPaE6jMe0c544bzG5K1C8L8Bo33MR1QmLWjXcsFvnBN0K/uJCViAx6c=
< x-amz-request-id: 630143C21248F89A
< x-amz-version-id: rcxLjX4hLQ82_pOqxYLqW3tjmKKrd8ce
< Connection: keep-alive
< Elapsed: 00:00.032432
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/r/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/6bfb14bd.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/6bfb14bd.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/r/noarch at /tmp/m/pkgs/cache/716b88c0.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/r/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/r/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 31 Jan 2017 05:50:11 GMT
> If-None-Match: "e8c60de6ccbc390c49c0a91035a53c64"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 38467273bdec1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "e8c60de6ccbc390c49c0a91035a53c64"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 31 Jan 2017 05:50:11 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: LYfFs5RzEnhgAm4xzQx8ehkxG75ZW6bvbqrwfHIWiZ9t4wxc0YWXIYuHyM0vwo39yO+SwmmzA6g=
< x-amz-request-id: 95938D78B0ACA670
< x-amz-version-id: q9tvk8Y4cFZ5bm2fRh8sN6opdl7qs.78
< Connection: keep-alive
< Elapsed: 00:00.019828
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/r/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/716b88c0.json
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/pro/linux-64 at /tmp/m/pkgs/cache/8db5e652.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/pro/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/pro/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 21:39:45 GMT
> If-None-Match: "041674100c301c307f0b99686bb704fd"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 38467273ee001377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "041674100c301c307f0b99686bb704fd"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 21:39:45 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: 8BOV1Utn0yTEqRCCg7r2+rq/CGaJM4Y9pP3IIbiEFnBqUdXvgPxwhdMFmgJL98QY7E59E+xnGQ8=
< x-amz-request-id: DDBE61B3FC7EF8FF
< x-amz-version-id: O1CUvUpbSVOq9XAXTcktbpj_eoM7XcC2
< Connection: keep-alive
< Elapsed: 00:00.037129
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/pro/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/8db5e652.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/8db5e652.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/pro/noarch at /tmp/m/pkgs/cache/08159f17.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/pro/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/pro/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:05:32 GMT
> If-None-Match: "a03a8ce02144dee86add4a372c6c86b7"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672742e281377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "a03a8ce02144dee86add4a372c6c86b7"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:05:32 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: maHaUBDzZNM3YTk5Ql5nZrBctDRj3nbHrku0aXFhyjk0+At6uXaeKPfCa3FbxwmfTg0e64sGdVE=
< x-amz-request-id: 77E33E5835086704
< x-amz-version-id: xUxq8fc5dIfxN8yyTTMILlG.G08OZ1vc
< Connection: keep-alive
< Elapsed: 00:00.021581
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/pro/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/08159f17.json
.
DEBUG conda.plan:add_defaults_to_specs(371): H0 specs=[MatchSpec('conda')]
DEBUG conda.plan:add_defaults_to_specs(386): H2 python True
DEBUG conda.plan:add_defaults_to_specs(402): H3 python
DEBUG conda.plan:add_defaults_to_specs(386): H2 lua False
DEBUG conda.plan:add_defaults_to_specs(391): H2A lua
DEBUG conda.plan:add_defaults_to_specs(417): HF specs=[MatchSpec('conda'), 'python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)']
DEBUG conda.plan:augment_specs(714): Pinned specs=()
DEBUG conda.resolve:install_specs(790): Checking satisfiability of current install
DEBUG conda.resolve:bad_installed(740): Checking if the current environment is consistent
Solving package specifications: DEBUG conda.resolve:solve(845): Solving for [MatchSpec('conda'), MatchSpec('python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)'), MatchSpec('patchelf (target=defaults::patchelf-0.9-h12092aa_2)'), MatchSpec('jinja2 (target=defaults::jinja2-2.9.5-py36hd692eab_0)'), MatchSpec('idna (target=defaults::idna-2.5-py36h317042d_0)'), MatchSpec('libiconv (target=defaults::libiconv-1.14-h79488b8_5)'), MatchSpec('beautifulsoup4 (target=defaults::beautifulsoup4-4.5.3-py36ha3e3e50_0)'), MatchSpec('pkginfo (target=defaults::pkginfo-1.4.1-py36ha36d807_0)'), MatchSpec('openssl (target=defaults::openssl-1.0.2l-h09529b2_0)'), MatchSpec('libstdcxx_linux-64 (target=defaults::libstdcxx_linux-64-7.1.0-hddd74c5_0)'), MatchSpec('requests (target=defaults::requests-2.18.1-py36hfc65a8c_0)'), MatchSpec('libtool (target=defaults::libtool-2.4.6-hee670f0_0)'), MatchSpec('jsonschema (target=defaults::jsonschema-2.6.0-py36h553177d_0)'), MatchSpec('pyopenssl (target=defaults::pyopenssl-16.2.0-py36ha4e8928_0)'), MatchSpec('setuptools (target=defaults::setuptools-33.1.1-py36h9531ec0_0)'), MatchSpec('filelock (target=defaults::filelock-2.0.6-py36hecab0e9_0)'), MatchSpec('perl (target=defaults::perl-5.26.0-had2d7c4_0)'), MatchSpec('wheel (target=defaults::wheel-0.29.0-py36h53b1bae_0)'), MatchSpec('asn1crypto (target=defaults::asn1crypto-0.22.0-py36h1e05746_0)'), MatchSpec('vcversioner (target=defaults::vcversioner-2.16.0.0-py36hd7ef79c_0)'), MatchSpec('pycosat (target=defaults::pycosat-0.6.1-py36hd85b70a_0)'), MatchSpec('libffi (target=defaults::libffi-3.2.1-ha60f83d_3)'), MatchSpec('coverage (target=defaults::coverage-4.4.1-py36he22ce40_0)'), MatchSpec('pkg-config (target=defaults::pkg-config-0.29.2-h3348825_0)'), MatchSpec('conda-build (target=defaults::conda-build-3.0.8-py36h88d0164_0)'), MatchSpec('expat (target=defaults::expat-2.2.1-hb2eb8a5_1)'), MatchSpec('gdbm (target=defaults::gdbm-1.13-h1da15e7_0)'), MatchSpec('zlib (target=defaults::zlib-1.2.11-hcf0e70e_0)'), MatchSpec('six (target=defaults::six-1.10.0-py36h5d5a401_1)'), MatchSpec('pip (target=defaults::pip-9.0.1-py36h3c3718a_0)'), MatchSpec('pytest (target=defaults::pytest-3.1.3-py36hc61c924_0)'), MatchSpec('libgfortran_linux-64 (target=defaults::libgfortran_linux-64-7.1.0-hced3fcd_0)'), MatchSpec('bzip2 (target=defaults::bzip2-1.0.6-h6e5dee2_1)'), MatchSpec('readline (target=defaults::readline-7.0-ha53fe01_1)'), MatchSpec('yaml (target=defaults::yaml-0.1.6-h21378f5_0)'), MatchSpec('cryptography (target=defaults::cryptography-1.8.1-py36h4724394_0)'), MatchSpec('pytest-cov (target=defaults::pytest-cov-2.4.0-py36hd80946c_0)'), MatchSpec('xz (target=defaults::xz-5.2.3-h0585ff0_0)'), MatchSpec('chardet (target=defaults::chardet-3.0.2-py36h98ed7fb_2)'), MatchSpec('pysocks (target=defaults::pysocks-1.6.7-py36he05b2b2_1)'), MatchSpec('m4 (target=defaults::m4-1.4.18-h6a3c4c4_0)'), MatchSpec('automake (target=defaults::automake-1.15.1-pl526h5d1f53f_0)'), MatchSpec('autoconf (target=defaults::autoconf-2.69-pl526ha670186_5)'), MatchSpec('conda-env (target=defaults::conda-env-2.6.0-h36134e3_0)'), MatchSpec('pyyaml (target=defaults::pyyaml-3.12-py36h82f6ce8_1)'), MatchSpec('ca-certificates (target=defaults::ca-certificates-2017.01.19-h758a649_0)'), MatchSpec('glob2 (target=defaults::glob2-0.5-py36hcccd8a5_0)'), MatchSpec('pycparser (target=defaults::pycparser-2.17-py36h2510d72_0)'), MatchSpec('conda-verify (target=defaults::conda-verify-2.0.0-py36hb6ee407_0)'), MatchSpec('urllib3 (target=defaults::urllib3-1.21.1-py36hf62cdc1_1)'), MatchSpec('libgcc_linux-64 (target=defaults::libgcc_linux-64-7.1.0-h98fb546_0)'), MatchSpec('certifi (target=defaults::certifi-2017.4.17-py36h91f7e26_0)'), MatchSpec('ncurses (target=defaults::ncurses-6.0-he7fb7a6_0)'), MatchSpec('curl (target=defaults::curl-7.52.1-he4bd48f_1)'), MatchSpec('pyparsing (target=defaults::pyparsing-2.2.0-py36h614a43e_0)'), MatchSpec('ruamel_yaml (target=defaults::ruamel_yaml-0.11.14-py36h2509325_0)'), MatchSpec('cffi (target=defaults::cffi-1.10.0-py36hd280c6a_0)'), MatchSpec('py (target=defaults::py-1.4.33-py36h884c705_0)'), MatchSpec('sqlite (target=defaults::sqlite-3.16.2-h1ca8275_0)'), MatchSpec('markupsafe (target=defaults::markupsafe-1.0-py36h9e26fae_0)'), MatchSpec('cython (target=defaults::cython-0.25.2-py36hf2b3963_1)'), MatchSpec('packaging (target=defaults::packaging-16.8-py36hb3ac33a_0)'), MatchSpec('tk (target=defaults::tk-8.6.6-h7240f3b_6)'), MatchSpec('git (target=defaults::git-2.13.2-pl526hfe81c7d_0)')]
DEBUG conda.resolve:get_reduced_index(374): Retrieving packages for: [MatchSpec('conda'), MatchSpec('python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)'), MatchSpec('patchelf (target=defaults::patchelf-0.9-h12092aa_2)'), MatchSpec('jinja2 (target=defaults::jinja2-2.9.5-py36hd692eab_0)'), MatchSpec('idna (target=defaults::idna-2.5-py36h317042d_0)'), MatchSpec('libiconv (target=defaults::libiconv-1.14-h79488b8_5)'), MatchSpec('beautifulsoup4 (target=defaults::beautifulsoup4-4.5.3-py36ha3e3e50_0)'), MatchSpec('pkginfo (target=defaults::pkginfo-1.4.1-py36ha36d807_0)'), MatchSpec('openssl (target=defaults::openssl-1.0.2l-h09529b2_0)'), MatchSpec('libstdcxx_linux-64 (target=defaults::libstdcxx_linux-64-7.1.0-hddd74c5_0)'), MatchSpec('requests (target=defaults::requests-2.18.1-py36hfc65a8c_0)'), MatchSpec('libtool (target=defaults::libtool-2.4.6-hee670f0_0)'), MatchSpec('jsonschema (target=defaults::jsonschema-2.6.0-py36h553177d_0)'), MatchSpec('pyopenssl (target=defaults::pyopenssl-16.2.0-py36ha4e8928_0)'), MatchSpec('setuptools (target=defaults::setuptools-33.1.1-py36h9531ec0_0)'), MatchSpec('filelock (target=defaults::filelock-2.0.6-py36hecab0e9_0)'), MatchSpec('perl (target=defaults::perl-5.26.0-had2d7c4_0)'), MatchSpec('wheel (target=defaults::wheel-0.29.0-py36h53b1bae_0)'), MatchSpec('asn1crypto (target=defaults::asn1crypto-0.22.0-py36h1e05746_0)'), MatchSpec('vcversioner (target=defaults::vcversioner-2.16.0.0-py36hd7ef79c_0)'), MatchSpec('pycosat (target=defaults::pycosat-0.6.1-py36hd85b70a_0)'), MatchSpec('libffi (target=defaults::libffi-3.2.1-ha60f83d_3)'), MatchSpec('coverage (target=defaults::coverage-4.4.1-py36he22ce40_0)'), MatchSpec('pkg-config (target=defaults::pkg-config-0.29.2-h3348825_0)'), MatchSpec('conda-build (target=defaults::conda-build-3.0.8-py36h88d0164_0)'), MatchSpec('expat (target=defaults::expat-2.2.1-hb2eb8a5_1)'), MatchSpec('gdbm (target=defaults::gdbm-1.13-h1da15e7_0)'), MatchSpec('zlib (target=defaults::zlib-1.2.11-hcf0e70e_0)'), MatchSpec('six (target=defaults::six-1.10.0-py36h5d5a401_1)'), MatchSpec('pip (target=defaults::pip-9.0.1-py36h3c3718a_0)'), MatchSpec('pytest (target=defaults::pytest-3.1.3-py36hc61c924_0)'), MatchSpec('libgfortran_linux-64 (target=defaults::libgfortran_linux-64-7.1.0-hced3fcd_0)'), MatchSpec('bzip2 (target=defaults::bzip2-1.0.6-h6e5dee2_1)'), MatchSpec('readline (target=defaults::readline-7.0-ha53fe01_1)'), MatchSpec('yaml (target=defaults::yaml-0.1.6-h21378f5_0)'), MatchSpec('cryptography (target=defaults::cryptography-1.8.1-py36h4724394_0)'), MatchSpec('pytest-cov (target=defaults::pytest-cov-2.4.0-py36hd80946c_0)'), MatchSpec('xz (target=defaults::xz-5.2.3-h0585ff0_0)'), MatchSpec('chardet (target=defaults::chardet-3.0.2-py36h98ed7fb_2)'), MatchSpec('pysocks (target=defaults::pysocks-1.6.7-py36he05b2b2_1)'), MatchSpec('m4 (target=defaults::m4-1.4.18-h6a3c4c4_0)'), MatchSpec('automake (target=defaults::automake-1.15.1-pl526h5d1f53f_0)'), MatchSpec('autoconf (target=defaults::autoconf-2.69-pl526ha670186_5)'), MatchSpec('conda-env (target=defaults::conda-env-2.6.0-h36134e3_0)'), MatchSpec('pyyaml (target=defaults::pyyaml-3.12-py36h82f6ce8_1)'), MatchSpec('ca-certificates (target=defaults::ca-certificates-2017.01.19-h758a649_0)'), MatchSpec('glob2 (target=defaults::glob2-0.5-py36hcccd8a5_0)'), MatchSpec('pycparser (target=defaults::pycparser-2.17-py36h2510d72_0)'), MatchSpec('conda-verify (target=defaults::conda-verify-2.0.0-py36hb6ee407_0)'), MatchSpec('urllib3 (target=defaults::urllib3-1.21.1-py36hf62cdc1_1)'), MatchSpec('libgcc_linux-64 (target=defaults::libgcc_linux-64-7.1.0-h98fb546_0)'), MatchSpec('certifi (target=defaults::certifi-2017.4.17-py36h91f7e26_0)'), MatchSpec('ncurses (target=defaults::ncurses-6.0-he7fb7a6_0)'), MatchSpec('curl (target=defaults::curl-7.52.1-he4bd48f_1)'), MatchSpec('pyparsing (target=defaults::pyparsing-2.2.0-py36h614a43e_0)'), MatchSpec('ruamel_yaml (target=defaults::ruamel_yaml-0.11.14-py36h2509325_0)'), MatchSpec('cffi (target=defaults::cffi-1.10.0-py36hd280c6a_0)'), MatchSpec('py (target=defaults::py-1.4.33-py36h884c705_0)'), MatchSpec('sqlite (target=defaults::sqlite-3.16.2-h1ca8275_0)'), MatchSpec('markupsafe (target=defaults::markupsafe-1.0-py36h9e26fae_0)'), MatchSpec('cython (target=defaults::cython-0.25.2-py36hf2b3963_1)'), MatchSpec('packaging (target=defaults::packaging-16.8-py36hb3ac33a_0)'), MatchSpec('tk (target=defaults::tk-8.6.6-h7240f3b_6)'), MatchSpec('git (target=defaults::git-2.13.2-pl526hfe81c7d_0)')]
DEBUG conda.resolve:filter_group(399): python: pruned from 88 -> 87
DEBUG conda.resolve:filter_group(399): python: pruned from 87 -> 63
DEBUG conda.resolve:filter_group(399): six: pruned from 40 -> 21
DEBUG conda.resolve:filter_group(399): cython: pruned from 92 -> 61
DEBUG conda.resolve:filter_group(399): markupsafe: pruned from 15 -> 11
DEBUG conda.resolve:filter_group(399): py: pruned from 60 -> 38
DEBUG conda.resolve:filter_group(399): cffi: pruned from 74 -> 50
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 33 -> 23
DEBUG conda.resolve:filter_group(399): pyparsing: pruned from 21 -> 15
DEBUG conda.resolve:filter_group(399): certifi: pruned from 14 -> 12
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 77 -> 26
DEBUG conda.resolve:filter_group(399): cffi: pruned from 50 -> 25
DEBUG conda.resolve:filter_group(399): idna: pruned from 19 -> 17
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 201 -> 125
DEBUG conda.resolve:filter_group(399): six: pruned from 21 -> 19
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 32 -> 26
DEBUG conda.resolve:filter_group(399): python: pruned from 63 -> 50
DEBUG conda.resolve:filter_group(399): conda-verify: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): pyyaml: pruned from 22 -> 11
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 23 -> 16
DEBUG conda.resolve:filter_group(399): glob2: pruned from 5 -> 4
DEBUG conda.resolve:filter_group(399): conda-env: pruned from 66 -> 28
DEBUG conda.resolve:filter_group(399): chardet: pruned from 19 -> 15
DEBUG conda.resolve:filter_group(399): pytest-cov: pruned from 9 -> 7
DEBUG conda.resolve:filter_group(399): coverage: pruned from 27 -> 20
DEBUG conda.resolve:filter_group(399): pytest: pruned from 89 -> 47
DEBUG conda.resolve:filter_group(399): py: pruned from 38 -> 28
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 26 -> 19
DEBUG conda.resolve:filter_group(399): cffi: pruned from 25 -> 18
DEBUG conda.resolve:filter_group(399): idna: pruned from 17 -> 13
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 125 -> 77
DEBUG conda.resolve:filter_group(399): six: pruned from 19 -> 13
DEBUG conda.resolve:filter_group(399): pip: pruned from 107 -> 45
DEBUG conda.resolve:filter_group(399): conda-build: pruned from 296 -> 174
DEBUG conda.resolve:filter_group(399): conda: pruned from 400 -> 216
DEBUG conda.resolve:filter_group(399): pycosat: pruned from 19 -> 11
DEBUG conda.resolve:filter_group(399): vcversioner: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): asn1crypto: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): wheel: pruned from 20 -> 12
DEBUG conda.resolve:filter_group(399): filelock: pruned from 8 -> 6
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 26 -> 18
DEBUG conda.resolve:filter_group(399): jsonschema: pruned from 14 -> 10
DEBUG conda.resolve:filter_group(399): requests: pruned from 112 -> 48
DEBUG conda.resolve:filter_group(399): pkginfo: pruned from 9 -> 7
DEBUG conda.resolve:filter_group(399): beautifulsoup4: pruned from 20 -> 15
DEBUG conda.resolve:filter_group(399): jinja2: pruned from 47 -> 24
DEBUG conda.resolve:filter_group(399): python: pruned from 50 -> 8
DEBUG conda.resolve:filter_group(399): sqlite: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): tk: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): xz: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): conda: pruned from 216 -> 17
DEBUG conda.resolve:filter_group(399): conda-env: pruned from 28 -> 3
DEBUG conda.resolve:filter_group(399): pycosat: pruned from 11 -> 4
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 18 -> 4
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 19 -> 5
DEBUG conda.resolve:filter_group(399): cffi: pruned from 18 -> 4
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 16 -> 4
DEBUG conda.resolve:filter_group(399): idna: pruned from 13 -> 5
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 77 -> 4
DEBUG conda.resolve:filter_group(399): six: pruned from 13 -> 3
DEBUG conda.resolve:filter_group(399): requests: pruned from 48 -> 5
DEBUG conda.resolve:filter_group(399): ruamel_yaml: pruned from 12 -> 3
DEBUG conda.resolve:filter_group(399): packaging: pruned from 6 -> 3
DEBUG conda.resolve:filter_group(399): pyparsing: pruned from 15 -> 3
DEBUG conda.resolve:filter_group(399): cython: pruned from 61 -> 4
DEBUG conda.resolve:filter_group(399): markupsafe: pruned from 11 -> 3
DEBUG conda.resolve:filter_group(399): py: pruned from 28 -> 7
DEBUG conda.resolve:filter_group(399): certifi: pruned from 12 -> 3
DEBUG conda.resolve:filter_group(399): urllib3: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): pysocks: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): conda-verify: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): pyyaml: pruned from 11 -> 3
DEBUG conda.resolve:filter_group(399): glob2: pruned from 4 -> 2
DEBUG conda.resolve:filter_group(399): chardet: pruned from 15 -> 7
DEBUG conda.resolve:filter_group(399): pytest-cov: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): coverage: pruned from 20 -> 6
DEBUG conda.resolve:filter_group(399): pytest: pruned from 47 -> 7
DEBUG conda.resolve:filter_group(399): pip: pruned from 45 -> 3
DEBUG conda.resolve:filter_group(399): wheel: pruned from 12 -> 4
DEBUG conda.resolve:filter_group(399): conda-build: pruned from 174 -> 24
DEBUG conda.resolve:filter_group(399): beautifulsoup4: pruned from 15 -> 5
DEBUG conda.resolve:filter_group(399): filelock: pruned from 6 -> 2
DEBUG conda.resolve:filter_group(399): jinja2: pruned from 24 -> 6
DEBUG conda.resolve:filter_group(399): pkginfo: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): vcversioner: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): asn1crypto: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): jsonschema: pruned from 10 -> 4
.DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(885): Package removal metric: 0
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,15)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2657+15) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final peak objective: 0
DEBUG conda.resolve:solve(890): Initial package version metric: 0
DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(895): Track feature count: 0
DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(901): Package feature count: 0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,1)
TRACE conda.logic:LinearBound_(378): Eliminating 1/1 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2672+1) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(905): Initial package build metric: 0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,43)
TRACE conda.logic:LinearBound_(378): Eliminating 63/63 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2673+63) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(910): Dependency update count: 0
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,5)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2736+190) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(1,5)
TRACE conda.logic:minimize(535): Bisection attempt: (1,3), (2736+57) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(4,5)
TRACE conda.logic:minimize(535): Bisection attempt: (4,4), (2736+47) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(5,5)
TRACE conda.logic:minimize(535): Bisection attempt: (5,5), (2736+39) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(5,5)
DEBUG conda.logic:minimize(557): Final peak objective: 5
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (5,54)
TRACE conda.logic:minimize(535): Bisection attempt: (5,54), (2775+18959) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(5,54)
TRACE conda.logic:minimize(535): Bisection attempt: (5,29), (2775+11237) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(30,54)
TRACE conda.logic:minimize(535): Bisection attempt: (30,42), (2775+16196) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(43,54)
TRACE conda.logic:minimize(535): Bisection attempt: (43,48), (2775+17543) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(49,54)
TRACE conda.logic:minimize(535): Bisection attempt: (49,51), (2775+18020) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(52,54)
TRACE conda.logic:minimize(535): Bisection attempt: (52,53), (2775+18413) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(54,54)
TRACE conda.logic:minimize(535): Bisection attempt: (54,54), (2775+18517) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(54,54)
DEBUG conda.logic:minimize(557): Final sum objective: 54
DEBUG conda.logic:minimize(569): New peak objective: 5
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,0)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (21292+43) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final peak objective: 0
DEBUG conda.resolve:solve(916): Additional package version/build metrics: 54/0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,0)
TRACE conda.logic:LinearBound_(378): Eliminating 10/10 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,-1), (21335+0) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(0,0)
TRACE conda.logic:LinearBound_(378): Eliminating 10/10 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (21335+10) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(921): Weak dependency count: 0
DEBUG conda.resolve:solve(926): Looking for alternate solutions
Package plan for installation in environment /tmp/m:
The following packages will be UPDATED:
conda: 4.3.22-py36h274531e_1 --> 4.3.22-py36h656d191_1
```
Here is the URL for the conda packages on c3i_test: https://anaconda.org/c3i_test/conda/files. As you can see, both conda packages involved in this incorrect upgrade are present.
> conda install ${CONDA_PREFIX}/pkgs/conda-4.3.22-py36h274531e_1.tar.bz2
That command is probably problematic in the flow above. Installing an explicit tarball isn't bulletproof. I'm guessing channel information is getting dropped in the process (channel information, obviously, isn't contained within the tarball itself). If channel information is dropped, the channel becomes `<unknown>`, and any other channel will have higher priority.
OK, this is a good clue. I believe that if someone specifies a package cache tarball on the command line, `conda` _tries_ to match it back to its source. It's possible this resolution is not happening properly. @kalefranz I'd recommend checking out that code that attempts to resolve channel information about a tarball.
But I would _also_ like to ask that we do not build workflows of any kind that depend on reaching into the package cache and installing a tarball that is there. Nobody, and that includes us, should be depending on its contents. It's a cache, not a channel.
> What channel is assigned to packages that are pulled from the local channel? What does urls.txt say about them?
urls.txt should record the full `file:///path/to/conda/conda-bld/linux-64/package-1.2.3-45_6.tar.bz2` url, which, when passed as input to the `Channel()` object, will recognize the channel `canonical_name` as being `local`, as long as `file:///path/to/conda/conda-bld` is one of the paths configured/recognized as belonging to conda-build.
python -c "from conda.base.context import context; print(context.conda_build_local_urls)"
> I suspect that it is because conda is finding the older version first in the pkgs folder.
There was one day a week or two in standup where I was warning about being scared we could have problems with conda 4.3 and conda-build 3.0 regarding the hashing scheme and the package cache (I got a lot of funny looks when I said that, so I probably didn't communicate my concerns in the most eloquent way.) It's very likely this is related.
As I understand the situation @msarahan described at the top of the ticket, we have two packages in the package cache with nominally *identical* metadata, and the only difference is the timestamp on the package. Conda hasn't ever had to deal with this situation before, prior to the build string hashing introduced in conda-build 3.
If this is the case, we can certainly fix this for conda 4.4. Fix it thoroughly and completely, in all places where it could crop up and cause ugliness (there are possibly other situations, besides the one we're working through here). I do still have some concerns though that conda 4.3 will never be able to handle the filename hashing completely and correctly (and certainly not any conda versions <= 4.3.23).
@mingwandroid As a test in your current workflow where you're running into your issue, can you (1) find a way to not install explicit tarballs directly, and (2) disable the build string hashing? Let's see if we can at least work on isolating the source of the problem...
I only installed the explicit tarball so I could grep in the extracted index.json file to show you the timestamp values! The problem happens without having ever installed anything from an explicit tarball.
I cannot disable build string hashing. Can you fire up a Linux machine and figure it out there? I don't have time to look into this personally.
It strikes me that this isn't related to the hash string itself, only the fact that there are multiple packages of interest with identical filenames.
Ping @kalefranz, @csoja, this bug is preventing the new testing mechanism from working since @msarahan has implemented a workaround that deletes the very packages I am testing (`clean_pkg_cache`).
The pkgs folder is not treated as a channel at all so that can't be it. The tarballs there are given the priority assigned to the channels they came from.
(Though that leads to the question: what channel is assigned to packages that are pulled from the local channel? What does urls.txt say about them?)
I'd like to raise the priority of this bug (ping @csoja). It seems not to be related to local vs pkg-cache, or at least I have seen conda pick the older of two packages in the same channel (c3i_test). To reproduce this (on LInux, though Docker for mac would be workable):
```
pushd /tmp
wget -c https://repo.continuum.io/pkgs/misc/preview/Miniconda3-4.3.22.dev3-Linux-x86_64.sh
bash Miniconda3-4.3.22.dev3-Linux-x86_64.sh -bfp /tmp/m
. /tmp/m/bin/activate
# This is just so that the tar.bz2 gets extracted
conda install ${CONDA_PREFIX}/pkgs/conda-4.3.22-py36h274531e_1.tar.bz2
conda update -y conda
```
Here `conda update -y conda` should, AFAICT, do nothing, but instead:
```
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /tmp/m:
The following packages will be UPDATED:
conda: 4.3.22-py36h274531e_1 --> 4.3.22-py36h656d191_1
```
.. despite:
```
find ${CONDA_PREFIX}/pkgs -path "*/conda-4.3.22-*/info/index.json" -exec grep -H timestamp {} \;
```
.. giving:
```
/tmp/m/pkgs/conda-4.3.22-py36h274531e_1/info/index.json: "timestamp": 1500831428589,
/tmp/m/pkgs/conda-4.3.22-py36h656d191_1/info/index.json: "timestamp": 1499976843679,
```
Here `conda` has installed the older version.
I'll follow up with the debug output very soon.
```
conda update conda -v -v -v
DEBUG conda.cli.main:init_loggers(95): verbosity set to 3
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/patchelf-0.9-h12092aa_2.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/jinja2-2.9.5-py36hd692eab_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/idna-2.5-py36h317042d_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libiconv-1.14-h79488b8_5.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/beautifulsoup4-4.5.3-py36ha3e3e50_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pkginfo-1.4.1-py36ha36d807_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/openssl-1.0.2l-h09529b2_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libstdcxx_linux-64-7.1.0-hddd74c5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/requests-2.18.1-py36hfc65a8c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libtool-2.4.6-hee670f0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/jsonschema-2.6.0-py36h553177d_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-4.3.22-py36h274531e_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/python-3.6.2-hc1eee60_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyopenssl-16.2.0-py36ha4e8928_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/setuptools-33.1.1-py36h9531ec0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/filelock-2.0.6-py36hecab0e9_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/perl-5.26.0-had2d7c4_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/wheel-0.29.0-py36h53b1bae_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/asn1crypto-0.22.0-py36h1e05746_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/vcversioner-2.16.0.0-py36hd7ef79c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pycosat-0.6.1-py36hd85b70a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libffi-3.2.1-ha60f83d_3.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/coverage-4.4.1-py36he22ce40_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pkg-config-0.29.2-h3348825_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-build-3.0.8-py36h88d0164_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/expat-2.2.1-hb2eb8a5_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/gdbm-1.13-h1da15e7_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/zlib-1.2.11-hcf0e70e_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/six-1.10.0-py36h5d5a401_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pip-9.0.1-py36h3c3718a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pytest-3.1.3-py36hc61c924_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libgfortran_linux-64-7.1.0-hced3fcd_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/bzip2-1.0.6-h6e5dee2_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/readline-7.0-ha53fe01_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/yaml-0.1.6-h21378f5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cryptography-1.8.1-py36h4724394_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pytest-cov-2.4.0-py36hd80946c_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/xz-5.2.3-h0585ff0_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/chardet-3.0.2-py36h98ed7fb_2.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pysocks-1.6.7-py36he05b2b2_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/m4-1.4.18-h6a3c4c4_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/automake-1.15.1-pl526h5d1f53f_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/autoconf-2.69-pl526ha670186_5.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-env-2.6.0-h36134e3_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyyaml-3.12-py36h82f6ce8_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ca-certificates-2017.01.19-h758a649_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/glob2-0.5-py36hcccd8a5_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pycparser-2.17-py36h2510d72_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/conda-verify-2.0.0-py36hb6ee407_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/urllib3-1.21.1-py36hf62cdc1_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/libgcc_linux-64-7.1.0-h98fb546_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/certifi-2017.4.17-py36h91f7e26_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ncurses-6.0-he7fb7a6_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/curl-7.52.1-he4bd48f_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/pyparsing-2.2.0-py36h614a43e_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/ruamel_yaml-0.11.14-py36h2509325_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cffi-1.10.0-py36hd280c6a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/py-1.4.33-py36h884c705_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/sqlite-3.16.2-h1ca8275_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/markupsafe-1.0-py36h9e26fae_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/cython-0.25.2-py36hf2b3963_1.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/packaging-16.8-py36hb3ac33a_0.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/tk-8.6.6-h7240f3b_6.json
TRACE conda.core.linked_data:load_linked_data(34): loading linked data for /tmp/m/conda-meta/git-2.13.2-pl526hfe81c7d_0.json
DEBUG conda.core.index:fetch_index(106): channel_urls=OrderedDict([('https://conda.anaconda.org/c3i_test/linux-64', ('defaults', 0)), ('https://conda.anaconda.org/c3i_test/noarch', ('defaults', 0)), ('https://repo.continuum.io/pkgs/free/linux-64', ('https://repo.continuum.io/pkgs/free', 2)), ('https://repo.continuum.io/pkgs/free/noarch', ('https://repo.continuum.io/pkgs/free', 2)), ('https://repo.continuum.io/pkgs/r/linux-64', ('https://repo.continuum.io/pkgs/r', 3)), ('https://repo.continuum.io/pkgs/r/noarch', ('https://repo.continuum.io/pkgs/r', 3)), ('https://repo.continuum.io/pkgs/pro/linux-64', ('https://repo.continuum.io/pkgs/pro', 4)), ('https://repo.continuum.io/pkgs/pro/noarch', ('https://repo.continuum.io/pkgs/pro', 4))])
Fetching package metadata ...DEBUG urllib3.util.retry:from_int(200): Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
TRACE conda.gateways.disk.test:file_path_is_writable(23): checking path is writable /tmp/m/pkgs/urls.txt
TRACE conda.gateways.disk.test:file_path_is_writable(23): checking path is writable /home/ray/.conda/pkgs/urls.txt
DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://conda.anaconda.org/c3i_test/linux-64 at /tmp/m/pkgs/cache/b416b7b7.json
DEBUG conda.connection:add_binstar_token(144): Adding anaconda token for url <https://conda.anaconda.org/c3i_test/linux-64/repodata.json>
DEBUG urllib3.connectionpool:_new_conn(818): Starting new HTTPS connection (1): conda.anaconda.org
DEBUG urllib3.connectionpool:_make_request(395): https://conda.anaconda.org:443 "GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/linux-64/repodata.json HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/linux-64/repodata.json HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: gzip, deflate, compress, identity
> Connection: keep-alive
> Content-Type: application/json
> If-Modified-Since: Tue, 25 Jul 2017 12:51:26 GMT
<<HTTPS 304 NOT MODIFIED
< CF-RAY: 3846724cedb669f5-LHR
< Date: Wed, 26 Jul 2017 09:49:00 GMT
< Server: cloudflare-nginx
< Set-Cookie: __cfduid=d78c5fd31985d6fb661b882f416ab46421501062540; expires=Thu, 26-Jul-18 09:49:00 GMT; path=/; domain=.anaconda.org; HttpOnly
< Strict-Transport-Security: max-age=31536000
< Connection: keep-alive
< Elapsed: 00:05.558808
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://conda.anaconda.org/c3i_test/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/b416b7b7.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/b416b7b7.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://conda.anaconda.org/c3i_test/noarch at /tmp/m/pkgs/cache/917d14b1.json
DEBUG conda.connection:add_binstar_token(144): Adding anaconda token for url <https://conda.anaconda.org/c3i_test/noarch/repodata.json>
DEBUG urllib3.connectionpool:_make_request(395): https://conda.anaconda.org:443 "GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/noarch/repodata.json HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /t/rd-22f1fd0d-0772-4bfd-b93a-e7159e278b97/c3i_test/noarch/repodata.json HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: gzip, deflate, compress, identity
> Connection: keep-alive
> Content-Type: application/json
> Cookie: __cfduid=d78c5fd31985d6fb661b882f416ab46421501062540
> If-Modified-Since: Tue, 25 Jul 2017 12:51:26 GMT
<<HTTPS 304 NOT MODIFIED
< CF-RAY: 3846724fcef369f5-LHR
< Date: Wed, 26 Jul 2017 09:49:01 GMT
< Server: cloudflare-nginx
< Strict-Transport-Security: max-age=31536000
< Connection: keep-alive
< Elapsed: 00:00.376864
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://conda.anaconda.org/c3i_test/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/917d14b1.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/917d14b1.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/free/linux-64 at /tmp/m/pkgs/cache/db552c1e.json
DEBUG urllib3.connectionpool:_new_conn(818): Starting new HTTPS connection (1): repo.continuum.io
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/free/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/free/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> If-Modified-Since: Tue, 25 Jul 2017 21:38:30 GMT
> If-None-Match: "528db52103850ab1ea421877ce0622b5"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672720cfd1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "528db52103850ab1ea421877ce0622b5"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 21:38:30 GMT
< Server: cloudflare-nginx
< Set-Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546; expires=Thu, 26-Jul-18 09:49:06 GMT; path=/; domain=.continuum.io; HttpOnly
< Vary: Accept-Encoding
< x-amz-id-2: HrQ88aHFkfAQvU3FMBfq3AZmIcGDxTO46nbN5kdQJHaSEWCyo4K+aHvL5gMxOi8qIWJmZF33+L4=
< x-amz-request-id: 6C00A32855FF2A5B
< x-amz-version-id: v88OrIeB9hB3TbY6DI1SeBnNxxjoz8It
< Connection: keep-alive
< Elapsed: 00:05.120355
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/free/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/db552c1e.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/db552c1e.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/free/noarch at /tmp/m/pkgs/cache/9ca791dd.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/free/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/free/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:04:09 GMT
> If-None-Match: "e5e41f3b07a5ae63250ff2c9a1a99f3b"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672733da31377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "e5e41f3b07a5ae63250ff2c9a1a99f3b"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:04:09 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: FDLYjD2Bc7q7L0boRmbiNQDanHzsfgBen/atQMaPbQcb4b2jqe6SWGSqeD+iQnVioaeFV82zbJE=
< x-amz-request-id: 9C3CC975BFDD6619
< x-amz-version-id: 9Zqwri8g_5defKke_hvbGibCznu18KQb
< Connection: keep-alive
< Elapsed: 00:00.018662
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/free/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/9ca791dd.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/9ca791dd.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/r/linux-64 at /tmp/m/pkgs/cache/6bfb14bd.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/r/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/r/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:05:32 GMT
> If-None-Match: "b7bc1b9927fa701bad6c8139397b758c"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672735dbc1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "b7bc1b9927fa701bad6c8139397b758c"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:05:32 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: z+3pUl3L018WMeobXtcBuPaE6jMe0c544bzG5K1C8L8Bo33MR1QmLWjXcsFvnBN0K/uJCViAx6c=
< x-amz-request-id: 630143C21248F89A
< x-amz-version-id: rcxLjX4hLQ82_pOqxYLqW3tjmKKrd8ce
< Connection: keep-alive
< Elapsed: 00:00.032432
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/r/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/6bfb14bd.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/6bfb14bd.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/r/noarch at /tmp/m/pkgs/cache/716b88c0.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/r/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/r/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 31 Jan 2017 05:50:11 GMT
> If-None-Match: "e8c60de6ccbc390c49c0a91035a53c64"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 38467273bdec1377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "e8c60de6ccbc390c49c0a91035a53c64"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 31 Jan 2017 05:50:11 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: LYfFs5RzEnhgAm4xzQx8ehkxG75ZW6bvbqrwfHIWiZ9t4wxc0YWXIYuHyM0vwo39yO+SwmmzA6g=
< x-amz-request-id: 95938D78B0ACA670
< x-amz-version-id: q9tvk8Y4cFZ5bm2fRh8sN6opdl7qs.78
< Connection: keep-alive
< Elapsed: 00:00.019828
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/r/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/716b88c0.json
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/pro/linux-64 at /tmp/m/pkgs/cache/8db5e652.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/pro/linux-64/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/pro/linux-64/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 21:39:45 GMT
> If-None-Match: "041674100c301c307f0b99686bb704fd"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 38467273ee001377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "041674100c301c307f0b99686bb704fd"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 21:39:45 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: 8BOV1Utn0yTEqRCCg7r2+rq/CGaJM4Y9pP3IIbiEFnBqUdXvgPxwhdMFmgJL98QY7E59E+xnGQ8=
< x-amz-request-id: DDBE61B3FC7EF8FF
< x-amz-version-id: O1CUvUpbSVOq9XAXTcktbpj_eoM7XcC2
< Connection: keep-alive
< Elapsed: 00:00.037129
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/pro/linux-64'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/8db5e652.json
DEBUG conda.core.repodata:read_pickled_repodata(339): found pickle file /tmp/m/pkgs/cache/8db5e652.q
.DEBUG conda.core.repodata:fetch_repodata(454): Locally invalidating cached repodata for https://repo.continuum.io/pkgs/pro/noarch at /tmp/m/pkgs/cache/08159f17.json
DEBUG urllib3.connectionpool:_make_request(395): https://repo.continuum.io:443 "GET /pkgs/pro/noarch/repodata.json.bz2 HTTP/1.1" 304 0
DEBUG conda.core.repodata:fetch_repodata_remote_request(140):
>>GET /pkgs/pro/noarch/repodata.json.bz2 HTTPS
> User-Agent: conda/4.3.22 requests/2.18.1 CPython/3.6.2 Linux/2.6.32-696.3.2.el6.x86_64 CentOS/6.9 glibc/2.12
> Accept: */*
> Accept-Encoding: identity
> Connection: keep-alive
> Cookie: __cfduid=d7c56bae468d0992eb9315cb5b744a8431501062546
> If-Modified-Since: Tue, 25 Jul 2017 13:05:32 GMT
> If-None-Match: "a03a8ce02144dee86add4a372c6c86b7"
<<HTTPS 304 Not Modified
< Cache-Control: public, max-age=30
< CF-Cache-Status: HIT
< CF-RAY: 384672742e281377-LHR
< Date: Wed, 26 Jul 2017 09:49:06 GMT
< ETag: "a03a8ce02144dee86add4a372c6c86b7"
< Expires: Wed, 26 Jul 2017 09:49:36 GMT
< Last-Modified: Tue, 25 Jul 2017 13:05:32 GMT
< Server: cloudflare-nginx
< Vary: Accept-Encoding
< x-amz-id-2: maHaUBDzZNM3YTk5Ql5nZrBctDRj3nbHrku0aXFhyjk0+At6uXaeKPfCa3FbxwmfTg0e64sGdVE=
< x-amz-request-id: 77E33E5835086704
< x-amz-version-id: xUxq8fc5dIfxN8yyTTMILlG.G08OZ1vc
< Connection: keep-alive
< Elapsed: 00:00.021581
DEBUG conda.core.repodata:fetch_repodata(462): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/pro/noarch'. Updating mtime and loading from disk
TRACE conda.gateways.disk.update:touch(62): touching path /tmp/m/pkgs/cache/08159f17.json
.
DEBUG conda.plan:add_defaults_to_specs(371): H0 specs=[MatchSpec('conda')]
DEBUG conda.plan:add_defaults_to_specs(386): H2 python True
DEBUG conda.plan:add_defaults_to_specs(402): H3 python
DEBUG conda.plan:add_defaults_to_specs(386): H2 lua False
DEBUG conda.plan:add_defaults_to_specs(391): H2A lua
DEBUG conda.plan:add_defaults_to_specs(417): HF specs=[MatchSpec('conda'), 'python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)']
DEBUG conda.plan:augment_specs(714): Pinned specs=()
DEBUG conda.resolve:install_specs(790): Checking satisfiability of current install
DEBUG conda.resolve:bad_installed(740): Checking if the current environment is consistent
Solving package specifications: DEBUG conda.resolve:solve(845): Solving for [MatchSpec('conda'), MatchSpec('python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)'), MatchSpec('patchelf (target=defaults::patchelf-0.9-h12092aa_2)'), MatchSpec('jinja2 (target=defaults::jinja2-2.9.5-py36hd692eab_0)'), MatchSpec('idna (target=defaults::idna-2.5-py36h317042d_0)'), MatchSpec('libiconv (target=defaults::libiconv-1.14-h79488b8_5)'), MatchSpec('beautifulsoup4 (target=defaults::beautifulsoup4-4.5.3-py36ha3e3e50_0)'), MatchSpec('pkginfo (target=defaults::pkginfo-1.4.1-py36ha36d807_0)'), MatchSpec('openssl (target=defaults::openssl-1.0.2l-h09529b2_0)'), MatchSpec('libstdcxx_linux-64 (target=defaults::libstdcxx_linux-64-7.1.0-hddd74c5_0)'), MatchSpec('requests (target=defaults::requests-2.18.1-py36hfc65a8c_0)'), MatchSpec('libtool (target=defaults::libtool-2.4.6-hee670f0_0)'), MatchSpec('jsonschema (target=defaults::jsonschema-2.6.0-py36h553177d_0)'), MatchSpec('pyopenssl (target=defaults::pyopenssl-16.2.0-py36ha4e8928_0)'), MatchSpec('setuptools (target=defaults::setuptools-33.1.1-py36h9531ec0_0)'), MatchSpec('filelock (target=defaults::filelock-2.0.6-py36hecab0e9_0)'), MatchSpec('perl (target=defaults::perl-5.26.0-had2d7c4_0)'), MatchSpec('wheel (target=defaults::wheel-0.29.0-py36h53b1bae_0)'), MatchSpec('asn1crypto (target=defaults::asn1crypto-0.22.0-py36h1e05746_0)'), MatchSpec('vcversioner (target=defaults::vcversioner-2.16.0.0-py36hd7ef79c_0)'), MatchSpec('pycosat (target=defaults::pycosat-0.6.1-py36hd85b70a_0)'), MatchSpec('libffi (target=defaults::libffi-3.2.1-ha60f83d_3)'), MatchSpec('coverage (target=defaults::coverage-4.4.1-py36he22ce40_0)'), MatchSpec('pkg-config (target=defaults::pkg-config-0.29.2-h3348825_0)'), MatchSpec('conda-build (target=defaults::conda-build-3.0.8-py36h88d0164_0)'), MatchSpec('expat (target=defaults::expat-2.2.1-hb2eb8a5_1)'), MatchSpec('gdbm (target=defaults::gdbm-1.13-h1da15e7_0)'), MatchSpec('zlib (target=defaults::zlib-1.2.11-hcf0e70e_0)'), MatchSpec('six (target=defaults::six-1.10.0-py36h5d5a401_1)'), MatchSpec('pip (target=defaults::pip-9.0.1-py36h3c3718a_0)'), MatchSpec('pytest (target=defaults::pytest-3.1.3-py36hc61c924_0)'), MatchSpec('libgfortran_linux-64 (target=defaults::libgfortran_linux-64-7.1.0-hced3fcd_0)'), MatchSpec('bzip2 (target=defaults::bzip2-1.0.6-h6e5dee2_1)'), MatchSpec('readline (target=defaults::readline-7.0-ha53fe01_1)'), MatchSpec('yaml (target=defaults::yaml-0.1.6-h21378f5_0)'), MatchSpec('cryptography (target=defaults::cryptography-1.8.1-py36h4724394_0)'), MatchSpec('pytest-cov (target=defaults::pytest-cov-2.4.0-py36hd80946c_0)'), MatchSpec('xz (target=defaults::xz-5.2.3-h0585ff0_0)'), MatchSpec('chardet (target=defaults::chardet-3.0.2-py36h98ed7fb_2)'), MatchSpec('pysocks (target=defaults::pysocks-1.6.7-py36he05b2b2_1)'), MatchSpec('m4 (target=defaults::m4-1.4.18-h6a3c4c4_0)'), MatchSpec('automake (target=defaults::automake-1.15.1-pl526h5d1f53f_0)'), MatchSpec('autoconf (target=defaults::autoconf-2.69-pl526ha670186_5)'), MatchSpec('conda-env (target=defaults::conda-env-2.6.0-h36134e3_0)'), MatchSpec('pyyaml (target=defaults::pyyaml-3.12-py36h82f6ce8_1)'), MatchSpec('ca-certificates (target=defaults::ca-certificates-2017.01.19-h758a649_0)'), MatchSpec('glob2 (target=defaults::glob2-0.5-py36hcccd8a5_0)'), MatchSpec('pycparser (target=defaults::pycparser-2.17-py36h2510d72_0)'), MatchSpec('conda-verify (target=defaults::conda-verify-2.0.0-py36hb6ee407_0)'), MatchSpec('urllib3 (target=defaults::urllib3-1.21.1-py36hf62cdc1_1)'), MatchSpec('libgcc_linux-64 (target=defaults::libgcc_linux-64-7.1.0-h98fb546_0)'), MatchSpec('certifi (target=defaults::certifi-2017.4.17-py36h91f7e26_0)'), MatchSpec('ncurses (target=defaults::ncurses-6.0-he7fb7a6_0)'), MatchSpec('curl (target=defaults::curl-7.52.1-he4bd48f_1)'), MatchSpec('pyparsing (target=defaults::pyparsing-2.2.0-py36h614a43e_0)'), MatchSpec('ruamel_yaml (target=defaults::ruamel_yaml-0.11.14-py36h2509325_0)'), MatchSpec('cffi (target=defaults::cffi-1.10.0-py36hd280c6a_0)'), MatchSpec('py (target=defaults::py-1.4.33-py36h884c705_0)'), MatchSpec('sqlite (target=defaults::sqlite-3.16.2-h1ca8275_0)'), MatchSpec('markupsafe (target=defaults::markupsafe-1.0-py36h9e26fae_0)'), MatchSpec('cython (target=defaults::cython-0.25.2-py36hf2b3963_1)'), MatchSpec('packaging (target=defaults::packaging-16.8-py36hb3ac33a_0)'), MatchSpec('tk (target=defaults::tk-8.6.6-h7240f3b_6)'), MatchSpec('git (target=defaults::git-2.13.2-pl526hfe81c7d_0)')]
DEBUG conda.resolve:get_reduced_index(374): Retrieving packages for: [MatchSpec('conda'), MatchSpec('python 3.6* (target=defaults::python-3.6.2-hc1eee60_0)'), MatchSpec('patchelf (target=defaults::patchelf-0.9-h12092aa_2)'), MatchSpec('jinja2 (target=defaults::jinja2-2.9.5-py36hd692eab_0)'), MatchSpec('idna (target=defaults::idna-2.5-py36h317042d_0)'), MatchSpec('libiconv (target=defaults::libiconv-1.14-h79488b8_5)'), MatchSpec('beautifulsoup4 (target=defaults::beautifulsoup4-4.5.3-py36ha3e3e50_0)'), MatchSpec('pkginfo (target=defaults::pkginfo-1.4.1-py36ha36d807_0)'), MatchSpec('openssl (target=defaults::openssl-1.0.2l-h09529b2_0)'), MatchSpec('libstdcxx_linux-64 (target=defaults::libstdcxx_linux-64-7.1.0-hddd74c5_0)'), MatchSpec('requests (target=defaults::requests-2.18.1-py36hfc65a8c_0)'), MatchSpec('libtool (target=defaults::libtool-2.4.6-hee670f0_0)'), MatchSpec('jsonschema (target=defaults::jsonschema-2.6.0-py36h553177d_0)'), MatchSpec('pyopenssl (target=defaults::pyopenssl-16.2.0-py36ha4e8928_0)'), MatchSpec('setuptools (target=defaults::setuptools-33.1.1-py36h9531ec0_0)'), MatchSpec('filelock (target=defaults::filelock-2.0.6-py36hecab0e9_0)'), MatchSpec('perl (target=defaults::perl-5.26.0-had2d7c4_0)'), MatchSpec('wheel (target=defaults::wheel-0.29.0-py36h53b1bae_0)'), MatchSpec('asn1crypto (target=defaults::asn1crypto-0.22.0-py36h1e05746_0)'), MatchSpec('vcversioner (target=defaults::vcversioner-2.16.0.0-py36hd7ef79c_0)'), MatchSpec('pycosat (target=defaults::pycosat-0.6.1-py36hd85b70a_0)'), MatchSpec('libffi (target=defaults::libffi-3.2.1-ha60f83d_3)'), MatchSpec('coverage (target=defaults::coverage-4.4.1-py36he22ce40_0)'), MatchSpec('pkg-config (target=defaults::pkg-config-0.29.2-h3348825_0)'), MatchSpec('conda-build (target=defaults::conda-build-3.0.8-py36h88d0164_0)'), MatchSpec('expat (target=defaults::expat-2.2.1-hb2eb8a5_1)'), MatchSpec('gdbm (target=defaults::gdbm-1.13-h1da15e7_0)'), MatchSpec('zlib (target=defaults::zlib-1.2.11-hcf0e70e_0)'), MatchSpec('six (target=defaults::six-1.10.0-py36h5d5a401_1)'), MatchSpec('pip (target=defaults::pip-9.0.1-py36h3c3718a_0)'), MatchSpec('pytest (target=defaults::pytest-3.1.3-py36hc61c924_0)'), MatchSpec('libgfortran_linux-64 (target=defaults::libgfortran_linux-64-7.1.0-hced3fcd_0)'), MatchSpec('bzip2 (target=defaults::bzip2-1.0.6-h6e5dee2_1)'), MatchSpec('readline (target=defaults::readline-7.0-ha53fe01_1)'), MatchSpec('yaml (target=defaults::yaml-0.1.6-h21378f5_0)'), MatchSpec('cryptography (target=defaults::cryptography-1.8.1-py36h4724394_0)'), MatchSpec('pytest-cov (target=defaults::pytest-cov-2.4.0-py36hd80946c_0)'), MatchSpec('xz (target=defaults::xz-5.2.3-h0585ff0_0)'), MatchSpec('chardet (target=defaults::chardet-3.0.2-py36h98ed7fb_2)'), MatchSpec('pysocks (target=defaults::pysocks-1.6.7-py36he05b2b2_1)'), MatchSpec('m4 (target=defaults::m4-1.4.18-h6a3c4c4_0)'), MatchSpec('automake (target=defaults::automake-1.15.1-pl526h5d1f53f_0)'), MatchSpec('autoconf (target=defaults::autoconf-2.69-pl526ha670186_5)'), MatchSpec('conda-env (target=defaults::conda-env-2.6.0-h36134e3_0)'), MatchSpec('pyyaml (target=defaults::pyyaml-3.12-py36h82f6ce8_1)'), MatchSpec('ca-certificates (target=defaults::ca-certificates-2017.01.19-h758a649_0)'), MatchSpec('glob2 (target=defaults::glob2-0.5-py36hcccd8a5_0)'), MatchSpec('pycparser (target=defaults::pycparser-2.17-py36h2510d72_0)'), MatchSpec('conda-verify (target=defaults::conda-verify-2.0.0-py36hb6ee407_0)'), MatchSpec('urllib3 (target=defaults::urllib3-1.21.1-py36hf62cdc1_1)'), MatchSpec('libgcc_linux-64 (target=defaults::libgcc_linux-64-7.1.0-h98fb546_0)'), MatchSpec('certifi (target=defaults::certifi-2017.4.17-py36h91f7e26_0)'), MatchSpec('ncurses (target=defaults::ncurses-6.0-he7fb7a6_0)'), MatchSpec('curl (target=defaults::curl-7.52.1-he4bd48f_1)'), MatchSpec('pyparsing (target=defaults::pyparsing-2.2.0-py36h614a43e_0)'), MatchSpec('ruamel_yaml (target=defaults::ruamel_yaml-0.11.14-py36h2509325_0)'), MatchSpec('cffi (target=defaults::cffi-1.10.0-py36hd280c6a_0)'), MatchSpec('py (target=defaults::py-1.4.33-py36h884c705_0)'), MatchSpec('sqlite (target=defaults::sqlite-3.16.2-h1ca8275_0)'), MatchSpec('markupsafe (target=defaults::markupsafe-1.0-py36h9e26fae_0)'), MatchSpec('cython (target=defaults::cython-0.25.2-py36hf2b3963_1)'), MatchSpec('packaging (target=defaults::packaging-16.8-py36hb3ac33a_0)'), MatchSpec('tk (target=defaults::tk-8.6.6-h7240f3b_6)'), MatchSpec('git (target=defaults::git-2.13.2-pl526hfe81c7d_0)')]
DEBUG conda.resolve:filter_group(399): python: pruned from 88 -> 87
DEBUG conda.resolve:filter_group(399): python: pruned from 87 -> 63
DEBUG conda.resolve:filter_group(399): six: pruned from 40 -> 21
DEBUG conda.resolve:filter_group(399): cython: pruned from 92 -> 61
DEBUG conda.resolve:filter_group(399): markupsafe: pruned from 15 -> 11
DEBUG conda.resolve:filter_group(399): py: pruned from 60 -> 38
DEBUG conda.resolve:filter_group(399): cffi: pruned from 74 -> 50
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 33 -> 23
DEBUG conda.resolve:filter_group(399): pyparsing: pruned from 21 -> 15
DEBUG conda.resolve:filter_group(399): certifi: pruned from 14 -> 12
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 77 -> 26
DEBUG conda.resolve:filter_group(399): cffi: pruned from 50 -> 25
DEBUG conda.resolve:filter_group(399): idna: pruned from 19 -> 17
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 201 -> 125
DEBUG conda.resolve:filter_group(399): six: pruned from 21 -> 19
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 32 -> 26
DEBUG conda.resolve:filter_group(399): python: pruned from 63 -> 50
DEBUG conda.resolve:filter_group(399): conda-verify: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): pyyaml: pruned from 22 -> 11
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 23 -> 16
DEBUG conda.resolve:filter_group(399): glob2: pruned from 5 -> 4
DEBUG conda.resolve:filter_group(399): conda-env: pruned from 66 -> 28
DEBUG conda.resolve:filter_group(399): chardet: pruned from 19 -> 15
DEBUG conda.resolve:filter_group(399): pytest-cov: pruned from 9 -> 7
DEBUG conda.resolve:filter_group(399): coverage: pruned from 27 -> 20
DEBUG conda.resolve:filter_group(399): pytest: pruned from 89 -> 47
DEBUG conda.resolve:filter_group(399): py: pruned from 38 -> 28
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 26 -> 19
DEBUG conda.resolve:filter_group(399): cffi: pruned from 25 -> 18
DEBUG conda.resolve:filter_group(399): idna: pruned from 17 -> 13
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 125 -> 77
DEBUG conda.resolve:filter_group(399): six: pruned from 19 -> 13
DEBUG conda.resolve:filter_group(399): pip: pruned from 107 -> 45
DEBUG conda.resolve:filter_group(399): conda-build: pruned from 296 -> 174
DEBUG conda.resolve:filter_group(399): conda: pruned from 400 -> 216
DEBUG conda.resolve:filter_group(399): pycosat: pruned from 19 -> 11
DEBUG conda.resolve:filter_group(399): vcversioner: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): asn1crypto: pruned from 7 -> 6
DEBUG conda.resolve:filter_group(399): wheel: pruned from 20 -> 12
DEBUG conda.resolve:filter_group(399): filelock: pruned from 8 -> 6
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 26 -> 18
DEBUG conda.resolve:filter_group(399): jsonschema: pruned from 14 -> 10
DEBUG conda.resolve:filter_group(399): requests: pruned from 112 -> 48
DEBUG conda.resolve:filter_group(399): pkginfo: pruned from 9 -> 7
DEBUG conda.resolve:filter_group(399): beautifulsoup4: pruned from 20 -> 15
DEBUG conda.resolve:filter_group(399): jinja2: pruned from 47 -> 24
DEBUG conda.resolve:filter_group(399): python: pruned from 50 -> 8
DEBUG conda.resolve:filter_group(399): sqlite: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): tk: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): xz: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): conda: pruned from 216 -> 17
DEBUG conda.resolve:filter_group(399): conda-env: pruned from 28 -> 3
DEBUG conda.resolve:filter_group(399): pycosat: pruned from 11 -> 4
DEBUG conda.resolve:filter_group(399): pyopenssl: pruned from 18 -> 4
DEBUG conda.resolve:filter_group(399): cryptography: pruned from 19 -> 5
DEBUG conda.resolve:filter_group(399): cffi: pruned from 18 -> 4
DEBUG conda.resolve:filter_group(399): pycparser: pruned from 16 -> 4
DEBUG conda.resolve:filter_group(399): idna: pruned from 13 -> 5
DEBUG conda.resolve:filter_group(399): setuptools: pruned from 77 -> 4
DEBUG conda.resolve:filter_group(399): six: pruned from 13 -> 3
DEBUG conda.resolve:filter_group(399): requests: pruned from 48 -> 5
DEBUG conda.resolve:filter_group(399): ruamel_yaml: pruned from 12 -> 3
DEBUG conda.resolve:filter_group(399): packaging: pruned from 6 -> 3
DEBUG conda.resolve:filter_group(399): pyparsing: pruned from 15 -> 3
DEBUG conda.resolve:filter_group(399): cython: pruned from 61 -> 4
DEBUG conda.resolve:filter_group(399): markupsafe: pruned from 11 -> 3
DEBUG conda.resolve:filter_group(399): py: pruned from 28 -> 7
DEBUG conda.resolve:filter_group(399): certifi: pruned from 12 -> 3
DEBUG conda.resolve:filter_group(399): urllib3: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): pysocks: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): conda-verify: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): pyyaml: pruned from 11 -> 3
DEBUG conda.resolve:filter_group(399): glob2: pruned from 4 -> 2
DEBUG conda.resolve:filter_group(399): chardet: pruned from 15 -> 7
DEBUG conda.resolve:filter_group(399): pytest-cov: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): coverage: pruned from 20 -> 6
DEBUG conda.resolve:filter_group(399): pytest: pruned from 47 -> 7
DEBUG conda.resolve:filter_group(399): pip: pruned from 45 -> 3
DEBUG conda.resolve:filter_group(399): wheel: pruned from 12 -> 4
DEBUG conda.resolve:filter_group(399): conda-build: pruned from 174 -> 24
DEBUG conda.resolve:filter_group(399): beautifulsoup4: pruned from 15 -> 5
DEBUG conda.resolve:filter_group(399): filelock: pruned from 6 -> 2
DEBUG conda.resolve:filter_group(399): jinja2: pruned from 24 -> 6
DEBUG conda.resolve:filter_group(399): pkginfo: pruned from 7 -> 3
DEBUG conda.resolve:filter_group(399): vcversioner: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): asn1crypto: pruned from 6 -> 4
DEBUG conda.resolve:filter_group(399): jsonschema: pruned from 10 -> 4
.DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(885): Package removal metric: 0
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,15)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2657+15) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final peak objective: 0
DEBUG conda.resolve:solve(890): Initial package version metric: 0
DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(895): Track feature count: 0
DEBUG conda.logic:minimize(485): Empty objective, trivial solution
DEBUG conda.resolve:solve(901): Package feature count: 0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,1)
TRACE conda.logic:LinearBound_(378): Eliminating 1/1 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2672+1) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(905): Initial package build metric: 0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,43)
TRACE conda.logic:LinearBound_(378): Eliminating 63/63 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2673+63) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(910): Dependency update count: 0
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,5)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (2736+190) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(1,5)
TRACE conda.logic:minimize(535): Bisection attempt: (1,3), (2736+57) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(4,5)
TRACE conda.logic:minimize(535): Bisection attempt: (4,4), (2736+47) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(5,5)
TRACE conda.logic:minimize(535): Bisection attempt: (5,5), (2736+39) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(5,5)
DEBUG conda.logic:minimize(557): Final peak objective: 5
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (5,54)
TRACE conda.logic:minimize(535): Bisection attempt: (5,54), (2775+18959) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(5,54)
TRACE conda.logic:minimize(535): Bisection attempt: (5,29), (2775+11237) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(30,54)
TRACE conda.logic:minimize(535): Bisection attempt: (30,42), (2775+16196) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(43,54)
TRACE conda.logic:minimize(535): Bisection attempt: (43,48), (2775+17543) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(49,54)
TRACE conda.logic:minimize(535): Bisection attempt: (49,51), (2775+18020) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(52,54)
TRACE conda.logic:minimize(535): Bisection attempt: (52,53), (2775+18413) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(54,54)
TRACE conda.logic:minimize(535): Bisection attempt: (54,54), (2775+18517) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(54,54)
DEBUG conda.logic:minimize(557): Final sum objective: 54
DEBUG conda.logic:minimize(569): New peak objective: 5
TRACE conda.logic:minimize(504): Beginning peak minimization
TRACE conda.logic:minimize(521): Initial range (0,0)
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (21292+43) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final peak objective: 0
DEBUG conda.resolve:solve(916): Additional package version/build metrics: 54/0
TRACE conda.logic:minimize(507): Beginning sum minimization
TRACE conda.logic:minimize(521): Initial range (0,0)
TRACE conda.logic:LinearBound_(378): Eliminating 10/10 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,-1), (21335+0) clauses
TRACE conda.logic:minimize(539): Bisection failure, new range=(0,0)
TRACE conda.logic:LinearBound_(378): Eliminating 10/10 terms for bound violation
TRACE conda.logic:minimize(535): Bisection attempt: (0,0), (21335+10) clauses
TRACE conda.logic:minimize(548): Bisection success, new range=(0,0)
DEBUG conda.logic:minimize(557): Final sum objective: 0
DEBUG conda.resolve:solve(921): Weak dependency count: 0
DEBUG conda.resolve:solve(926): Looking for alternate solutions
Package plan for installation in environment /tmp/m:
The following packages will be UPDATED:
conda: 4.3.22-py36h274531e_1 --> 4.3.22-py36h656d191_1
```
Here is the URL for the conda packages on c3i_test: https://anaconda.org/c3i_test/conda/files. As you can see, both conda packages involved in this incorrect upgrade are present.
> conda install ${CONDA_PREFIX}/pkgs/conda-4.3.22-py36h274531e_1.tar.bz2
That command is probably problematic in the flow above. Installing an explicit tarball isn't bulletproof. I'm guessing channel information is getting dropped in the process (channel information, obviously, isn't contained within the tarball itself). If channel information is dropped, the channel becomes `<unknown>`, and any other channel will have higher priority.
OK, this is a good clue. I believe that if someone specifies a package cache tarball on the command line, `conda` _tries_ to match it back to its source. It's possible this resolution is not happening properly. @kalefranz I'd recommend checking out that code that attempts to resolve channel information about a tarball.
But I would _also_ like to ask that we do not build workflows of any kind that depend on reaching into the package cache and installing a tarball that is there. Nobody, and that includes us, should be depending on its contents. It's a cache, not a channel.
> What channel is assigned to packages that are pulled from the local channel? What does urls.txt say about them?
urls.txt should record the full `file:///path/to/conda/conda-bld/linux-64/package-1.2.3-45_6.tar.bz2` url, which, when passed as input to the `Channel()` object, will recognize the channel `canonical_name` as being `local`, as long as `file:///path/to/conda/conda-bld` is one of the paths configured/recognized as belonging to conda-build.
python -c "from conda.base.context import context; print(context.conda_build_local_urls)"
> I suspect that it is because conda is finding the older version first in the pkgs folder.
There was one day a week or two in standup where I was warning about being scared we could have problems with conda 4.3 and conda-build 3.0 regarding the hashing scheme and the package cache (I got a lot of funny looks when I said that, so I probably didn't communicate my concerns in the most eloquent way.) It's very likely this is related.
As I understand the situation @msarahan described at the top of the ticket, we have two packages in the package cache with nominally *identical* metadata, and the only difference is the timestamp on the package. Conda hasn't ever had to deal with this situation before, prior to the build string hashing introduced in conda-build 3.
If this is the case, we can certainly fix this for conda 4.4. Fix it thoroughly and completely, in all places where it could crop up and cause ugliness (there are possibly other situations, besides the one we're working through here). I do still have some concerns though that conda 4.3 will never be able to handle the filename hashing completely and correctly (and certainly not any conda versions <= 4.3.23).
@mingwandroid As a test in your current workflow where you're running into your issue, can you (1) find a way to not install explicit tarballs directly, and (2) disable the build string hashing? Let's see if we can at least work on isolating the source of the problem...
I only installed the explicit tarball so I could grep in the extracted index.json file to show you the timestamp values! The problem happens without having ever installed anything from an explicit tarball.
I cannot disable build string hashing. Can you fire up a Linux machine and figure it out there? I don't have time to look into this personally.
It strikes me that this isn't related to the hash string itself, only the fact that there are multiple packages of interest with identical filenames. | 2017-07-26T20:40:39 |
|
conda/conda | 5,764 | conda__conda-5764 | [
"5763"
] | c60a7ab0540fa0ce3856c76c4f00a2fa15343c3a | diff --git a/conda/models/channel.py b/conda/models/channel.py
--- a/conda/models/channel.py
+++ b/conda/models/channel.py
@@ -95,14 +95,14 @@ def _read_channel_configuration(scheme, host, port, path):
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)
- if test_url.startswith(that_test_url):
+ if tokenized_startswith(test_url.split('/'), that_test_url.split('/')):
subname = test_url.replace(that_test_url, '', 1).strip('/')
return (channel.location, join_url(channel.name, subname), scheme,
channel.auth, channel.token)
# Step 5. channel_alias match
ca = context.channel_alias
- if ca.location and test_url.startswith(ca.location):
+ if ca.location and tokenized_startswith(test_url.split('/'), ca.location.split('/')):
name = test_url.replace(ca.location, '', 1).strip('/') or None
return ca.location, name, scheme, ca.auth, ca.token
| 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
@@ -887,3 +887,35 @@ def test_regression_against_unknown_none(self):
assert channel.base_url is None
assert channel.url() == defaults.url()
assert channel.urls() == defaults.urls()
+
+
+class OtherChannelParsingTests(TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ string = dals("""
+ default_channels:
+ - http://test/conda/anaconda
+ channels:
+ - http://test/conda/anaconda-cluster
+ """)
+ reset_context()
+ rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
+ context._set_raw_data(rd)
+ Channel._reset_state()
+
+ cls.platform = context.subdir
+
+ @classmethod
+ def tearDownClass(cls):
+ reset_context()
+
+ def test_channels_with_dashes(self):
+ # regression test for #5763
+ assert context.channels == ('http://test/conda/anaconda-cluster',)
+ channel_urls = prioritize_channels(context.channels)
+ assert channel_urls == odict((
+ ('http://test/conda/anaconda-cluster/%s' % context.subdir, ('http://test/conda/anaconda-cluster', 0)),
+ ('http://test/conda/anaconda-cluster/noarch', ('http://test/conda/anaconda-cluster', 0)),
+ ))
+
diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -191,7 +191,7 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
def test_activate_deactivate(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 8, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 9, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
@@ -208,7 +208,7 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
def test_activate_root_simple(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 8, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 9, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -674,7 +674,7 @@ def test_update_deps_flag_absent(self):
assert package_is_installed(prefix, 'itsdangerous-0.23')
assert package_is_installed(prefix, 'flask')
- @pytest.mark.xfail(datetime.now() < datetime(2017, 8, 1), reason="#5263", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 9, 1), reason="#5263", strict=True)
def test_update_deps_flag_present(self):
with make_temp_env("python=2 itsdangerous=0.23") as prefix:
assert package_is_installed(prefix, 'python-2')
diff --git a/tests/test_export.py b/tests/test_export.py
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -31,7 +31,7 @@ def test_basic(self):
output2, error= run_command(Commands.LIST, prefix2, "-e")
self.assertEqual(output, output2)
- @pytest.mark.xfail(datetime.now() < datetime(2017, 8, 1), reason="Bring back `conda list --export` #3445", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 9, 1), reason="Bring back `conda list --export` #3445", strict=True)
def test_multi_channel_export(self):
"""
When try to import from txt
| Conda mangles channels with hyphens
Update: This is not related to hyphens, only substrings.
Seen on versions: 4.3.21, 4.3.23 (maybe more versions)
Conda mangles channels that are a substring match when using default_channels and channels. The channel name "substring-channels" gets mangled into "substring/-channels". It looks like it happens when there is a substring that matches.
```
default_channels:
- http://test/conda/substring
- http://test/conda/default-channels
channels:
- http://test/conda/substring-channels
- http://test/conda/not_substring-channels
- defaults
```
Here is the output of conda info
```
Current conda install:
platform : linux-64
conda version : 4.3.23
conda is private : False
conda-env version : 4.3.23
conda-build version : 2.1.0
python version : 2.7.13.final.0
requests version : 2.12.4
root environment : /home/ec2-user/miniconda2 (writable)
default environment : /home/ec2-user/miniconda2
envs directories : /home/ec2-user/miniconda2/envs
/home/ec2-user/.conda/envs
package cache : /home/ec2-user/miniconda2/pkgs
/home/ec2-user/.conda/pkgs
channel URLs : http://test/conda/substring/-channels/linux-64 <<<<<<<<<<<<<<====
http://test/conda/substring/-channels/noarch <<<<<<<<<<<<<<====
http://test/conda/not_substring-channels/linux-64
http://test/conda/not_substring-channels/noarch
http://test/conda/substring/linux-64
http://test/conda/substring/noarch
http://test/conda/default-channels/linux-64
http://test/conda/default-channels/noarch
config file : /home/ec2-user/miniconda2/.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.23 requests/2.12.4 CPython/2.7.13 Linux/4.4.11-23.53.amzn1.x86_64 / glibc/2.17
UID:GID : 500:500
```
Also `conda info --unsafe-channels` seems to give weird output. It doesn't expand "defaults".
| I've updated this to say that it is substrings between channels and default_channels that causes this bugs, not hyphens. Here is a complete example. Substrings from default_channels cause problems with "channels".
```
default_channels:
- http://test/conda/substring <<<<< PROBLEM
- http://test/conda/default-channels
- http://test/conda/sub <<<<< PROBLEM
- http://test/conda/sub2 <<<<< Not a problem
- http://test/conda/sub2sub2 <<<<< not a problem
channels:
- http://test/conda/substring-channels
- http://test/conda/not_substring-channels
- http://test/conda/subsub
- defaults
```
It's this bit of logic: https://github.com/conda/conda/blob/master/conda/models/channel.py#L397-L404
I don't know why this does this, but that splits off anything that is a substring and joins it as a separate path component.
```
# 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)
if test_url.startswith(that_test_url):
subname = test_url.replace(that_test_url, '', 1).strip('/')
return (channel.location, join_url(channel.name, subname), scheme,
channel.auth, channel.token)
``` | 2017-08-01T21:22:29 |
conda/conda | 5,814 | conda__conda-5814 | [
"5809"
] | be6ce15e42b9c714e9b15b2de47480dc9dd5ab2e | diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py
--- a/conda_env/cli/main_update.py
+++ b/conda_env/cli/main_update.py
@@ -104,7 +104,7 @@ def execute(args, parser):
for installer_type, specs in env.dependencies.items():
try:
installer = get_installer(installer_type)
- installer.install(prefix, specs, args, env, prune=args.prune)
+ installer.install(prefix, specs, args, env)
except InvalidInstaller:
sys.stderr.write(textwrap.dedent("""
Unable to install package for {0}.
diff --git a/conda_env/installers/conda.py b/conda_env/installers/conda.py
--- a/conda_env/installers/conda.py
+++ b/conda_env/installers/conda.py
@@ -8,7 +8,7 @@
from conda.models.channel import Channel, prioritize_channels
-def install(prefix, specs, args, env, prune=False):
+def install(prefix, specs, args, env, *_, **kwargs):
# TODO: support all various ways this happens
# Including 'nodefaults' in the channels list disables the defaults
new_specs = []
@@ -33,7 +33,7 @@ def install(prefix, specs, args, env, prune=False):
subdirs = IndexedSet(basename(url) for url in _channel_priority_map)
solver = Solver(prefix, channels, subdirs, specs_to_add=specs)
- unlink_link_transaction = solver.solve_for_transaction(prune=prune)
+ unlink_link_transaction = solver.solve_for_transaction(prune=getattr(args, 'prune', False))
pfe = unlink_link_transaction.get_pfe()
pfe.execute()
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
@@ -8,7 +8,7 @@
from conda.exceptions import CondaValueError
-def _pip_install_via_requirements(prefix, specs, args, *_):
+def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs):
"""
Installs the pip dependencies in specs using a temporary pip requirements file.
| _pip_install_via_requirements got an unexpected keyword argument 'prune'
```
{
"command":"/home/travis/miniconda/bin/conda-env update",
"conda_info":{
"GID":2000,
"UID":2000,
"_channels":"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_files":"/home/travis/.condarc",
"_envs_dirs":"/home/travis/miniconda/envs
/home/travis/.conda/envs",
"_pkgs_dirs":"/home/travis/miniconda/pkgs
/home/travis/.conda/pkgs",
"_rtwro":"writable",
"active_prefix":null,
"active_prefix_name":null,
"channels":[
"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"
],
"conda_build_version":"not installed",
"conda_env_version":"4.4.0rc0",
"conda_location":"/home/travis/miniconda/lib/python3.6/site-packages/conda",
"conda_prefix":"/home/travis/miniconda",
"conda_private":false,
"conda_shlvl":-1,
"conda_version":"4.4.0rc0",
"config_files":[
"/home/travis/.condarc"
],
"default_prefix":"/home/travis/miniconda",
"envs":[
],
"envs_dirs":[
"/home/travis/miniconda/envs",
"/home/travis/.conda/envs"
],
"netrc_file":null,
"offline":false,
"pkgs_dirs":[
"/home/travis/miniconda/pkgs",
"/home/travis/.conda/pkgs"
],
"platform":"linux-64",
"python_version":"3.6.1.final.0",
"rc_path":"/home/travis/.condarc",
"requests_version":"2.14.2",
"root_prefix":"/home/travis/miniconda",
"root_writable":true,
"sys_rc_path":"/home/travis/miniconda/.condarc",
"user_agent":"conda/4.4.0rc0 requests/2.14.2 CPython/3.6.1 Linux/4.4.0-83-generic ubuntu/14.04 glibc/2.19",
"user_rc_path":"/home/travis/.condarc"
},
"error":"TypeError(\"_pip_install_via_requirements() got an unexpected keyword argument 'prune'\",)",
"exception_name":"TypeError",
"exception_type":"<class 'TypeError'>",
"traceback":"Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda/exceptions.py\", line 653, in __call__
return func(*args, **kwargs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda_env/cli/main_update.py\", line 107, in execute
installer.install(prefix, specs, args, env, prune=args.prune)
TypeError: _pip_install_via_requirements() got an unexpected keyword argument 'prune'
"
}
```
| 2017-08-14T23:06:58 |
||
conda/conda | 5,815 | conda__conda-5815 | [
"5808"
] | be6ce15e42b9c714e9b15b2de47480dc9dd5ab2e | 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
@@ -265,12 +265,26 @@ def _make_single_record(self, package_filename):
package_tarball_full_path=package_tarball_full_path,
extracted_package_dir=extracted_package_dir,
)
+ return package_cache_record
except (IOError, OSError):
+ # no info/repodata_record.json exists
+ # try reading info/index.json
try:
index_json_record = read_index_json(extracted_package_dir)
except (IOError, OSError):
+ # info/index.json doesn't exist either
+ if isdir(extracted_package_dir) and not isfile(package_tarball_full_path):
+ # We have a directory that looks like a conda package, but without
+ # (1) info/repodata_record.json or info/index.json, and (2) a conda package
+ # tarball, there's not much we can do. We'll just ignore it.
+ return None
+
try:
if self.is_writable:
+ if isdir(extracted_package_dir):
+ # We have a partially unpacked conda package directory. Best thing
+ # to do is remove it and try extracting.
+ rm_rf(extracted_package_dir)
extract_tarball(package_tarball_full_path, extracted_package_dir)
index_json_record = read_index_json(extracted_package_dir)
else:
@@ -294,7 +308,14 @@ def _make_single_record(self, package_filename):
package_tarball_full_path=package_tarball_full_path,
extracted_package_dir=extracted_package_dir,
)
- return package_cache_record
+
+ # write the info/repodata_record.json file so we can short-circuit this next time
+ if self.is_writable:
+ repodata_record = PackageRecord.from_objects(package_cache_record)
+ repodata_record_path = join(extracted_package_dir, 'info', 'repodata_record.json')
+ write_as_json_to_file(repodata_record_path, repodata_record)
+
+ return package_cache_record
@staticmethod
def _dedupe_pkgs_dir_contents(pkgs_dir_contents):
| assertion error when loading package cache
```
{
"command":"D:\\Anaconda3\\Scripts\\conda-script.py install -c anaconda pillow",
"conda_info":{
"_channels":"https://conda.anaconda.org/anaconda/win-64
https://conda.anaconda.org/anaconda/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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_files":"",
"_envs_dirs":"D:\\Anaconda3\\envs
C:\\Users\\username\\AppData\\Local\\conda\\conda\\envs
C:\\Users\\username\\.conda\\envs",
"_pkgs_dirs":"D:\\Anaconda3\\pkgs
C:\\Users\\username\\AppData\\Local\\conda\\conda\\pkgs",
"_rtwro":"writable",
"active_prefix":null,
"active_prefix_name":null,
"channels":[
"https://conda.anaconda.org/anaconda/win-64",
"https://conda.anaconda.org/anaconda/noarch",
"https://repo.continuum.io/pkgs/free/win-64",
"https://repo.continuum.io/pkgs/free/noarch",
"https://repo.continuum.io/pkgs/r/win-64",
"https://repo.continuum.io/pkgs/r/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"
],
"conda_build_version":"3.0.6",
"conda_env_version":"4.4.0rc0",
"conda_location":"D:\\Anaconda3\\lib\\site-packages\\conda",
"conda_prefix":"D:\\Anaconda3",
"conda_private":false,
"conda_shlvl":-1,
"conda_version":"4.4.0rc0",
"config_files":[
],
"default_prefix":"D:\\Anaconda3",
"envs":[
],
"envs_dirs":[
"D:\\Anaconda3\\envs",
"C:\\Users\\username\\AppData\\Local\\conda\\conda\\envs",
"C:\\Users\\username\\.conda\\envs"
],
"is_windows_admin":false,
"netrc_file":null,
"offline":false,
"pkgs_dirs":[
"D:\\Anaconda3\\pkgs",
"C:\\Users\\username\\AppData\\Local\\conda\\conda\\pkgs"
],
"platform":"win-64",
"python_version":"3.5.3.final.0",
"rc_path":"C:\\Users\\username\\.condarc",
"requests_version":"2.14.2",
"root_prefix":"D:\\Anaconda3",
"root_writable":true,
"sys_rc_path":"D:\\Anaconda3\\.condarc",
"user_agent":"conda/4.4.0rc0 requests/2.14.2 CPython/3.5.3 Windows/10 Windows/10.0.15063",
"user_rc_path":"C:\\Users\\username\\.condarc"
},
"error":"AssertionError('D:\\\\Anaconda3\\\\pkgs\\\\numpy-1.10.1-py35_0',)",
"exception_name":"AssertionError",
"exception_type":"<class 'AssertionError'>",
"traceback":"Traceback (most recent call last):
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 262, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\gateways\\disk\\read.py\", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\\\Anaconda3\\\\pkgs\\\\numpy-1.10.1-py35_0\\\\info\\\\repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 270, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\gateways\\disk\\read.py\", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\\\Anaconda3\\\\pkgs\\\\numpy-1.10.1-py35_0\\\\info\\\\index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\exceptions.py\", line 653, in __call__
return func(*args, **kwargs)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\cli\\main.py\", line 136, in _main
exit_code = args.func(args, p)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\cli\\main_install.py\", line 80, in execute
install(args, parser, 'install')
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\cli\\install.py\", line 220, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\cli\\install.py\", line 237, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\link.py\", line 698, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\link.py\", line 681, in make_legacy_action_groups
pfe.prepare()
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 479, in prepare
for prec in self.link_precs)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 479, in <genexpr>
for prec in self.link_precs)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 375, in make_actions_for_record
), None)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 372, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 373, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 208, in _package_cache_records
return self.__package_cache_records or self.load() or self.__package_cache_records
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 88, in load
package_cache_record = self._make_single_record(base_name)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\core\\package_cache.py\", line 274, in _make_single_record
extract_tarball(package_tarball_full_path, extracted_package_dir)
File \"D:\\Anaconda3\\lib\\site-packages\\conda\\gateways\\disk\\create.py\", line 133, in extract_tarball
assert not lexists(destination_directory), destination_directory
AssertionError: D:\\Anaconda3\\pkgs\\numpy-1.10.1-py35_0
"
}
```
| 2017-08-14T23:25:25 |
||
conda/conda | 5,820 | conda__conda-5820 | [
"5790"
] | be6ce15e42b9c714e9b15b2de47480dc9dd5ab2e | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -16,7 +16,7 @@
from .._vendor.auxlib.ish import dals
from ..base.constants import ROOT_ENV_NAME
from ..base.context import context
-from ..common.compat import text_type
+from ..common.compat import text_type, on_win
from ..core.envs_manager import EnvsDirectory
from ..core.index import calculate_channel_urls, get_index
from ..core.solve import Solver
@@ -80,16 +80,39 @@ def clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None):
def print_activate(env_name_or_prefix): # pragma: no cover
if not context.quiet and not context.json:
- message = dals("""
-
- To activate this environment, use
-
- $ conda activate %s
-
- To deactivate an active environment, use
-
- $ conda deactivate
- """) % env_name_or_prefix
+ if 'CONDA_SHLVL' in os.environ or os.path.split(os.environ.get('SHELL', ''))[-1] == 'fish':
+ message = dals("""
+ #
+ # To activate this environment, use
+ #
+ # $ conda activate %s
+ #
+ # To deactivate an active environment, use
+ #
+ # $ conda deactivate
+ """) % env_name_or_prefix
+ elif on_win:
+ message = dals("""
+ #
+ # To activate this environment, use:
+ # > activate %s
+ #
+ # To deactivate an active environment, use:
+ # > deactivate
+ #
+ # * for power-users using bash, you must source
+ #
+ """) % env_name_or_prefix
+ else:
+ message = dals("""
+ #
+ # To activate this environment, use:
+ # > source activate %s
+ #
+ # To deactivate an active environment, use:
+ # > source deactivate
+ #
+ """) % env_name_or_prefix
print(message) # TODO: use logger
| conda 4.4 incorrect activate message
I updated to conda 4.4.0b2 from conda v4.3. I created a new environment and it recommended the following - which I ran and got an error:
To activate this environment, use
$ conda activate anaconda2
To deactivate an active environment, use
$ conda deactivate
0288-csoja:scripts csoja$ conda activate anaconda2
Traceback (most recent call last):
File "/Users/csoja/Desktop/anaconda/lib/python3.5/site-packages/conda/cli/main.py", line 176, in main
raise CommandNotFoundError(argv1)
conda.exceptions.CommandNotFoundError: 'activate is not a conda command.
Did you mean 'source activate'?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/csoja/Desktop/anaconda/bin/conda", line 6, in <module>
sys.exit(conda.cli.main())
File "/Users/csoja/Desktop/anaconda/lib/python3.5/site-packages/conda/cli/main.py", line 178, in main
from ..exceptions import handle_exception
ImportError: cannot import name 'handle_exception'
| Duplicate of #5738
| 2017-08-15T11:25:34 |
|
conda/conda | 5,831 | conda__conda-5831 | [
"5825"
] | 4f623168b74673105f866c35b1d33aa80f6a6bda | diff --git a/conda/cli/common.py b/conda/cli/common.py
--- a/conda/cli/common.py
+++ b/conda/cli/common.py
@@ -8,7 +8,6 @@
from .._vendor.auxlib.ish import dals
from ..base.constants import PREFIX_MAGIC_FILE, ROOT_ENV_NAME
from ..base.context import context
-from ..common.compat import itervalues
from ..models.match_spec import MatchSpec
@@ -165,19 +164,6 @@ def stdout_json(d):
def stdout_json_success(success=True, **kwargs):
result = {'success': success}
-
- # this code reverts json output for plan back to previous behavior
- # relied on by Anaconda Navigator and nb_conda
- unlink_link_transaction = kwargs.pop('unlink_link_transaction', None)
- if unlink_link_transaction:
- from .._vendor.toolz.itertoolz import concat
- actions = kwargs.setdefault('actions', {})
- actions['LINK'] = tuple(d.dist_str() for d in concat(
- stp.link_precs for stp in itervalues(unlink_link_transaction.prefix_setups)
- ))
- actions['UNLINK'] = tuple(d.dist_str() for d in concat(
- stp.unlink_precs for stp in itervalues(unlink_link_transaction.prefix_setups)
- ))
result.update(kwargs)
stdout_json(result)
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -261,8 +261,8 @@ def handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args,
common.confirm_yn()
elif context.dry_run:
- common.stdout_json_success(unlink_link_transaction=unlink_link_transaction, prefix=prefix,
- dry_run=True)
+ actions = unlink_link_transaction.make_legacy_action_groups(progressive_fetch_extract)[0]
+ common.stdout_json_success(prefix=prefix, actions=actions, dry_run=True)
raise DryRunExit()
try:
@@ -279,4 +279,4 @@ def handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args,
if context.json:
actions = unlink_link_transaction.make_legacy_action_groups(progressive_fetch_extract)[0]
- common.stdout_json_success(actions=actions)
+ common.stdout_json_success(prefix=prefix, actions=actions)
diff --git a/conda/core/link.py b/conda/core/link.py
--- a/conda/core/link.py
+++ b/conda/core/link.py
@@ -672,6 +672,8 @@ def make_link_actions(transaction_context, package_info, target_prefix, requeste
))
def make_legacy_action_groups(self, pfe):
+ # this code reverts json output for plan back to previous behavior
+ # relied on by Anaconda Navigator and nb_conda
from ..models.dist import Dist
legacy_action_groups = []
@@ -684,9 +686,9 @@ def make_legacy_action_groups(self, pfe):
actions['PREFIX'] = setup.target_prefix
for prec in setup.unlink_precs:
- actions['UNLINK'].append(prec)
+ actions['UNLINK'].append(Dist(prec))
for prec in setup.link_precs:
- actions['LINK'].append(prec)
+ actions['LINK'].append(Dist(prec))
legacy_action_groups.append(actions)
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -374,9 +374,22 @@ def assert_json_parsable(content):
try:
prefix = make_temp_prefix(str(uuid4())[:7])
+ stdout, stderr = run_command(Commands.CREATE, prefix, "python=3.5 --json --dry-run", use_exception_handler=True)
+ assert_json_parsable(stdout)
+ assert not stderr
+
+ # regression test for #5825
+ # contents of LINK and UNLINK is expected to have Dist format
+ json_obj = json.loads(stdout)
+ dist_dump = json_obj['actions']['LINK'][0]
+ assert 'dist_name' in dist_dump
+
stdout, stderr = run_command(Commands.CREATE, prefix, "python=3.5 --json")
assert_json_parsable(stdout)
assert not stderr
+ json_obj = json.loads(stdout)
+ dist_dump = json_obj['actions']['LINK'][0]
+ assert 'dist_name' in dist_dump
stdout, stderr = run_command(Commands.INSTALL, prefix, 'flask=0.10 --json')
assert_json_parsable(stdout)
@@ -404,6 +417,12 @@ def assert_json_parsable(content):
assert not package_is_installed(prefix, 'flask-0.')
assert_package_is_installed(prefix, 'python-3')
+ # regression test for #5825
+ # contents of LINK and UNLINK is expected to have Dist format
+ json_obj = json.loads(stdout)
+ dist_dump = json_obj['actions']['UNLINK'][0]
+ assert 'dist_name' in dist_dump
+
stdout, stderr = run_command(Commands.LIST, prefix, '--revisions --json')
assert not stderr
json_obj = json.loads(stdout)
@@ -1037,8 +1056,9 @@ def test_create_dry_run_json(self):
stdout, stderr = run_command(Commands.CREATE, prefix, "flask", "--dry-run", "--json", use_exception_handler=True)
loaded = json.loads(stdout)
- assert "python" in "\n".join(loaded['actions']['LINK'])
- assert "flask" in "\n".join(loaded['actions']['LINK'])
+ names = set(d['name'] for d in loaded['actions']['LINK'])
+ assert "python" in names
+ assert "flask" in names
def test_packages_not_found(self):
with make_temp_env() as prefix:
| Conda 4.4 --json --dry-run returns a different format
Could be a feature... or a bug. These breaking changes should probably be reserved for major versions? So Bug it is :-p
## Conda 4.4
```
$ conda install rstudio --dry-run --json
{
"actions": {
"LINK": [
"defaults::font-ttf-dejavu-sans-mono-2.37-0",
"defaults::font-ttf-inconsolata-2.000-0",
"defaults::font-ttf-source-code-pro-2.030-0",
"defaults::font-ttf-ubuntu-0.83-0",
"defaults::krb5-1.13.2-0",
"defaults::libffi-3.2.1-1",
"defaults::libgcc-4.8.5-1",
"defaults::ncurses-5.9-10",
"defaults::pixman-0.34.0-0",
"defaults::zeromq-4.1.3-0",
"defaults::fonts-continuum-1-0",
"defaults::gettext-0.19.8-1",
"defaults::gsl-2.2.1-0",
"defaults::libssh2-1.8.0-0",
"defaults::pandoc-1.19.2.1-0",
"defaults::pcre-8.39-1",
"defaults::curl-7.54.1-0",
"defaults::glib-2.50.2-1",
"defaults::fontconfig-2.12.1-3",
"defaults::cairo-1.14.8-0",
"defaults::harfbuzz-0.9.39-2",
"defaults::pango-1.40.3-1",
"defaults::r-base-3.4.1-0",
"defaults::r-assertthat-0.2.0-r3.4.1_0",
"defaults::r-backports-1.1.0-r3.4.1_0",
"defaults::r-base64enc-0.1_3-r3.4.1_0",
"defaults::r-bh-1.62.0_1-r3.4.1_0",
"defaults::r-bindr-0.1-r3.4.1_0",
"defaults::r-bitops-1.0_6-r3.4.1_2",
"defaults::r-boot-1.3_19-r3.4.1_0",
"defaults::r-cluster-2.0.6-r3.4.1_0",
"defaults::r-codetools-0.2_15-r3.4.1_0",
"defaults::r-colorspace-1.3_2-r3.4.1_0",
"defaults::r-crayon-1.3.2-r3.4.1_0",
"defaults::r-curl-2.6-r3.4.1_0",
"defaults::r-data.table-1.10.4-r3.4.1_0",
"defaults::r-dbi-0.6_1-r3.4.1_0",
"defaults::r-dichromat-2.0_0-r3.4.1_2",
"defaults::r-digest-0.6.12-r3.4.1_0",
"defaults::r-foreign-0.8_68-r3.4.1_0",
"defaults::r-formatr-1.5-r3.4.1_0",
"defaults::r-glue-1.1.1-r3.4.1_0",
"defaults::r-gtable-0.2.0-r3.4.1_0",
"defaults::r-highr-0.6-r3.4.1_0",
"defaults::r-hms-0.3-r3.4.1_0",
"defaults::r-iterators-1.0.8-r3.4.1_0",
"defaults::r-jsonlite-1.5-r3.4.1_0",
"defaults::r-kernsmooth-2.23_15-r3.4.1_0",
"defaults::r-labeling-0.3-r3.4.1_2",
"defaults::r-lattice-0.20_35-r3.4.1_0",
"defaults::r-lazyeval-0.2.0-r3.4.1_0",
"defaults::r-magrittr-1.5-r3.4.1_2",
"defaults::r-maps-3.2.0-r3.4.1_0",
"defaults::r-mass-7.3_47-r3.4.1_0",
"defaults::r-mime-0.5-r3.4.1_0",
"defaults::r-mnormt-1.5_5-r3.4.1_0",
"defaults::r-nloptr-1.0.4-r3.4.1_2",
"defaults::r-nnet-7.3_12-r3.4.1_0",
"defaults::r-openssl-0.9.6-r3.4.1_0",
"defaults::r-packrat-0.4.8_1-r3.4.1_0",
"defaults::r-pkgconfig-2.0.1-r3.4.1_0",
"defaults::r-plogr-0.1_1-r3.4.1_0",
"defaults::r-r6-2.2.1-r3.4.1_0",
"defaults::r-randomforest-4.6_12-r3.4.1_0",
"defaults::r-rcolorbrewer-1.1_2-r3.4.1_3",
"defaults::r-rcpp-0.12.11-r3.4.1_0",
"defaults::r-rematch-1.0.1-r3.4.1_0",
"defaults::r-repr-0.10-r3.4.1_0",
"defaults::r-rjsonio-1.3_0-r3.4.1_2",
"defaults::r-rlang-0.1.1-r3.4.1_0",
"defaults::r-rpart-4.1_11-r3.4.1_0",
"defaults::r-rstudioapi-0.6-r3.4.1_0",
"defaults::r-sourcetools-0.1.6-r3.4.1_0",
"defaults::r-sparsem-1.77-r3.4.1_0",
"defaults::r-spatial-7.3_11-r3.4.1_0",
"defaults::r-stringi-1.1.5-r3.4.1_0",
"defaults::r-uuid-0.1_2-r3.4.1_0",
"defaults::r-xtable-1.8_2-r3.4.1_0",
"defaults::r-yaml-2.1.14-r3.4.1_0",
"defaults::r-bindrcpp-0.2-r3.4.1_0",
"defaults::r-catools-1.17.1-r3.4.1_2",
"defaults::r-class-7.3_14-r3.4.1_0",
"defaults::r-foreach-1.4.3-r3.4.1_0",
"defaults::r-hexbin-1.27.1-r3.4.1_0",
"defaults::r-htmltools-0.3.6-r3.4.1_0",
"defaults::r-httpuv-1.3.3-r3.4.1_0",
"defaults::r-httr-1.2.1-r3.4.1_0",
"defaults::r-irdisplay-0.4.4-r3.4.1_0",
"defaults::r-markdown-0.8-r3.4.1_0",
"defaults::r-matrix-1.2_10-r3.4.1_0",
"defaults::r-minqa-1.2.4-r3.4.1_2",
"defaults::r-modelmetrics-1.1.0-r3.4.1_0",
"defaults::r-munsell-0.4.3-r3.4.1_0",
"defaults::r-nlme-3.1_131-r3.4.1_0",
"defaults::r-pbdzmq-0.2_6-r3.4.1_0",
"defaults::r-pki-0.1_3-r3.4.1_0",
"defaults::r-plyr-1.8.4-r3.4.1_0",
"defaults::r-rcurl-1.95_4.8-r3.4.1_0",
"defaults::r-rprojroot-1.2-r3.4.1_0",
"defaults::r-stringr-1.2.0-r3.4.1_0",
"defaults::r-tibble-1.3.3-r3.4.1_0",
"defaults::r-xml2-1.1.1-r3.4.1_0",
"defaults::r-zoo-1.8_0-r3.4.1_0",
"defaults::r-cellranger-1.1.0-r3.4.1_0",
"defaults::r-dplyr-0.7.0-r3.4.1_0",
"defaults::r-evaluate-0.10-r3.4.1_0",
"defaults::r-forcats-0.2.0-r3.4.1_0",
"defaults::r-glmnet-2.0_10-r3.4.1_0",
"defaults::r-htmlwidgets-0.8-r3.4.1_1",
"defaults::r-lubridate-1.6.0-r3.4.1_0",
"defaults::r-matrixmodels-0.4_1-r3.4.1_0",
"defaults::r-mgcv-1.8_17-r3.4.1_0",
"defaults::r-pryr-0.1.2-r3.4.1_0",
"defaults::r-psych-1.7.5-r3.4.1_0",
"defaults::r-purrr-0.2.2.2-r3.4.1_0",
"defaults::r-rcppeigen-0.3.3.3.0-r3.4.1_0",
"defaults::r-readr-1.1.1-r3.4.1_0",
"defaults::r-reshape2-1.4.2-r3.4.1_0",
"defaults::r-rsconnect-0.8-r3.4.1_0",
"defaults::r-scales-0.4.1-r3.4.1_0",
"defaults::r-selectr-0.3_1-r3.4.1_0",
"defaults::r-shiny-1.0.3-r3.4.1_0",
"defaults::r-survival-2.41_3-r3.4.1_0",
"defaults::r-xts-0.9_7-r3.4.1_2",
"defaults::r-ggplot2-2.2.1-r3.4.1_0",
"defaults::r-haven-1.0.0-r3.4.1_0",
"defaults::r-irkernel-0.7.1-r3.4.1_0",
"defaults::r-knitr-1.16-r3.4.1_0",
"defaults::r-lme4-1.1_13-r3.4.1_0",
"defaults::r-quantreg-5.33-r3.4.1_0",
"defaults::r-readxl-1.0.0-r3.4.1_0",
"defaults::r-recommended-3.4.1-r3.4.1_0",
"defaults::r-rvest-0.3.2-r3.4.1_0",
"defaults::r-tidyr-0.6.3-r3.4.1_0",
"defaults::r-ttr-0.23_1-r3.4.1_0",
"defaults::r-broom-0.4.2-r3.4.1_0",
"defaults::r-pbkrtest-0.4_7-r3.4.1_0",
"defaults::r-quantmod-0.4_9-r3.4.1_0",
"defaults::r-rmarkdown-1.5-r3.4.1_0",
"defaults::r-car-2.1_4-r3.4.1_0",
"defaults::r-gistr-0.4.0-r3.4.1_0",
"defaults::r-modelr-0.1.0-r3.4.1_0",
"defaults::r-caret-6.0_76-r3.4.1_0",
"defaults::r-rbokeh-0.5.0-r3.4.1_0",
"defaults::r-tidyverse-1.1.1-r3.4.1_0",
"defaults::r-essentials-1.6.0-r3.4.1_0",
"defaults::rstudio-1.0.153-1"
],
"UNLINK": []
},
"dry_run": true,
"prefix": "/Users/gpena-castellanos/anaconda/envs/py36",
"success": true
}
```
## Conda 4.3
```
$ conda install rstudio --dry-run --json
{
"actions": [
{
"LINK": [
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "font-ttf-dejavu-sans-mono-2.37-0",
"name": "font-ttf-dejavu-sans-mono",
"platform": null,
"version": "2.37",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "font-ttf-inconsolata-2.000-0",
"name": "font-ttf-inconsolata",
"platform": null,
"version": "2.000",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "font-ttf-source-code-pro-2.030-0",
"name": "font-ttf-source-code-pro",
"platform": null,
"version": "2.030",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "font-ttf-ubuntu-0.83-0",
"name": "font-ttf-ubuntu",
"platform": null,
"version": "0.83",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "krb5-1.13.2-0",
"name": "krb5",
"platform": null,
"version": "1.13.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "libffi-3.2.1-1",
"name": "libffi",
"platform": null,
"version": "3.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "libgcc-4.8.5-1",
"name": "libgcc",
"platform": null,
"version": "4.8.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 10,
"build_string": "10",
"channel": "defaults",
"dist_name": "ncurses-5.9-10",
"name": "ncurses",
"platform": null,
"version": "5.9",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "pixman-0.34.0-0",
"name": "pixman",
"platform": null,
"version": "0.34.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "zeromq-4.1.3-0",
"name": "zeromq",
"platform": null,
"version": "4.1.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "fonts-continuum-1-0",
"name": "fonts-continuum",
"platform": null,
"version": "1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "gettext-0.19.8-1",
"name": "gettext",
"platform": null,
"version": "0.19.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "gsl-2.2.1-0",
"name": "gsl",
"platform": null,
"version": "2.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "libssh2-1.8.0-0",
"name": "libssh2",
"platform": null,
"version": "1.8.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "pandoc-1.19.2.1-0",
"name": "pandoc",
"platform": null,
"version": "1.19.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "pcre-8.39-1",
"name": "pcre",
"platform": null,
"version": "8.39",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "curl-7.54.1-0",
"name": "curl",
"platform": null,
"version": "7.54.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "glib-2.50.2-1",
"name": "glib",
"platform": null,
"version": "2.50.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 3,
"build_string": "3",
"channel": "defaults",
"dist_name": "fontconfig-2.12.1-3",
"name": "fontconfig",
"platform": null,
"version": "2.12.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "cairo-1.14.8-0",
"name": "cairo",
"platform": null,
"version": "1.14.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "2",
"channel": "defaults",
"dist_name": "harfbuzz-0.9.39-2",
"name": "harfbuzz",
"platform": null,
"version": "0.9.39",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "pango-1.40.3-1",
"name": "pango",
"platform": null,
"version": "1.40.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "0",
"channel": "defaults",
"dist_name": "r-base-3.4.1-0",
"name": "r-base",
"platform": null,
"version": "3.4.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-assertthat-0.2.0-r3.4.1_0",
"name": "r-assertthat",
"platform": null,
"version": "0.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-backports-1.1.0-r3.4.1_0",
"name": "r-backports",
"platform": null,
"version": "1.1.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-base64enc-0.1_3-r3.4.1_0",
"name": "r-base64enc",
"platform": null,
"version": "0.1_3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-bh-1.62.0_1-r3.4.1_0",
"name": "r-bh",
"platform": null,
"version": "1.62.0_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-bindr-0.1-r3.4.1_0",
"name": "r-bindr",
"platform": null,
"version": "0.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-bitops-1.0_6-r3.4.1_2",
"name": "r-bitops",
"platform": null,
"version": "1.0_6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-boot-1.3_19-r3.4.1_0",
"name": "r-boot",
"platform": null,
"version": "1.3_19",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-cluster-2.0.6-r3.4.1_0",
"name": "r-cluster",
"platform": null,
"version": "2.0.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-codetools-0.2_15-r3.4.1_0",
"name": "r-codetools",
"platform": null,
"version": "0.2_15",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-colorspace-1.3_2-r3.4.1_0",
"name": "r-colorspace",
"platform": null,
"version": "1.3_2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-crayon-1.3.2-r3.4.1_0",
"name": "r-crayon",
"platform": null,
"version": "1.3.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-curl-2.6-r3.4.1_0",
"name": "r-curl",
"platform": null,
"version": "2.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-data.table-1.10.4-r3.4.1_0",
"name": "r-data.table",
"platform": null,
"version": "1.10.4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-dbi-0.6_1-r3.4.1_0",
"name": "r-dbi",
"platform": null,
"version": "0.6_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-dichromat-2.0_0-r3.4.1_2",
"name": "r-dichromat",
"platform": null,
"version": "2.0_0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-digest-0.6.12-r3.4.1_0",
"name": "r-digest",
"platform": null,
"version": "0.6.12",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-foreign-0.8_68-r3.4.1_0",
"name": "r-foreign",
"platform": null,
"version": "0.8_68",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-formatr-1.5-r3.4.1_0",
"name": "r-formatr",
"platform": null,
"version": "1.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-glue-1.1.1-r3.4.1_0",
"name": "r-glue",
"platform": null,
"version": "1.1.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-gtable-0.2.0-r3.4.1_0",
"name": "r-gtable",
"platform": null,
"version": "0.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-highr-0.6-r3.4.1_0",
"name": "r-highr",
"platform": null,
"version": "0.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-hms-0.3-r3.4.1_0",
"name": "r-hms",
"platform": null,
"version": "0.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-iterators-1.0.8-r3.4.1_0",
"name": "r-iterators",
"platform": null,
"version": "1.0.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-jsonlite-1.5-r3.4.1_0",
"name": "r-jsonlite",
"platform": null,
"version": "1.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-kernsmooth-2.23_15-r3.4.1_0",
"name": "r-kernsmooth",
"platform": null,
"version": "2.23_15",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-labeling-0.3-r3.4.1_2",
"name": "r-labeling",
"platform": null,
"version": "0.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-lattice-0.20_35-r3.4.1_0",
"name": "r-lattice",
"platform": null,
"version": "0.20_35",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-lazyeval-0.2.0-r3.4.1_0",
"name": "r-lazyeval",
"platform": null,
"version": "0.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-magrittr-1.5-r3.4.1_2",
"name": "r-magrittr",
"platform": null,
"version": "1.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-maps-3.2.0-r3.4.1_0",
"name": "r-maps",
"platform": null,
"version": "3.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-mass-7.3_47-r3.4.1_0",
"name": "r-mass",
"platform": null,
"version": "7.3_47",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-mime-0.5-r3.4.1_0",
"name": "r-mime",
"platform": null,
"version": "0.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-mnormt-1.5_5-r3.4.1_0",
"name": "r-mnormt",
"platform": null,
"version": "1.5_5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-nloptr-1.0.4-r3.4.1_2",
"name": "r-nloptr",
"platform": null,
"version": "1.0.4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-nnet-7.3_12-r3.4.1_0",
"name": "r-nnet",
"platform": null,
"version": "7.3_12",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-openssl-0.9.6-r3.4.1_0",
"name": "r-openssl",
"platform": null,
"version": "0.9.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-packrat-0.4.8_1-r3.4.1_0",
"name": "r-packrat",
"platform": null,
"version": "0.4.8_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-pkgconfig-2.0.1-r3.4.1_0",
"name": "r-pkgconfig",
"platform": null,
"version": "2.0.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-plogr-0.1_1-r3.4.1_0",
"name": "r-plogr",
"platform": null,
"version": "0.1_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-r6-2.2.1-r3.4.1_0",
"name": "r-r6",
"platform": null,
"version": "2.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-randomforest-4.6_12-r3.4.1_0",
"name": "r-randomforest",
"platform": null,
"version": "4.6_12",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 3,
"build_string": "r3.4.1_3",
"channel": "defaults",
"dist_name": "r-rcolorbrewer-1.1_2-r3.4.1_3",
"name": "r-rcolorbrewer",
"platform": null,
"version": "1.1_2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rcpp-0.12.11-r3.4.1_0",
"name": "r-rcpp",
"platform": null,
"version": "0.12.11",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rematch-1.0.1-r3.4.1_0",
"name": "r-rematch",
"platform": null,
"version": "1.0.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-repr-0.10-r3.4.1_0",
"name": "r-repr",
"platform": null,
"version": "0.10",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-rjsonio-1.3_0-r3.4.1_2",
"name": "r-rjsonio",
"platform": null,
"version": "1.3_0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rlang-0.1.1-r3.4.1_0",
"name": "r-rlang",
"platform": null,
"version": "0.1.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rpart-4.1_11-r3.4.1_0",
"name": "r-rpart",
"platform": null,
"version": "4.1_11",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rstudioapi-0.6-r3.4.1_0",
"name": "r-rstudioapi",
"platform": null,
"version": "0.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-sourcetools-0.1.6-r3.4.1_0",
"name": "r-sourcetools",
"platform": null,
"version": "0.1.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-sparsem-1.77-r3.4.1_0",
"name": "r-sparsem",
"platform": null,
"version": "1.77",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-spatial-7.3_11-r3.4.1_0",
"name": "r-spatial",
"platform": null,
"version": "7.3_11",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-stringi-1.1.5-r3.4.1_0",
"name": "r-stringi",
"platform": null,
"version": "1.1.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-uuid-0.1_2-r3.4.1_0",
"name": "r-uuid",
"platform": null,
"version": "0.1_2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-xtable-1.8_2-r3.4.1_0",
"name": "r-xtable",
"platform": null,
"version": "1.8_2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-yaml-2.1.14-r3.4.1_0",
"name": "r-yaml",
"platform": null,
"version": "2.1.14",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-bindrcpp-0.2-r3.4.1_0",
"name": "r-bindrcpp",
"platform": null,
"version": "0.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-catools-1.17.1-r3.4.1_2",
"name": "r-catools",
"platform": null,
"version": "1.17.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-class-7.3_14-r3.4.1_0",
"name": "r-class",
"platform": null,
"version": "7.3_14",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-foreach-1.4.3-r3.4.1_0",
"name": "r-foreach",
"platform": null,
"version": "1.4.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-hexbin-1.27.1-r3.4.1_0",
"name": "r-hexbin",
"platform": null,
"version": "1.27.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-htmltools-0.3.6-r3.4.1_0",
"name": "r-htmltools",
"platform": null,
"version": "0.3.6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-httpuv-1.3.3-r3.4.1_0",
"name": "r-httpuv",
"platform": null,
"version": "1.3.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-httr-1.2.1-r3.4.1_0",
"name": "r-httr",
"platform": null,
"version": "1.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-irdisplay-0.4.4-r3.4.1_0",
"name": "r-irdisplay",
"platform": null,
"version": "0.4.4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-markdown-0.8-r3.4.1_0",
"name": "r-markdown",
"platform": null,
"version": "0.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-matrix-1.2_10-r3.4.1_0",
"name": "r-matrix",
"platform": null,
"version": "1.2_10",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-minqa-1.2.4-r3.4.1_2",
"name": "r-minqa",
"platform": null,
"version": "1.2.4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-modelmetrics-1.1.0-r3.4.1_0",
"name": "r-modelmetrics",
"platform": null,
"version": "1.1.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-munsell-0.4.3-r3.4.1_0",
"name": "r-munsell",
"platform": null,
"version": "0.4.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-nlme-3.1_131-r3.4.1_0",
"name": "r-nlme",
"platform": null,
"version": "3.1_131",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-pbdzmq-0.2_6-r3.4.1_0",
"name": "r-pbdzmq",
"platform": null,
"version": "0.2_6",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-pki-0.1_3-r3.4.1_0",
"name": "r-pki",
"platform": null,
"version": "0.1_3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-plyr-1.8.4-r3.4.1_0",
"name": "r-plyr",
"platform": null,
"version": "1.8.4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rcurl-1.95_4.8-r3.4.1_0",
"name": "r-rcurl",
"platform": null,
"version": "1.95_4.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rprojroot-1.2-r3.4.1_0",
"name": "r-rprojroot",
"platform": null,
"version": "1.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-stringr-1.2.0-r3.4.1_0",
"name": "r-stringr",
"platform": null,
"version": "1.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-tibble-1.3.3-r3.4.1_0",
"name": "r-tibble",
"platform": null,
"version": "1.3.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-xml2-1.1.1-r3.4.1_0",
"name": "r-xml2",
"platform": null,
"version": "1.1.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-zoo-1.8_0-r3.4.1_0",
"name": "r-zoo",
"platform": null,
"version": "1.8_0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-cellranger-1.1.0-r3.4.1_0",
"name": "r-cellranger",
"platform": null,
"version": "1.1.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-dplyr-0.7.0-r3.4.1_0",
"name": "r-dplyr",
"platform": null,
"version": "0.7.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-evaluate-0.10-r3.4.1_0",
"name": "r-evaluate",
"platform": null,
"version": "0.10",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-forcats-0.2.0-r3.4.1_0",
"name": "r-forcats",
"platform": null,
"version": "0.2.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-glmnet-2.0_10-r3.4.1_0",
"name": "r-glmnet",
"platform": null,
"version": "2.0_10",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "r3.4.1_1",
"channel": "defaults",
"dist_name": "r-htmlwidgets-0.8-r3.4.1_1",
"name": "r-htmlwidgets",
"platform": null,
"version": "0.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-lubridate-1.6.0-r3.4.1_0",
"name": "r-lubridate",
"platform": null,
"version": "1.6.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-matrixmodels-0.4_1-r3.4.1_0",
"name": "r-matrixmodels",
"platform": null,
"version": "0.4_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-mgcv-1.8_17-r3.4.1_0",
"name": "r-mgcv",
"platform": null,
"version": "1.8_17",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-pryr-0.1.2-r3.4.1_0",
"name": "r-pryr",
"platform": null,
"version": "0.1.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-psych-1.7.5-r3.4.1_0",
"name": "r-psych",
"platform": null,
"version": "1.7.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-purrr-0.2.2.2-r3.4.1_0",
"name": "r-purrr",
"platform": null,
"version": "0.2.2.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rcppeigen-0.3.3.3.0-r3.4.1_0",
"name": "r-rcppeigen",
"platform": null,
"version": "0.3.3.3.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-readr-1.1.1-r3.4.1_0",
"name": "r-readr",
"platform": null,
"version": "1.1.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-reshape2-1.4.2-r3.4.1_0",
"name": "r-reshape2",
"platform": null,
"version": "1.4.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rsconnect-0.8-r3.4.1_0",
"name": "r-rsconnect",
"platform": null,
"version": "0.8",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-scales-0.4.1-r3.4.1_0",
"name": "r-scales",
"platform": null,
"version": "0.4.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-selectr-0.3_1-r3.4.1_0",
"name": "r-selectr",
"platform": null,
"version": "0.3_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-shiny-1.0.3-r3.4.1_0",
"name": "r-shiny",
"platform": null,
"version": "1.0.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-survival-2.41_3-r3.4.1_0",
"name": "r-survival",
"platform": null,
"version": "2.41_3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 2,
"build_string": "r3.4.1_2",
"channel": "defaults",
"dist_name": "r-xts-0.9_7-r3.4.1_2",
"name": "r-xts",
"platform": null,
"version": "0.9_7",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-ggplot2-2.2.1-r3.4.1_0",
"name": "r-ggplot2",
"platform": null,
"version": "2.2.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-haven-1.0.0-r3.4.1_0",
"name": "r-haven",
"platform": null,
"version": "1.0.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-irkernel-0.7.1-r3.4.1_0",
"name": "r-irkernel",
"platform": null,
"version": "0.7.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-knitr-1.16-r3.4.1_0",
"name": "r-knitr",
"platform": null,
"version": "1.16",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-lme4-1.1_13-r3.4.1_0",
"name": "r-lme4",
"platform": null,
"version": "1.1_13",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-quantreg-5.33-r3.4.1_0",
"name": "r-quantreg",
"platform": null,
"version": "5.33",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-readxl-1.0.0-r3.4.1_0",
"name": "r-readxl",
"platform": null,
"version": "1.0.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-recommended-3.4.1-r3.4.1_0",
"name": "r-recommended",
"platform": null,
"version": "3.4.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rvest-0.3.2-r3.4.1_0",
"name": "r-rvest",
"platform": null,
"version": "0.3.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-tidyr-0.6.3-r3.4.1_0",
"name": "r-tidyr",
"platform": null,
"version": "0.6.3",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-ttr-0.23_1-r3.4.1_0",
"name": "r-ttr",
"platform": null,
"version": "0.23_1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-broom-0.4.2-r3.4.1_0",
"name": "r-broom",
"platform": null,
"version": "0.4.2",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-pbkrtest-0.4_7-r3.4.1_0",
"name": "r-pbkrtest",
"platform": null,
"version": "0.4_7",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-quantmod-0.4_9-r3.4.1_0",
"name": "r-quantmod",
"platform": null,
"version": "0.4_9",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rmarkdown-1.5-r3.4.1_0",
"name": "r-rmarkdown",
"platform": null,
"version": "1.5",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-car-2.1_4-r3.4.1_0",
"name": "r-car",
"platform": null,
"version": "2.1_4",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-gistr-0.4.0-r3.4.1_0",
"name": "r-gistr",
"platform": null,
"version": "0.4.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-modelr-0.1.0-r3.4.1_0",
"name": "r-modelr",
"platform": null,
"version": "0.1.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-caret-6.0_76-r3.4.1_0",
"name": "r-caret",
"platform": null,
"version": "6.0_76",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-rbokeh-0.5.0-r3.4.1_0",
"name": "r-rbokeh",
"platform": null,
"version": "0.5.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-tidyverse-1.1.1-r3.4.1_0",
"name": "r-tidyverse",
"platform": null,
"version": "1.1.1",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 0,
"build_string": "r3.4.1_0",
"channel": "defaults",
"dist_name": "r-essentials-1.6.0-r3.4.1_0",
"name": "r-essentials",
"platform": null,
"version": "1.6.0",
"with_features_depends": null
},
{
"base_url": null,
"build_number": 1,
"build_string": "1",
"channel": "defaults",
"dist_name": "rstudio-1.0.153-1",
"name": "rstudio",
"platform": null,
"version": "1.0.153",
"with_features_depends": null
}
],
"PREFIX": "/Users/gpena-castellanos/anaconda/envs/py36",
"SYMLINK_CONDA": [
"/Users/gpena-castellanos/anaconda"
],
"op_order": [
"CHECK_FETCH",
"RM_FETCHED",
"FETCH",
"CHECK_EXTRACT",
"RM_EXTRACTED",
"EXTRACT",
"UNLINK",
"LINK",
"SYMLINK_CONDA"
]
}
],
"dry_run": true,
"success": true
}
```
| 2017-08-15T21:51:50 |
|
conda/conda | 5,835 | conda__conda-5835 | [
"5834"
] | 2f786d23c891eaca14cbd06b67f79f41cddcec8d | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -87,7 +87,7 @@ def ssl_verify_validation(value):
class Context(Configuration):
add_pip_as_python_dependency = PrimitiveParameter(True)
- allow_softlinks = PrimitiveParameter(True)
+ allow_softlinks = PrimitiveParameter(False)
auto_update_conda = PrimitiveParameter(True, aliases=('self_update',))
clobber = PrimitiveParameter(False)
changeps1 = PrimitiveParameter(True)
| Change default value for 'allow_softlinks' from True to False
The `allow_softlinks` configuration parameter can be dangerous. Softlinks into prefixes directly from the package cache will often lead to environment corruption. It was an oversight that the default value for `allow_softlinks` is set to `True`. In conda 4.4, we should definitely change the default value to `False`. We should also consider it even for the next 4.3.x release.
| 2017-08-16T16:38:14 |
||
conda/conda | 5,839 | conda__conda-5839 | [
"5834",
"5834"
] | b38340806c4f2657dc1647fee7b4b10aec60ee3f | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -72,7 +72,7 @@ def ssl_verify_validation(value):
class Context(Configuration):
add_pip_as_python_dependency = PrimitiveParameter(True)
- allow_softlinks = PrimitiveParameter(True)
+ allow_softlinks = PrimitiveParameter(False)
auto_update_conda = PrimitiveParameter(True, aliases=('self_update',))
clobber = PrimitiveParameter(False)
changeps1 = PrimitiveParameter(True)
| Change default value for 'allow_softlinks' from True to False
The `allow_softlinks` configuration parameter can be dangerous. Softlinks into prefixes directly from the package cache will often lead to environment corruption. It was an oversight that the default value for `allow_softlinks` is set to `True`. In conda 4.4, we should definitely change the default value to `False`. We should also consider it even for the next 4.3.x release.
Change default value for 'allow_softlinks' from True to False
The `allow_softlinks` configuration parameter can be dangerous. Softlinks into prefixes directly from the package cache will often lead to environment corruption. It was an oversight that the default value for `allow_softlinks` is set to `True`. In conda 4.4, we should definitely change the default value to `False`. We should also consider it even for the next 4.3.x release.
| 2017-08-16T20:04:06 |
||
conda/conda | 5,846 | conda__conda-5846 | [
"5847"
] | d3b47d7b9ee483ba894a385e99361fa13ca9444b | diff --git a/conda/gateways/disk/delete.py b/conda/gateways/disk/delete.py
--- a/conda/gateways/disk/delete.py
+++ b/conda/gateways/disk/delete.py
@@ -30,16 +30,12 @@ def rm_rf(path, max_retries=5, trash=True):
path = abspath(path)
log.trace("rm_rf %s", path)
if isdir(path) and not islink(path):
- try:
- # On Windows, always move to trash first.
- if trash and on_win:
- move_result = move_path_to_trash(path, preclean=False)
- if move_result:
- return True
- backoff_rmdir(path)
- finally:
- from ...core.linked_data import delete_prefix_from_linked_data
- delete_prefix_from_linked_data(path)
+ # On Windows, always move to trash first.
+ if trash and on_win:
+ move_result = move_path_to_trash(path, preclean=False)
+ if move_result:
+ return True
+ backoff_rmdir(path)
elif lexists(path):
try:
backoff_unlink(path)
@@ -51,11 +47,12 @@ def rm_rf(path, max_retries=5, trash=True):
if move_result:
return True
log.info("Failed to remove %s.", path)
-
else:
log.trace("rm_rf failed. Not a link, file, or directory: %s", path)
return True
finally:
+ from ...core.linked_data import delete_prefix_from_linked_data
+ delete_prefix_from_linked_data(path)
if lexists(path):
log.info("rm_rf failed for %s", path)
return False
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -431,6 +431,12 @@ def test_list_with_pip_egg(self):
assert any(line.endswith("<pip>") for line in stdout_lines
if line.lower().startswith("flask"))
+ # regression test for #5847
+ # when using rm_rf on a directory
+ assert prefix in linked_data_
+ rm_rf(join(prefix, get_python_site_packages_short_path("3.5")))
+ assert prefix not in linked_data_
+
def test_list_with_pip_wheel(self):
with make_temp_env("python=3.5 pip") as prefix:
check_call(PYTHON_BINARY + " -m pip install flask==0.10.1",
@@ -444,6 +450,12 @@ def test_list_with_pip_wheel(self):
run_command(Commands.INSTALL, prefix, "python=3.4")
assert_package_is_installed(prefix, 'python-3.4.')
+ # regression test for #5847
+ # when using rm_rf on a file
+ assert prefix in linked_data_
+ rm_rf(join(prefix, get_python_site_packages_short_path("3.4")), "os.py")
+ assert prefix not in linked_data_
+
def test_install_tarball_from_local_channel(self):
# Regression test for #2812
# install from local channel
| Problem: conda-build doesn't clean up temporary files
@gabm commented on [Thu Aug 17 2017](https://github.com/conda/conda-build/issues/2289)
It seems conda-build doesn't clean up temporary files located under `/tmp/tmpxxxxxx` or `User/../AppData/Local/tmpxxxxxx` on windows. After the build these folders contain the decompressed packages that I suppose have been installed as dependencies during the build. Maybe its also a conda problem?!
Anyway, on our Windows build machine we accumulated 25Gb within some weeks ....
---
@gabm commented on [Thu Aug 17 2017](https://github.com/conda/conda-build/issues/2289#issuecomment-323134590)
.. the same files are located again in `miniconda3/pkgs`...
---
@msarahan commented on [Thu Aug 17 2017](https://github.com/conda/conda-build/issues/2289#issuecomment-323158750)
Conda-build uses this functionality in conda for temporary folders: https://github.com/conda/conda/blob/dbe99de1d45206c5d6f2e19017a9e2466f81dc6d/conda/compat.py#L23-L67
When we get files from packages, we do so with the package_has_file function: https://github.com/conda/conda-build/blob/master/conda_build/utils.py#L714-L730
package_has_file does not ever extract the whole package. This seems like a conda issue. Sorry, I don't currently have time to investigate this more. I can move this issue to the conda repo if you'd like.
---
@gabm commented on [Thu Aug 17 2017](https://github.com/conda/conda-build/issues/2289#issuecomment-323170508)
ok, then please move it there... If I find time, I'll have a further look. I realised some strange folders `/tmp/tmpxxxxxxx` some weeks ago, so could be easy to reproduce...
| 2017-08-17T16:44:03 |
|
conda/conda | 5,921 | conda__conda-5921 | [
"5920"
] | 40037889fba4b0afb4a9d60d04ed6014637632a6 | diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -54,7 +54,7 @@
dotlog = getLogger('dotupdate')
stderrlog = getLogger('stderrlog')
-REPODATA_PICKLE_VERSION = 1
+REPODATA_PICKLE_VERSION = 2
REPODATA_HEADER_RE = b'"(_etag|_mod|_cache_control)":[ ]?"(.*?[^\\\\])"[,\}\s]'
| bump repodata pickle version in 4.3.x
| 2017-09-05T14:30:48 |
||
conda/conda | 5,923 | conda__conda-5923 | [
"5922"
] | 40037889fba4b0afb4a9d60d04ed6014637632a6 | diff --git a/conda/models/channel.py b/conda/models/channel.py
--- a/conda/models/channel.py
+++ b/conda/models/channel.py
@@ -4,8 +4,7 @@
from itertools import chain
from logging import getLogger
-from ..base.constants import (DEFAULTS_CHANNEL_NAME, DEFAULT_CHANNELS_UNIX, DEFAULT_CHANNELS_WIN,
- MAX_CHANNEL_PRIORITY, UNKNOWN_CHANNEL)
+from ..base.constants import (DEFAULTS_CHANNEL_NAME, MAX_CHANNEL_PRIORITY, UNKNOWN_CHANNEL)
from ..base.context import context
from ..common.compat import ensure_text_type, isiterable, iteritems, odict, with_metaclass
from ..common.path import is_path, win_path_backout
@@ -14,10 +13,10 @@
try:
from cytoolz.functoolz import excepts
- from cytoolz.itertoolz import concatv, topk
+ from cytoolz.itertoolz import concat, concatv, topk
except ImportError:
from .._vendor.toolz.functoolz import excepts # NOQA
- from .._vendor.toolz.itertoolz import concatv, topk # NOQA
+ from .._vendor.toolz.itertoolz import concat, concatv, topk # NOQA
log = getLogger(__name__)
@@ -387,13 +386,6 @@ def canonical_name(self):
def urls(self, with_credentials=False, subdirs=None):
_channels = self._channels
- if self.name == 'defaults':
- platform = next((s for s in reversed(subdirs or context.subdirs) if s != 'noarch'), '')
- if platform != context.subdir:
- # necessary shenanigan because different platforms have different default channels
- urls = DEFAULT_CHANNELS_WIN if 'win' in platform else DEFAULT_CHANNELS_UNIX
- ca = context.channel_alias
- _channels = tuple(Channel.make_simple_channel(ca, v) for v in urls)
return list(chain.from_iterable(c.urls(with_credentials, subdirs) for c in _channels))
@property
@@ -409,13 +401,15 @@ def prioritize_channels(channels, with_credentials=True, subdirs=None):
# urls as the key, and a tuple of canonical channel name and channel priority
# number as the value
# ('https://conda.anaconda.org/conda-forge/osx-64/', ('conda-forge', 1))
+ channels = concat((Channel(cc) for cc in c._channels) if isinstance(c, MultiChannel) else (c,)
+ for c in (Channel(c) for c in channels))
result = odict()
- for channel_priority, chn in enumerate(channels):
+ for priority_counter, chn in enumerate(channels):
channel = Channel(chn)
for url in channel.urls(with_credentials, subdirs):
if url in result:
continue
- result[url] = channel.canonical_name, min(channel_priority, MAX_CHANNEL_PRIORITY - 1)
+ result[url] = channel.canonical_name, min(priority_counter, MAX_CHANNEL_PRIORITY - 1)
return result
| 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
@@ -800,7 +800,7 @@ def test_subdirs_env_var(self):
subdirs = ('linux-highest', 'linux-64', 'noarch')
def _channel_urls(channels=None):
- for channel in channels or DEFAULT_CHANNELS_UNIX:
+ for channel in channels or DEFAULT_CHANNELS:
channel = Channel(channel)
for subdir in subdirs:
yield join_url(channel.base_url, subdir)
@@ -919,3 +919,47 @@ def test_channels_with_dashes(self):
('http://test/conda/anaconda-cluster/noarch', ('http://test/conda/anaconda-cluster', 0)),
))
+
+def test_multichannel_priority():
+ channels = ['conda-test', 'defaults', 'conda-forge']
+ subdirs = ['new-optimized-subdir', 'linux-32', 'noarch']
+ channel_priority_map = prioritize_channels(channels, with_credentials=True, subdirs=subdirs)
+ if on_win:
+ assert channel_priority_map == OrderedDict([
+ ('https://conda.anaconda.org/conda-test/new-optimized-subdir', ('conda-test', 0)),
+ ('https://conda.anaconda.org/conda-test/linux-32', ('conda-test', 0)),
+ ('https://conda.anaconda.org/conda-test/noarch', ('conda-test', 0)),
+ ('https://repo.continuum.io/pkgs/free/new-optimized-subdir', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/free/linux-32', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/free/noarch', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/r/new-optimized-subdir', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/r/linux-32', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/r/noarch', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/pro/new-optimized-subdir', ('defaults', 3)),
+ ('https://repo.continuum.io/pkgs/pro/linux-32', ('defaults', 3)),
+ ('https://repo.continuum.io/pkgs/pro/noarch', ('defaults', 3)),
+ ('https://repo.continuum.io/pkgs/msys2/new-optimized-subdir', ('defaults', 4)),
+ ('https://repo.continuum.io/pkgs/msys2/linux-32', ('defaults', 4)),
+ ('https://repo.continuum.io/pkgs/msys2/noarch', ('defaults', 4)),
+ ('https://conda.anaconda.org/conda-forge/new-optimized-subdir', ('conda-forge', 5)),
+ ('https://conda.anaconda.org/conda-forge/linux-32', ('conda-forge', 5)),
+ ('https://conda.anaconda.org/conda-forge/noarch', ('conda-forge', 5)),
+ ])
+ else:
+ assert channel_priority_map == OrderedDict([
+ ('https://conda.anaconda.org/conda-test/new-optimized-subdir', ('conda-test', 0)),
+ ('https://conda.anaconda.org/conda-test/linux-32', ('conda-test', 0)),
+ ('https://conda.anaconda.org/conda-test/noarch', ('conda-test', 0)),
+ ('https://repo.continuum.io/pkgs/free/new-optimized-subdir', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/free/linux-32', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/free/noarch', ('defaults', 1)),
+ ('https://repo.continuum.io/pkgs/r/new-optimized-subdir', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/r/linux-32', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/r/noarch', ('defaults', 2)),
+ ('https://repo.continuum.io/pkgs/pro/new-optimized-subdir', ('defaults', 3)),
+ ('https://repo.continuum.io/pkgs/pro/linux-32', ('defaults', 3)),
+ ('https://repo.continuum.io/pkgs/pro/noarch', ('defaults', 3)),
+ ('https://conda.anaconda.org/conda-forge/new-optimized-subdir', ('conda-forge', 4)),
+ ('https://conda.anaconda.org/conda-forge/linux-32', ('conda-forge', 4)),
+ ('https://conda.anaconda.org/conda-forge/noarch', ('conda-forge', 4)),
+ ])
diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -191,7 +191,7 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
def test_activate_deactivate(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 9, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 10, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
@@ -208,7 +208,7 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
def test_activate_root_simple(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 9, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2017, 10, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -686,7 +686,7 @@ def test_update_deps_flag_absent(self):
assert package_is_installed(prefix, 'itsdangerous-0.23')
assert package_is_installed(prefix, 'flask')
- @pytest.mark.xfail(datetime.now() < datetime(2017, 9, 1), reason="#5263", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 10, 1), reason="#5263", strict=True)
def test_update_deps_flag_present(self):
with make_temp_env("python=2 itsdangerous=0.23") as prefix:
assert package_is_installed(prefix, 'python-2')
@@ -887,7 +887,10 @@ def test_search_gawk_not_win(self):
def test_search_gawk_not_win_filter(self):
with make_temp_env() as prefix:
stdout, stderr = run_command(
- Commands.SEARCH, prefix, "gawk", "--platform", "win-64", "--json", use_exception_handler=True)
+ Commands.SEARCH, prefix, "gawk", "--platform", "win-64", "--json",
+ "-c", "https://repo.continuum.io/pkgs/msys2 --json",
+ use_exception_handler=True,
+ )
json_obj = json_loads(stdout.replace("Fetching package metadata ...", "").strip())
assert "gawk" in json_obj.keys()
assert "m2-gawk" in json_obj.keys()
diff --git a/tests/test_export.py b/tests/test_export.py
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -31,7 +31,7 @@ def test_basic(self):
output2, error= run_command(Commands.LIST, prefix2, "-e")
self.assertEqual(output, output2)
- @pytest.mark.xfail(datetime.now() < datetime(2017, 9, 1), reason="Bring back `conda list --export` #3445", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2017, 10, 1), reason="Bring back `conda list --export` #3445", strict=True)
def test_multi_channel_export(self):
"""
When try to import from txt
diff --git a/tests/test_priority.py b/tests/test_priority.py
--- a/tests/test_priority.py
+++ b/tests/test_priority.py
@@ -1,5 +1,6 @@
from unittest import TestCase
+from conda.common.compat import on_win
import pytest
from conda.base.context import context
@@ -10,6 +11,7 @@
@pytest.mark.integration
class PriorityIntegrationTests(TestCase):
+ @pytest.mark.skipif(on_win, reason="xz packages are different on windows than unix")
def test_channel_order_channel_priority_true(self):
with make_temp_env("python=3.5 pycosat==0.6.1") as prefix:
assert_package_is_installed(prefix, 'python')
@@ -22,16 +24,16 @@ def test_channel_order_channel_priority_true(self):
# update --all
update_stdout, _ = run_command(Commands.UPDATE, prefix, '--all')
- # pycosat should be in the SUPERSEDED list
+ # xz should be in the SUPERSEDED list
superceded_split = update_stdout.split('SUPERSEDED')
assert len(superceded_split) == 2
- assert 'pycosat' in superceded_split[1]
+ assert 'xz' in superceded_split[1]
# python sys.version should show conda-forge python
python_tuple = get_conda_list_tuple(prefix, "python")
assert python_tuple[3] == 'conda-forge'
- # conda list should show pycosat coming from conda-forge
- pycosat_tuple = get_conda_list_tuple(prefix, "pycosat")
+ # conda list should show xz coming from conda-forge
+ pycosat_tuple = get_conda_list_tuple(prefix, "xz")
assert pycosat_tuple[3] == 'conda-forge'
def test_channel_priority_update(self):
| prioritize channels within multi-channels
| 2017-09-05T16:23:18 |
|
conda/conda | 5,949 | conda__conda-5949 | [
"5948"
] | 9c9dc2b85061399e5dfa0f80331f8b0fe8109226 | diff --git a/conda/gateways/adapters/s3.py b/conda/gateways/adapters/s3.py
--- a/conda/gateways/adapters/s3.py
+++ b/conda/gateways/adapters/s3.py
@@ -1,13 +1,16 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+import json
from logging import getLogger
+from tempfile import SpooledTemporaryFile, mkstemp
+
from requests import Response
from requests.adapters import BaseAdapter
from requests.structures import CaseInsensitiveDict
-from tempfile import mkstemp
from ..disk.delete import rm_rf
+from ...common.compat import ensure_binary
from ...common.url import url_to_s3_info
log = getLogger(__name__)
@@ -21,21 +24,71 @@ def __init__(self):
self._temp_file = None
def send(self, request, stream=None, timeout=None, verify=None, cert=None, proxies=None):
-
resp = Response()
resp.status_code = 200
resp.url = request.url
try:
- import boto
+ import boto3
+ return self._send_boto3(boto3, resp, request)
except ImportError:
- stderrlog.info('\nError: boto is required for S3 channels. '
- 'Please install it with `conda install boto`\n'
- 'Make sure to run `source deactivate` if you '
- 'are in a conda environment.\n')
+ try:
+ import boto
+ return self._send_boto(boto, resp, request)
+ except ImportError:
+ stderrlog.info('\nError: boto3 is required for S3 channels. '
+ 'Please install with `conda install boto3`\n'
+ 'Make sure to run `source deactivate` if you '
+ 'are in a conda environment.\n')
+ resp.status_code = 404
+ return resp
+
+ def close(self):
+ if self._temp_file:
+ rm_rf(self._temp_file)
+
+ def _send_boto3(self, boto3, resp, request):
+ from botocore.exceptions import BotoCoreError, ClientError
+ bucket_name, key_string = url_to_s3_info(request.url)
+
+ # Get the key without validation that it exists and that we have
+ # permissions to list its contents.
+ key = boto3.resource('s3').Object(bucket_name, key_string[1:])
+
+ try:
+ response = key.get()
+ except (BotoCoreError, ClientError) as exc:
+ # This exception will occur if the bucket does not exist or if the
+ # user does not have permission to list its contents.
resp.status_code = 404
+ message = {
+ "error": "error downloading file from s3",
+ "path": request.url,
+ "exception": repr(exc),
+ }
+ fh = SpooledTemporaryFile()
+ fh.write(ensure_binary(json.dumps(message)))
+ fh.seek(0)
+ resp.raw = fh
+ resp.close = resp.raw.close
return resp
+ key_headers = response['ResponseMetadata']['HTTPHeaders']
+ resp.headers = CaseInsensitiveDict({
+ "Content-Type": key_headers.get('content-type', "text/plain"),
+ "Content-Length": key_headers['content-length'],
+ "Last-Modified": key_headers['last-modified'],
+ })
+
+ f = SpooledTemporaryFile()
+ key.download_fileobj(f)
+ f.seek(0)
+ resp.raw = f
+ resp.close = resp.raw.close
+
+ return resp
+
+ def _send_boto(self, boto, resp, request):
conn = boto.connect_s3()
bucket_name, key_string = url_to_s3_info(request.url)
@@ -69,9 +122,3 @@ def send(self, request, stream=None, timeout=None, verify=None, cert=None, proxi
resp.close = resp.raw.close
else:
resp.status_code = 404
-
- return resp
-
- def close(self):
- if self._temp_file:
- rm_rf(self._temp_file)
| add boto3 to conda's s3 adapter
| 2017-09-11T16:56:58 |
||
conda/conda | 5,982 | conda__conda-5982 | [
"5980",
"5980"
] | f0032e064a8122ebdb4a0d7885a0b61a053e58f5 | diff --git a/conda/gateways/disk/delete.py b/conda/gateways/disk/delete.py
--- a/conda/gateways/disk/delete.py
+++ b/conda/gateways/disk/delete.py
@@ -49,6 +49,8 @@ def rm_rf(path, max_retries=5, trash=True):
log.info("Failed to remove %s.", path)
else:
log.trace("rm_rf failed. Not a link, file, or directory: %s", path)
+ from ...core.linked_data import delete_prefix_from_linked_data
+ delete_prefix_from_linked_data(path)
return True
finally:
from ...core.linked_data import delete_prefix_from_linked_data
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -456,6 +456,19 @@ def test_list_with_pip_wheel(self):
rm_rf(join(prefix, get_python_site_packages_short_path("3.5")), "os.py")
assert prefix not in linked_data_
+ # regression test for #5980, related to #5847
+ with make_temp_env() as prefix:
+ assert isdir(prefix)
+ assert prefix in linked_data_
+
+ rmtree(prefix)
+ assert not isdir(prefix)
+ assert prefix in linked_data_
+
+ rm_rf(prefix)
+ assert not isdir(prefix)
+ assert prefix not in linked_data_
+
def test_install_tarball_from_local_channel(self):
# Regression test for #2812
# install from local channel
| Fix prefix data cache with rm_rf for conda-build on windows
As reported by @mingwandroid:
conda-build uses rd on Windows to remove the prefix before calling `rm_rf`, so we need conda to forget about the installed packages.
Fix prefix data cache with rm_rf for conda-build on windows
As reported by @mingwandroid:
conda-build uses rd on Windows to remove the prefix before calling `rm_rf`, so we need conda to forget about the installed packages.
| 2017-09-18T17:36:39 |
|
conda/conda | 5,986 | conda__conda-5986 | [
"5948",
"5980"
] | 40c6ae17729142fcd54478996417d171cc111ab9 | diff --git a/conda/cli/activate.py b/conda/cli/activate.py
--- a/conda/cli/activate.py
+++ b/conda/cli/activate.py
@@ -83,12 +83,15 @@ def _get_prefix_paths(prefix):
yield os.path.join(prefix, 'bin')
-def binpath_from_arg(arg, shell):
+def binpath_from_arg(arg, shell, going_to_shell=True):
shelldict = shells[shell] if shell else {}
# prefix comes back as platform-native path
prefix = prefix_from_arg(arg, shell)
# convert paths to shell-native paths
- return [shelldict['path_to'](path) for path in _get_prefix_paths(prefix)]
+ if going_to_shell:
+ return [shelldict['path_to'](path) for path in _get_prefix_paths(prefix)]
+ else:
+ return [path for path in _get_prefix_paths(prefix)]
def pathlist_to_str(paths, escape_backslashes=True):
@@ -105,12 +108,15 @@ def pathlist_to_str(paths, escape_backslashes=True):
return path
-def get_activate_path(prefix, shell):
+def get_activate_path(prefix, shell, going_to_shell=True):
shelldict = shells[shell] if shell else {}
- binpath = binpath_from_arg(prefix, shell)
+ binpath = binpath_from_arg(prefix, shell, going_to_shell)
# prepend our new entries onto the existing path and make sure that the separator is native
- path = shelldict['pathsep'].join(binpath)
+ if going_to_shell:
+ path = shelldict['pathsep'].join(binpath)
+ else:
+ path = os.pathsep.join(binpath)
return path
@@ -146,11 +152,11 @@ def main():
shell and env name".format(sys_argv[1]))
if sys_argv[1] == '..activate':
- print(get_activate_path(sys_argv[3], shell))
+ print(get_activate_path(sys_argv[3], shell, True))
sys.exit(0)
elif sys_argv[1] == '..deactivate.path':
- activation_path = get_activate_path(sys_argv[3], shell)
+ activation_path = get_activate_path(sys_argv[3], shell, False)
if os.getenv('_CONDA_HOLD'):
new_path = regex.sub(r'%s(:?)' % regex.escape(activation_path),
@@ -160,6 +166,7 @@ def main():
new_path = regex.sub(r'%s(:?)' % regex.escape(activation_path), r'',
os.environ[str('PATH')], 1)
+ new_path = shells[shell]['path_to'](new_path)
print(new_path)
sys.exit(0)
diff --git a/conda/common/path.py b/conda/common/path.py
--- a/conda/common/path.py
+++ b/conda/common/path.py
@@ -2,10 +2,12 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from functools import reduce
+from logging import getLogger
import os
from os.path import (abspath, basename, dirname, expanduser, expandvars, join, normpath, split,
splitext)
import re
+import subprocess
from .compat import on_win, string_types
from .. import CondaError
@@ -25,6 +27,7 @@
except ImportError: # pragma: no cover
from .._vendor.toolz.itertoolz import accumulate, concat, take
+log = getLogger(__name__)
PATH_MATCH_REGEX = (
r"\./" # ./
@@ -253,14 +256,23 @@ def get_python_noarch_target_path(source_short_path, target_site_packages_short_
def win_path_to_unix(path, root_prefix=""):
- """Convert a path or ;-separated string of paths into a unix representation
-
- Does not add cygdrive. If you need that, set root_prefix to "/cygdrive"
- """
- path_re = '(?<![:/^a-zA-Z])([a-zA-Z]:[\/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;\/\\\\]+?(?![a-zA-Z]:))' # noqa
-
- def _translation(found_path):
- found = found_path.group(1).replace("\\", "/").replace(":", "").replace("//", "/")
- return root_prefix + "/" + found
- path = re.sub(path_re, _translation, path).replace(";/", ":/")
+ # If the user wishes to drive conda from MSYS2 itself while also having
+ # msys2 packages in their environment this allows the path conversion to
+ # happen relative to the actual shell. The onus is on the user to set
+ # CYGPATH to e.g. /usr/bin/cygpath.exe (this will be translated to e.g.
+ # (C:\msys32\usr\bin\cygpath.exe by MSYS2) to ensure this one is used.
+ if not path:
+ return ''
+ cygpath = os.environ.get('CYGPATH', 'cygpath.exe')
+ try:
+ path = subprocess.check_output([cygpath, '-up', path]).decode('ascii').split('\n')[0]
+ except Exception as e:
+ log.debug('%r' % e, exc_info=True)
+ # Convert a path or ;-separated string of paths into a unix representation
+ # Does not add cygdrive. If you need that, set root_prefix to "/cygdrive"
+ def _translation(found_path): # NOQA
+ found = found_path.group(1).replace("\\", "/").replace(":", "").replace("//", "/")
+ return root_prefix + "/" + found
+ path_re = '(?<![:/^a-zA-Z])([a-zA-Z]:[\/\\\\]+(?:[^:*?"<>|]+[\/\\\\]+)*[^:*?"<>|;\/\\\\]+?(?![a-zA-Z]:))' # noqa
+ path = re.sub(path_re, _translation, path).replace(";/", ":/")
return path
diff --git a/conda/gateways/connection/adapters/s3.py b/conda/gateways/connection/adapters/s3.py
--- a/conda/gateways/connection/adapters/s3.py
+++ b/conda/gateways/connection/adapters/s3.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
-from logging import getLogger, LoggerAdapter
-from tempfile import mkstemp
+import json
+from logging import LoggerAdapter, getLogger
+from tempfile import SpooledTemporaryFile
from .. import BaseAdapter, CaseInsensitiveDict, Response
-from ...disk.delete import rm_rf
+from ....common.compat import ensure_binary
from ....common.url import url_to_s3_info
log = getLogger(__name__)
@@ -16,24 +17,72 @@ class S3Adapter(BaseAdapter):
def __init__(self):
super(S3Adapter, self).__init__()
- self._temp_file = None
def send(self, request, stream=None, timeout=None, verify=None, cert=None, proxies=None):
-
resp = Response()
resp.status_code = 200
resp.url = request.url
try:
- import boto
+ import boto3
+ return self._send_boto3(boto3, resp, request)
except ImportError:
- stderrlog.info('\nError: boto is required for S3 channels. '
- 'Please install it with `conda install boto`\n'
- 'Make sure to run `source deactivate` if you '
- 'are in a conda environment.')
+ try:
+ import boto
+ return self._send_boto(boto, resp, request)
+ except ImportError:
+ stderrlog.info('\nError: boto3 is required for S3 channels. '
+ 'Please install with `conda install boto3`\n'
+ 'Make sure to run `source deactivate` if you '
+ 'are in a conda environment.\n')
+ resp.status_code = 404
+ return resp
+
+ def close(self):
+ pass
+
+ def _send_boto3(self, boto3, resp, request):
+ from botocore.exceptions import BotoCoreError, ClientError
+ bucket_name, key_string = url_to_s3_info(request.url)
+
+ # Get the key without validation that it exists and that we have
+ # permissions to list its contents.
+ key = boto3.resource('s3').Object(bucket_name, key_string[1:])
+
+ try:
+ response = key.get()
+ except (BotoCoreError, ClientError) as exc:
+ # This exception will occur if the bucket does not exist or if the
+ # user does not have permission to list its contents.
resp.status_code = 404
+ message = {
+ "error": "error downloading file from s3",
+ "path": request.url,
+ "exception": repr(exc),
+ }
+ fh = SpooledTemporaryFile()
+ fh.write(ensure_binary(json.dumps(message)))
+ fh.seek(0)
+ resp.raw = fh
+ resp.close = resp.raw.close
return resp
+ key_headers = response['ResponseMetadata']['HTTPHeaders']
+ resp.headers = CaseInsensitiveDict({
+ "Content-Type": key_headers.get('content-type', "text/plain"),
+ "Content-Length": key_headers['content-length'],
+ "Last-Modified": key_headers['last-modified'],
+ })
+
+ f = SpooledTemporaryFile()
+ key.download_fileobj(f)
+ f.seek(0)
+ resp.raw = f
+ resp.close = resp.raw.close
+
+ return resp
+
+ def _send_boto(self, boto, resp, request):
conn = boto.connect_s3()
bucket_name, key_string = url_to_s3_info(request.url)
@@ -60,16 +109,10 @@ def send(self, request, stream=None, timeout=None, verify=None, cert=None, proxi
"Last-Modified": modified,
})
- _, self._temp_file = mkstemp()
- key.get_contents_to_filename(self._temp_file)
- f = open(self._temp_file, 'rb')
- resp.raw = f
+ fh = SpooledTemporaryFile()
+ key.get_contents_to_file(fh)
+ fh.seek(0)
+ resp.raw = fh
resp.close = resp.raw.close
else:
resp.status_code = 404
-
- return resp
-
- def close(self):
- if self._temp_file:
- rm_rf(self._temp_file)
| diff --git a/tests/cli/test_activate.py b/tests/cli/test_activate.py
--- a/tests/cli/test_activate.py
+++ b/tests/cli/test_activate.py
@@ -181,6 +181,8 @@ def _format_vars(shell):
@pytest.mark.installed
def test_activate_test1(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
@@ -195,6 +197,8 @@ def test_activate_test1(shell):
@pytest.mark.installed
def test_activate_env_from_env_with_root_activate(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
@@ -227,6 +231,8 @@ def test_activate_bad_directory(shell):
@pytest.mark.installed
def test_activate_bad_env_keeps_existing_good_env(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
@@ -241,6 +247,8 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
def test_activate_deactivate(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
@@ -276,6 +284,8 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
def test_activate_root_simple(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
@@ -317,6 +327,8 @@ def test_activate_root_simple(shell):
@pytest.mark.installed
def test_wrong_args(shell):
+ if shell == 'bash.exe':
+ pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -536,6 +536,7 @@ def test_create_empty_env(self):
self.assertIsInstance(stdout, str)
def test_list_with_pip_egg(self):
+ from conda.exports import rm_rf as _rm_rf
with make_temp_env("python=3.5 pip") as prefix:
check_call(PYTHON_BINARY + " -m pip install --egg --no-binary flask flask==0.10.1",
cwd=prefix, shell=True)
@@ -547,11 +548,11 @@ def test_list_with_pip_egg(self):
# regression test for #5847
# when using rm_rf on a directory
assert prefix in PrefixData._cache_
- from conda.exports import rm_rf as _rm_rf
_rm_rf(join(prefix, get_python_site_packages_short_path("3.5")))
assert prefix not in PrefixData._cache_
def test_list_with_pip_wheel(self):
+ from conda.exports import rm_rf as _rm_rf
with make_temp_env("python=3.6 pip") as prefix:
check_call(PYTHON_BINARY + " -m pip install flask==0.10.1",
cwd=prefix, shell=True)
@@ -567,10 +568,22 @@ def test_list_with_pip_wheel(self):
# regression test for #5847
# when using rm_rf on a file
assert prefix in PrefixData._cache_
- from conda.exports import rm_rf as _rm_rf
_rm_rf(join(prefix, get_python_site_packages_short_path("3.5")), "os.py")
assert prefix not in PrefixData._cache_
+ # regression test for #5980, related to #5847
+ with make_temp_env() as prefix:
+ assert isdir(prefix)
+ assert prefix in PrefixData._cache_
+
+ rmtree(prefix)
+ assert not isdir(prefix)
+ assert prefix in PrefixData._cache_
+
+ _rm_rf(prefix)
+ assert not isdir(prefix)
+ assert prefix not in PrefixData._cache_
+
def test_install_tarball_from_local_channel(self):
# Regression test for #2812
# install from local channel
diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -8,12 +8,12 @@
def test_path_translations():
paths = [
- (r";z:\miniconda\Scripts\pip.exe",
- ":/z/miniconda/Scripts/pip.exe",
- ":/cygdrive/z/miniconda/Scripts/pip.exe"),
- (r";z:\miniconda;z:\Documents (x86)\pip.exe;C:\test",
- ":/z/miniconda:/z/Documents (x86)/pip.exe:/C/test",
- ":/cygdrive/z/miniconda:/cygdrive/z/Documents (x86)/pip.exe:/cygdrive/C/test"),
+ (r"z:\miniconda\Scripts\pip.exe",
+ "/z/miniconda/Scripts/pip.exe",
+ "/cygdrive/z/miniconda/Scripts/pip.exe"),
+ (r"z:\miniconda;z:\Documents (x86)\pip.exe;c:\test",
+ "/z/miniconda:/z/Documents (x86)/pip.exe:/c/test",
+ "/cygdrive/z/miniconda:/cygdrive/z/Documents (x86)/pip.exe:/cygdrive/c/test"),
# Failures:
# (r"z:\miniconda\Scripts\pip.exe",
# "/z/miniconda/Scripts/pip.exe",
@@ -30,12 +30,12 @@ def test_path_translations():
assert win_path_to_unix(windows_path) == unix_path
assert utils.unix_path_to_win(unix_path) == windows_path
- assert utils.win_path_to_cygwin(windows_path) == cygwin_path
- assert utils.cygwin_path_to_win(cygwin_path) == windows_path
+ # assert utils.win_path_to_cygwin(windows_path) == cygwin_path
+ # assert utils.cygwin_path_to_win(cygwin_path) == windows_path
def test_text_translations():
- test_win_text = "prepending z:\\msarahan\\code\\conda\\tests\\envsk5_b4i\\test 1 and z:\\msarahan\\code\\conda\\tests\\envsk5_b4i\\test 1\\scripts to path"
- test_unix_text = "prepending /z/msarahan/code/conda/tests/envsk5_b4i/test 1 and /z/msarahan/code/conda/tests/envsk5_b4i/test 1/scripts to path"
+ test_win_text = "z:\\msarahan\\code\\conda\\tests\\envsk5_b4i\\test 1"
+ test_unix_text = "/z/msarahan/code/conda/tests/envsk5_b4i/test 1"
assert_equals(test_win_text, utils.unix_path_to_win(test_unix_text))
assert_equals(test_unix_text, win_path_to_unix(test_win_text))
| add boto3 to conda's s3 adapter
Fix prefix data cache with rm_rf for conda-build on windows
As reported by @mingwandroid:
conda-build uses rd on Windows to remove the prefix before calling `rm_rf`, so we need conda to forget about the installed packages.
| 2017-09-19T18:45:41 |
|
conda/conda | 5,988 | conda__conda-5988 | [
"5983"
] | 91adf32066cf3ee10b5d10e3419bed4348bdcacd | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -97,6 +97,7 @@ class Context(Configuration):
element_type=string_types + (NoneType,),
validation=default_python_validation)
disallow = SequenceParameter(string_types)
+ download_only = PrimitiveParameter(False)
enable_private_envs = PrimitiveParameter(False)
force_32bit = PrimitiveParameter(False)
max_shlvl = PrimitiveParameter(2)
@@ -682,6 +683,10 @@ def get_help_dict():
Package specifications to disallow installing. The default is to allow
all packages.
"""),
+ 'download_only': dals("""
+ Solve an environment and ensure package caches are populated, but exit
+ prior to unlinking and linking packages into the prefix
+ """),
'envs_dirs': dals("""
The list of directories to search for named environments. When creating a new
named environment, the environment will be placed in the first writable
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -1079,6 +1079,13 @@ def add_parser_create_install_update(p):
"Can be used multiple times. "
"Equivalent to a MatchSpec specifying a single 'provides_features'.",
)
+ p.add_argument(
+ "--download-only",
+ action="store_true",
+ default=NULL,
+ help="Solve an environment and ensure package caches are populated, but exit "
+ "prior to unlinking and linking packages into the prefix.",
+ )
def add_parser_pscheck(p):
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -10,21 +10,21 @@
import os
from os.path import abspath, basename, exists, isdir
-from conda.models.match_spec import MatchSpec
from . import common
from .common import check_non_admin
from .._vendor.auxlib.ish import dals
from ..base.constants import ROOT_ENV_NAME
from ..base.context import context
-from ..common.compat import text_type, on_win
+from ..common.compat import on_win, text_type
from ..core.envs_manager import EnvsDirectory
from ..core.index import calculate_channel_urls, get_index
from ..core.solve import Solver
-from ..exceptions import (CondaImportError, CondaOSError, CondaSystemExit, CondaValueError,
- DirectoryNotFoundError, DryRunExit, EnvironmentLocationNotFound,
- PackagesNotFoundError, TooManyArgumentsError,
- UnsatisfiableError)
+from ..exceptions import (CondaExitZero, CondaImportError, CondaOSError, CondaSystemExit,
+ CondaValueError, DirectoryNotFoundError, DryRunExit,
+ EnvironmentLocationNotFound, PackagesNotFoundError,
+ TooManyArgumentsError, UnsatisfiableError)
from ..misc import append_env, clone_env, explicit, touch_nonadmin
+from ..models.match_spec import MatchSpec
from ..plan import (revert_actions)
from ..resolve import ResolvePackageNotFound
@@ -267,6 +267,9 @@ def handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args,
try:
progressive_fetch_extract.execute()
+ if context.download_only:
+ raise CondaExitZero('Package caches prepared. UnlinkLinkTransaction cancelled with '
+ '--download-only option.')
unlink_link_transaction.execute()
except SystemExit as e:
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -141,7 +141,7 @@ def make_temp_env(*packages, **kwargs):
try:
# try to clear any config that's been set by other tests
reset_context([os.path.join(prefix+os.sep, 'condarc')])
- run_command(Commands.CREATE, prefix, *packages)
+ run_command(Commands.CREATE, prefix, *packages, **kwargs)
yield prefix
finally:
rmtree(prefix, ignore_errors=True)
@@ -1455,6 +1455,14 @@ def test_force_remove(self):
rm_rf(prefix)
run_command(Commands.REMOVE, prefix, "--all")
+ def test_download_only_flag(self):
+ from conda.core.link import UnlinkLinkTransaction
+ with patch.object(UnlinkLinkTransaction, 'execute') as mock_method:
+ with make_temp_env('openssl --download-only', use_exception_handler=True) as prefix:
+ assert mock_method.call_count == 0
+ with make_temp_env('openssl', use_exception_handler=True) as prefix:
+ assert mock_method.call_count == 1
+
def test_transactional_rollback_simple(self):
from conda.core.path_actions import CreatePrefixRecordAction
with patch.object(CreatePrefixRecordAction, 'execute') as mock_method:
| conda install --download-only feature
Right now we have `--dry-run`, but is there a way to actually download the `.tar.bz2` files into `pkgs` without installing them? If not, can there be?
`--download-only` is one design with precedent, but also maybe as a separate subcommand, like `pip download`. The overarching goal is to get `pkgs` populated with all the dependencies necessary for an application and freezing it out into something akin to [a wheelhouse](https://pip.pypa.io/en/stable/reference/pip_wheel/#examples) for reproducible installs ([a la](https://www.paypal-engineering.com/2016/09/22/python-by-the-c-side/)).
Thanks in advance!
| Yeah we need this. It's been on the roadmap for the API for a while. Actually is trivial to implement at this point. I'll make sure it gets into 4.4.
Sent from my iPhone
> On Sep 18, 2017, at 7:34 PM, Mahmoud Hashemi <[email protected]> wrote:
>
> Right now we have --dry-run, but is there a way to actually download the .tar.bz2 files into pkgs without installing them? If not, can there be?
>
> --download-only is one design with precedent, but also maybe as a separate subcommand, like pip download. The overarching goal is to get pkgs populated with all the dependencies necessary for an application and freezing it out into something akin to a wheelhouse for reproducible installs (a la).
>
> Thanks in advance!
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
| 2017-09-19T20:42:10 |
conda/conda | 6,044 | conda__conda-6044 | [
"5854"
] | 066fea062b6184a50acd6f0e3de16f52f4c84868 | diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -51,7 +51,7 @@
log = getLogger(__name__)
stderrlog = getLogger('conda.stderrlog')
-REPODATA_PICKLE_VERSION = 6
+REPODATA_PICKLE_VERSION = 16
REPODATA_HEADER_RE = b'"(_etag|_mod|_cache_control)":[ ]?"(.*?[^\\\\])"[,\}\s]'
diff --git a/conda/models/index_record.py b/conda/models/index_record.py
--- a/conda/models/index_record.py
+++ b/conda/models/index_record.py
@@ -26,7 +26,7 @@
from .enums import FileMode, LinkType, NoarchType, PackageType, PathType, Platform
from .._vendor.auxlib.collection import frozendict
from .._vendor.auxlib.entity import (BooleanField, ComposableField, DictSafeMixin, Entity,
- EnumField, IntegerField, ListField, MapField,
+ EnumField, IntegerField, ListField, MapField, NumberField,
StringField)
from ..base.context import context
from ..common.compat import isiterable, iteritems, itervalues, string_types, text_type
@@ -48,6 +48,15 @@ def box(self, instance, instance_type, val):
return super(NoarchField, self).box(instance, instance_type, NoarchType.coerce(val))
+class TimestampField(NumberField):
+
+ def box(self, instance, instance_type, val):
+ val = super(TimestampField, self).box(instance, instance_type, val)
+ if val and val > 253402300799: # 9999-12-31
+ val /= 1000 # convert milliseconds to seconds; see conda/conda-build#1988
+ return val
+
+
class Link(DictSafeMixin, Entity):
source = StringField()
type = LinkTypeField(LinkType, required=False)
| 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
@@ -133,5 +133,9 @@ def test_create_advanced_pip(self):
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)
+ try:
+ assert_package_is_installed(prefix, 'six', exact=False, pip=True)
+ except AssertionError:
+ # six may now be conda-installed because of packaging changes
+ assert_package_is_installed(prefix, 'six', exact=False, pip=False)
assert_package_is_installed(prefix, 'xmltodict-0.10.2-<pip>', exact=True, pip=True)
| Cannot open Anaconda Navigator
I have an issue when I try to open the Navigator. It throws an unexpected error occurred.
`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.3.21
conda is private : False
conda-env version : 4.3.21
conda-build version : not installed
python version : 3.6.1.final.0
requests version : 2.14.2
root environment : C:\Anaconda3 (writable)
default environment : C:\Anaconda3
envs directories : C:\Anaconda3\envs
C:\Users\John\AppData\Local\conda\conda\envs
C:\Users\John\.conda\envs
package cache : C:\Anaconda3\pkgs
C:\Users\John\AppData\Local\conda\conda\pkgs
channel URLs : https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
netrc file : None
offline mode : False
user-agent : conda/4.3.21 requests/2.14.2 CPython/3.6.1 Windows/10 Windows/10.0.15063
administrator : False
`$ C:\Anaconda3\Scripts\conda-script.py ..checkenv cmd.exe C:\Anaconda3`
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 167, in main
import conda.cli.activate as activate
File "C:\Anaconda3\lib\site-packages\conda\cli\activate.py", line 12, in <module>
from ..utils import shells
File "C:\Anaconda3\lib\site-packages\conda\utils.py", line 13, in <module>
from .gateways.disk.read import compute_md5sum
File "C:\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 22, in <module>
from ...models.channel import Channel
File "C:\Anaconda3\lib\site-packages\conda\models\channel.py", line 9, in <module>
from ..base.context import context
File "C:\Anaconda3\lib\site-packages\conda\base\context.py", line 18, in <module>
from .._vendor.auxlib.path import expand
File "C:\Anaconda3\lib\site-packages\conda\_vendor\auxlib\path.py", line 8, in <module>
import pkg_resources
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2985, in <module>
@_call_aside
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2971, in _call_aside
f(*args, **kwargs)
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 3013, in _initialize_master_working_set
dist.activate(replace=False)
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2544, in activate
declare_namespace(pkg)
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2118, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2058, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "C:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2087, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'`
| Related to #5500. | 2017-09-29T21:59:21 |
conda/conda | 6,076 | conda__conda-6076 | [
"5852"
] | b934b58893b19c6d3a0b16322d4f7c020f5edcaf | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -449,13 +449,12 @@ def _prepare(self, prepared_specs):
self._r = Resolve(self._index, channels=self.channels)
else:
# add in required channels that aren't explicitly given in the channels list
+ # For correctness, we should probably add to additional_channels any channel that
+ # is given by PrefixData(self.prefix).all_subdir_urls(). However that causes
+ # usability problems with bad / expired tokens.
+
additional_channels = set()
- # # TODO: probably necessary for correctness, but causes major issues with expired
- # # tokens and channels that no longer exist
- # additional_channels.update(
- # Channel(subdir_url) for subdir_url in PrefixData(self.prefix).all_subdir_urls()
- # )
- for spec in concatv(self.specs_to_remove, self.specs_to_add):
+ for spec in self.specs_to_add:
# TODO: correct handling for subdir isn't yet done
channel = spec.get_exact_value('channel')
if channel:
| conda-4.4.0rc0 channel history can break conda
If the user has a private local repo or the Anaconda Repository and the hostname/ip changed or is no longer valid, conda will refuse to install any packages.
This happens even if you update your `.condarc` to only have the defaults channel again.
```
$ conda list --explicit
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-64
@EXPLICIT
http://10.200.31.60:8081/conda/anaconda/osx-64/_license-1.1-py36_1.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/alabaster-0.7.10-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/anaconda-custom-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/anaconda-clean-1.1.0-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/anaconda-client-1.6.3-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/anaconda-navigator-1.6.3-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/anaconda-project-0.6.0-py36_0.tar.bz2
https://repo.continuum.io/pkgs/free/osx-64/appnope-0.1.0-py36_0.tar.bz2
...
```
Note that one package was installed via a private repo that is no longer running from that IP address/hostname.
When attempting to install any other package from the defaults channel
```
$ conda install cx_oracle
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <http://10.200.31.60:8081/conda/anaconda/noarch/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(MaxRetryError("HTTPConnectionPool(host='10.200.31.60', port=8081): Max retries exceeded with url: /conda/t/je-223eba05-93e2-42af-8024-606a6001e166/anaconda/noarch/repodata.json (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x1031433c8>: Failed to establish a new connection: [Errno 61] Connection refused',))",),)
```
It appears that it is trying to contact the dead repo from that one package even if its no longer one of the channels in `.condarc`
Conda Config
```
channels:
- defaults
ssl_verify: true
```
| Hi @kalefranz - ran into a potentially similar issue...
```
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\skearns>conda install pykerberos
Solving environment: failed
CondaHTTPError: HTTP 401 UNAUTHORIZED for url <https://conda.anaconda.org/t/st-6b47489e-788e-4fff-865e-fd86234cb04a/qttesting/win-64/repodata.json>
Elapsed: 00:00.094663
CF-RAY: 39076a57ce81116b-DFW
The token 'st-6b47489e-788e-4fff-865e-fd86234cb04a' given for the URL is invalid.
If this token was pulled from anaconda-client, you will need to use
anaconda-client to reauthenticate.
If you supplied this token to conda directly, you will need to adjust your
conda configuration to proceed.
Use `conda config --show` to view your configuration's current state.
Further configuration help can be found at <https://conda.io/docs/config.html>.
C:\Users\skearns>
```
@DonMacleans [suggested](https://github.com/conda/conda/issues/4738#issuecomment-320945550)
`conda config --set ssl_verify no`
which seems to work for me to get past this `HTTP 000 CONNECTION FAILED`
| 2017-10-04T21:56:15 |
|
conda/conda | 6,082 | conda__conda-6082 | [
"6057"
] | 98c3549429009de3c51cffc5e25753dfe83a7417 | diff --git a/conda/gateways/disk/create.py b/conda/gateways/disk/create.py
--- a/conda/gateways/disk/create.py
+++ b/conda/gateways/disk/create.py
@@ -238,7 +238,8 @@ def create_link(src, dst, link_type=LinkType.hardlink, force=False):
return
if not lexists(src):
- raise CondaError("Cannot link a source that does not exist. %s" % src)
+ raise CondaError("Cannot link a source that does not exist. %s\n"
+ "Running `conda clean --packages` may resolve your problem." % src)
if lexists(dst):
if not force:
| CondaError: Cannot link a source that does not exist. C:\Users\...\Anaconda3\Scripts\conda.exe
I get this error when trying to conda install tqdm. Pip install works fine. However, when trying conda install spacy, I still get the same error because the conda installation for spacy attempts to conda install tqdm.
| Do you still get the error after running `conda clean --all --yes`?
If you need additional help, please include more details. At a minimum, `conda info`, the command that gave the error, and the full stack trace. Whatever details are necessary to independently reproduce the issue you're seeing.
Thanks @kalefranz. I had tried `Conda clean --all`. The error went away when I updated everything with `conda update anaconda `
Had the same error and @AVSuni thank you so much! Also thanks to @kalefranz (it occured when installing spacy) | 2017-10-05T17:00:40 |
|
conda/conda | 6,085 | conda__conda-6085 | [
"6084"
] | 98c3549429009de3c51cffc5e25753dfe83a7417 | 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
@@ -377,9 +377,6 @@ def execute_config(args, parser):
bad = rc_config[key].__class__.__name__
from ..exceptions import CouldntParseError
raise CouldntParseError("key %r should be a list, not %s." % (key, bad))
- if key == 'default_channels' and rc_path != sys_rc_path:
- msg = "'default_channels' is only configurable for system installs"
- raise NotImplementedError(msg)
arglist = rc_config.setdefault(key, [])
if item in arglist:
# Right now, all list keys should not contain duplicates
| setting default_channels from CLI raises NotImplementedError
| 2017-10-05T19:16:16 |
||
conda/conda | 6,128 | conda__conda-6128 | [
"6096"
] | 8d5b26c24128ac88a725cd275250aa379f58eff0 | diff --git a/conda/models/index_record.py b/conda/models/index_record.py
--- a/conda/models/index_record.py
+++ b/conda/models/index_record.py
@@ -54,12 +54,31 @@ def box(self, instance, val):
class TimestampField(NumberField):
- def box(self, instance, val):
- val = super(TimestampField, self).box(instance, val)
- if val and val > 253402300799: # 9999-12-31
- val /= 1000 # convert milliseconds to seconds; see conda/conda-build#1988
+ @staticmethod
+ def _make_seconds(val):
+ if val:
+ val = int(val)
+ if val > 253402300799: # 9999-12-31
+ val //= 1000 # convert milliseconds to seconds; see conda/conda-build#1988
return val
+ # @staticmethod
+ # def _make_milliseconds(val):
+ # if val:
+ # val = int(val)
+ # if val < 253402300799: # 9999-12-31
+ # val *= 1000 # convert seconds to milliseconds
+ # return val
+
+ def box(self, instance, val):
+ return self._make_seconds(super(TimestampField, self).box(instance, val))
+
+ def unbox(self, instance, instance_type, val):
+ return self._make_seconds(super(TimestampField, self).unbox(instance, instance_type, val))
+
+ def dump(self, val):
+ return self._make_seconds(super(TimestampField, self).dump(val))
+
class Link(DictSafeMixin, Entity):
source = StringField()
| diff --git a/tests/models/test_index_record.py b/tests/models/test_index_record.py
new file mode 100644
--- /dev/null
+++ b/tests/models/test_index_record.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import, division, print_function, unicode_literals
+from logging import getLogger
+from math import floor
+
+from conda.models.index_record import IndexRecord
+
+log = getLogger(__name__)
+
+
+def test_index_record_timestamp():
+ # regression test for #6096
+ ts = 1507565728.999
+ rec = IndexRecord(
+ name='test-package',
+ version='1.2.3',
+ build='2',
+ build_number=2,
+ timestamp=ts
+ )
+ assert rec.timestamp == floor(ts)
+ assert rec.dump()['timestamp'] == floor(ts)
| ValidationError: invalid value for timestamp
MODERATOR EDIT: This issue relates to an error that looks something like
ValidationError: Invalid value 1505856869.685 for timestamp
The issue relates to using conda 4.3.28, and then downgrading (presumably via conda-forge) to a previous version of conda, like 4.3.27.
# SOLUTION #
### To fix on macOS:
# in the command below, set PATH_TO_ENVIRONMENT yourself
sed -i '' -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json
### To fix on Linux:
# in the command below, set PATH_TO_ENVIRONMENT yourself
sed -i -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json
### To fix on Windows:
Open notepad, and copy the contents below to `c:\fix_timestamps.py`
```python
PATH_TO_ENVIRONMENT="c:\\ProgramData\\Anaconda3" # <-- fill this in yourself
# backslashes must be doubled
from glob import glob
import json
import os
for path in glob(os.path.join(PATH_TO_ENVIRONMENT, 'conda-meta', '*.json')):
with open(path) as fh:
content = json.load(fh)
if 'timestamp' in content:
old_timestamp = content['timestamp']
content['timestamp'] = int(old_timestamp)
if old_timestamp != content['timestamp']:
with open(path, 'w') as fh:
fh.write(json.dumps(content, indent=2, sort_keys=True, separators=(',', ': ')))
```
Also, change the path in the variable `PATH_TO_ENVIRONMENT` to point to the conda environment you want to fix. Then run the script with `python c:\fix_timestamps.py`.
----
EDITED: I realized this is not a pyqt issue, it's a conda issue
### steps to reproduce
1. Install 64-bit miniconda on windows 10 (version 4.3.27)
2. conda update to `4.3.28-py36h9daa44c_0`
3. conda install -c anaconda spyder
4. conda config --add channels conda-forge
Now any calls to conda results in the print-out below.
### conda info
This prints any time I try to use a conda command.
```conda install -c dsdale24 pyqt5
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.3.27
conda is private : False
conda-env version : 4.3.27
conda-build version : not installed
python version : 3.6.2.final.0
requests version : 2.18.4
root environment : C:\Users\jrinker\Miniconda3 (writable)
default environment : C:\Users\jrinker\Miniconda3
envs directories : C:\Users\jrinker\Miniconda3\envs
C:\Users\jrinker\AppData\Local\conda\conda\envs
C:\Users\jrinker\.conda\envs
package cache : C:\Users\jrinker\Miniconda3\pkgs
C:\Users\jrinker\AppData\Local\conda\conda\pkgs
channel URLs : https://conda.anaconda.org/dsdale24/win-64
https://conda.anaconda.org/dsdale24/noarch
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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\jrinker\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/10 Windows/10.0.15063
administrator : False
`$ C:\Users\jrinker\Miniconda3\Scripts\conda install -c dsdale24 pyqt5`
Traceback (most recent call last):
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\exceptions.py", line 640, in conda_exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main.py", line 140, in _main
exit_code = args.func(args, p)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute
install(args, parser, 'install')
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\install.py", line 160, in install
linked_dists = install_linked(prefix)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 123, in linked
return set(linked_data(prefix, ignore_channels=ignore_channels).keys())
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 115, in linked_data
load_linked_data(prefix, dist_name, ignore_channels=ignore_channels)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 68, in load_linked_data
linked_data_[prefix][dist] = rec = IndexRecord(**rec)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 702, in __call__
instance = super(EntityType, cls).__call__(*args, **kwargs)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 719, in __init__
setattr(self, key, kwargs[key])
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 424, in __set__
instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 465, in validate
raise ValidationError(getattr(self, 'name', 'undefined name'), val)
conda._vendor.auxlib.exceptions.ValidationError: Invalid value 1505856869.685 for timestamp
```
### things I've tried
- Removing conda forge from channels
- `conda update conda` (still prints out error)
| @kalefranz, @msarahan, is this something to do with the * 1000 thing? Is there some code that's dividing these numbers back down again? Was such code every released in the wild?
v4.3.28 has this: https://github.com/conda/conda/commit/527c0d3c6d988ae44280b324da58950005f2bbdd
Python2 will:
```
>>> 1505856869685/1000
1505856869
```
Python3 will:
```
>>> 1505856869685/1000
1505856869.685
```
sorry, i dont understand. How should I fix it?
If the issue is line 60 in `conda/models/index_record.py`, then a possible bug fix is just changing it to
`val //= 1000`
But I don't know enough about the code to know if this is what should be changed.
The problems seems mushroming
#6106
#6107
#6103
#6105
We are working to identify the proper fix. We are removing conda 4.3.28 from defaults in the meantime to prevent any further breakage.
For those who are already affected by this bug, we are working to come up with a simple series of steps to restore your functionality.
@msarahan Hopefully it can be smoothly fixed without the need to reinstall everything.
@Lemmaho yes, that is most certainly our goal. @nehaljwani will be posting the fix he's been testing shortly. | 2017-10-09T16:25:58 |
conda/conda | 6,131 | conda__conda-6131 | [
"6096"
] | 8d5b26c24128ac88a725cd275250aa379f58eff0 | diff --git a/conda/models/index_record.py b/conda/models/index_record.py
--- a/conda/models/index_record.py
+++ b/conda/models/index_record.py
@@ -54,12 +54,33 @@ def box(self, instance, val):
class TimestampField(NumberField):
- def box(self, instance, val):
- val = super(TimestampField, self).box(instance, val)
- if val and val > 253402300799: # 9999-12-31
- val /= 1000 # convert milliseconds to seconds; see conda/conda-build#1988
+ # @staticmethod
+ # def _make_seconds(val):
+ # if val:
+ # val = int(val)
+ # if val > 253402300799: # 9999-12-31
+ # val //= 1000 # convert milliseconds to seconds; see conda/conda-build#1988
+ # return val
+
+ @staticmethod
+ def _make_milliseconds(val):
+ if val:
+ if val < 253402300799: # 9999-12-31
+ val *= 1000 # convert seconds to milliseconds
+ val = int(val)
return val
+ def box(self, instance, val):
+ return self._make_milliseconds(super(TimestampField, self).box(instance, val))
+
+ def unbox(self, instance, instance_type, val):
+ return self._make_milliseconds(
+ super(TimestampField, self).unbox(instance, instance_type, val)
+ )
+
+ def dump(self, val):
+ return self._make_milliseconds(super(TimestampField, self).dump(val))
+
class Link(DictSafeMixin, Entity):
source = StringField()
| diff --git a/tests/models/test_index_record.py b/tests/models/test_index_record.py
new file mode 100644
--- /dev/null
+++ b/tests/models/test_index_record.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import, division, print_function, unicode_literals
+from logging import getLogger
+
+from conda.models.index_record import IndexRecord
+
+log = getLogger(__name__)
+
+
+def test_index_record_timestamp():
+ # regression test for #6096
+ ts = 1507565728
+ new_ts = ts * 1000
+ rec = IndexRecord(
+ name='test-package',
+ version='1.2.3',
+ build='2',
+ build_number=2,
+ timestamp=ts
+ )
+ assert rec.timestamp == new_ts
+ assert rec.dump()['timestamp'] == new_ts
+
+ ts = 1507565728999
+ new_ts = ts
+ rec = IndexRecord(
+ name='test-package',
+ version='1.2.3',
+ build='2',
+ build_number=2,
+ timestamp=ts
+ )
+ assert rec.timestamp == new_ts
+ assert rec.dump()['timestamp'] == new_ts
+
| ValidationError: invalid value for timestamp
MODERATOR EDIT: This issue relates to an error that looks something like
ValidationError: Invalid value 1505856869.685 for timestamp
The issue relates to using conda 4.3.28, and then downgrading (presumably via conda-forge) to a previous version of conda, like 4.3.27.
# SOLUTION #
### To fix on macOS:
# in the command below, set PATH_TO_ENVIRONMENT yourself
sed -i '' -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json
### To fix on Linux:
# in the command below, set PATH_TO_ENVIRONMENT yourself
sed -i -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json
### To fix on Windows:
Open notepad, and copy the contents below to `c:\fix_timestamps.py`
```python
PATH_TO_ENVIRONMENT="c:\\ProgramData\\Anaconda3" # <-- fill this in yourself
# backslashes must be doubled
from glob import glob
import json
import os
for path in glob(os.path.join(PATH_TO_ENVIRONMENT, 'conda-meta', '*.json')):
with open(path) as fh:
content = json.load(fh)
if 'timestamp' in content:
old_timestamp = content['timestamp']
content['timestamp'] = int(old_timestamp)
if old_timestamp != content['timestamp']:
with open(path, 'w') as fh:
fh.write(json.dumps(content, indent=2, sort_keys=True, separators=(',', ': ')))
```
Also, change the path in the variable `PATH_TO_ENVIRONMENT` to point to the conda environment you want to fix. Then run the script with `python c:\fix_timestamps.py`.
----
EDITED: I realized this is not a pyqt issue, it's a conda issue
### steps to reproduce
1. Install 64-bit miniconda on windows 10 (version 4.3.27)
2. conda update to `4.3.28-py36h9daa44c_0`
3. conda install -c anaconda spyder
4. conda config --add channels conda-forge
Now any calls to conda results in the print-out below.
### conda info
This prints any time I try to use a conda command.
```conda install -c dsdale24 pyqt5
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.3.27
conda is private : False
conda-env version : 4.3.27
conda-build version : not installed
python version : 3.6.2.final.0
requests version : 2.18.4
root environment : C:\Users\jrinker\Miniconda3 (writable)
default environment : C:\Users\jrinker\Miniconda3
envs directories : C:\Users\jrinker\Miniconda3\envs
C:\Users\jrinker\AppData\Local\conda\conda\envs
C:\Users\jrinker\.conda\envs
package cache : C:\Users\jrinker\Miniconda3\pkgs
C:\Users\jrinker\AppData\Local\conda\conda\pkgs
channel URLs : https://conda.anaconda.org/dsdale24/win-64
https://conda.anaconda.org/dsdale24/noarch
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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\jrinker\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/10 Windows/10.0.15063
administrator : False
`$ C:\Users\jrinker\Miniconda3\Scripts\conda install -c dsdale24 pyqt5`
Traceback (most recent call last):
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\exceptions.py", line 640, in conda_exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main.py", line 140, in _main
exit_code = args.func(args, p)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute
install(args, parser, 'install')
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\install.py", line 160, in install
linked_dists = install_linked(prefix)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 123, in linked
return set(linked_data(prefix, ignore_channels=ignore_channels).keys())
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 115, in linked_data
load_linked_data(prefix, dist_name, ignore_channels=ignore_channels)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 68, in load_linked_data
linked_data_[prefix][dist] = rec = IndexRecord(**rec)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 702, in __call__
instance = super(EntityType, cls).__call__(*args, **kwargs)
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 719, in __init__
setattr(self, key, kwargs[key])
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 424, in __set__
instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))
File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 465, in validate
raise ValidationError(getattr(self, 'name', 'undefined name'), val)
conda._vendor.auxlib.exceptions.ValidationError: Invalid value 1505856869.685 for timestamp
```
### things I've tried
- Removing conda forge from channels
- `conda update conda` (still prints out error)
| @kalefranz, @msarahan, is this something to do with the * 1000 thing? Is there some code that's dividing these numbers back down again? Was such code every released in the wild?
v4.3.28 has this: https://github.com/conda/conda/commit/527c0d3c6d988ae44280b324da58950005f2bbdd
Python2 will:
```
>>> 1505856869685/1000
1505856869
```
Python3 will:
```
>>> 1505856869685/1000
1505856869.685
```
sorry, i dont understand. How should I fix it?
If the issue is line 60 in `conda/models/index_record.py`, then a possible bug fix is just changing it to
`val //= 1000`
But I don't know enough about the code to know if this is what should be changed.
The problems seems mushroming
#6106
#6107
#6103
#6105
We are working to identify the proper fix. We are removing conda 4.3.28 from defaults in the meantime to prevent any further breakage.
For those who are already affected by this bug, we are working to come up with a simple series of steps to restore your functionality.
@msarahan Hopefully it can be smoothly fixed without the need to reinstall everything.
@Lemmaho yes, that is most certainly our goal. @nehaljwani will be posting the fix he's been testing shortly. | 2017-10-09T18:35:44 |
conda/conda | 6,154 | conda__conda-6154 | [
"6023"
] | 98c3549429009de3c51cffc5e25753dfe83a7417 | diff --git a/conda_env/cli/main_list.py b/conda_env/cli/main_list.py
--- a/conda_env/cli/main_list.py
+++ b/conda_env/cli/main_list.py
@@ -14,7 +14,7 @@
def configure_parser(sub_parsers):
- l = sub_parsers.add_parser(
+ list_parser = sub_parsers.add_parser(
'list',
formatter_class=RawDescriptionHelpFormatter,
description=description,
@@ -22,9 +22,9 @@ def configure_parser(sub_parsers):
epilog=example,
)
- common.add_parser_json(l)
+ common.add_parser_json(list_parser)
- l.set_defaults(func=execute)
+ list_parser.set_defaults(func=execute)
def execute(args, parser):
| diff --git a/conda/gateways/disk/test.py b/conda/gateways/disk/test.py
--- a/conda/gateways/disk/test.py
+++ b/conda/gateways/disk/test.py
@@ -4,6 +4,7 @@
from logging import getLogger
from os import W_OK, access
from os.path import basename, dirname, isdir, isfile, join, lexists
+from uuid import uuid4
from .create import create_link
from .delete import rm_rf
@@ -11,6 +12,7 @@
from .read import find_first_existing
from ... import CondaError
from ..._vendor.auxlib.decorators import memoize
+from ...common.compat import text_type
from ...common.path import expand, get_python_short_path
from ...models.enums import LinkType
@@ -77,7 +79,7 @@ def hardlink_supported(source_file, dest_dir):
# file system configuration, a symbolic link may be created
# instead. If a symbolic link is created instead of a hard link,
# return False.
- test_file = join(dest_dir, '.tmp.' + basename(source_file))
+ test_file = join(dest_dir, '.tmp.%s.%s' % (basename(source_file), text_type(uuid4())[:8]))
assert isfile(source_file), source_file
assert isdir(dest_dir), dest_dir
if lexists(test_file):
| Scarpy
Current conda install:
platform : win-64
conda version : 4.3.21
conda is private : False
conda-env version : 4.3.21
conda-build version : not installed
python version : 3.6.1.final.0
requests version : 2.14.2
root environment : C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3 (writable)
default environment : C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3
envs directories : C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3\envs
C:\Users\dbsr7927\AppData\Local\conda\conda\envs
C:\Users\dbsr7927\.conda\envs
package cache : C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3\pkgs
C:\Users\dbsr7927\AppData\Local\conda\conda\pkgs
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
netrc file : None
offline mode : False
user-agent : conda/4.3.21 requests/2.14.2 CPython/3.6.1 Windows/10 Windows/10.0.14393
administrator : False
`$ C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3\Scripts\conda-script.py install -c conda-forge scrapy`
Traceback (most recent call last):
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\exceptions.py", line 632, in conda_exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\main.py", line 137, in _main
exit_code = args.func(args, p)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute
install(args, parser, 'install')
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\cli\install.py", line 357, in install
execute_actions(actions, index, verbose=not context.quiet)
File "C:\Users\dbsr7927\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\core\link.py", line 263, in execute
self.verify()
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\core\link.py", line 242, in verify
self.prepare()
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\core\link.py", line 149, in prepare
for pkg_info in self.packages_info_to_link)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\core\link.py", line 149, in <genexpr>
for pkg_info in self.packages_info_to_link)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\core\link.py", line 54, in determine_link_type
if hardlink_supported(source_test_file, target_prefix):
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\_vendor\auxlib\decorators.py", line 56, in _memoized_func
result = func(*args, **kwargs)
File "C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\conda\gateways\disk\test.py", line 84, in hardlink_supported
assert not lexists(test_file), test_file
AssertionError: C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\.tmp.index.json
| The code being executed here is
```python
if lexists(test_file):
rm_rf(test_file)
assert not lexists(test_file), test_file
```
We definitely still have problems with `rm_rf` on Windows, perhaps related to https://github.com/conda/conda/issues/5154.
I'm submitting a PR that might fix future issues of this particular assertion error. It's not going to fix our more general problem with `rm_rf` on windows.
In the meantime, just manually deleting `C:\Users\xxxx\AppData\Local\Continuum\Anaconda3\.tmp.index.json` should get you on your way. | 2017-10-12T16:20:32 |
conda/conda | 6,205 | conda__conda-6205 | [
"3962"
] | a8f3ce438379eaaba33864c25a2e05e703da3556 | diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -18,7 +18,7 @@
import warnings
from requests import ConnectionError, HTTPError
-from requests.exceptions import InvalidSchema, SSLError
+from requests.exceptions import InvalidSchema, ProxyError as RequestsProxyError, SSLError
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from .. import CondaError, iteritems
@@ -31,7 +31,7 @@
from ..common.url import join_url, maybe_unquote
from ..connection import CondaSession
from ..core.package_cache import PackageCache
-from ..exceptions import CondaDependencyError, CondaHTTPError, CondaIndexError
+from ..exceptions import CondaDependencyError, CondaHTTPError, CondaIndexError, ProxyError
from ..gateways.disk.delete import rm_rf
from ..gateways.disk.update import touch
from ..models.channel import Channel
@@ -160,6 +160,10 @@ def maybe_decompress(filename, resp_content):
add_http_value_to_dict(resp, 'Last-Modified', fetched_repodata, '_mod')
add_http_value_to_dict(resp, 'Cache-Control', fetched_repodata, '_cache_control')
return fetched_repodata
+
+ except RequestsProxyError:
+ raise ProxyError() # see #3962
+
except InvalidSchema as e:
if 'SOCKS' in text_type(e):
message = dals("""
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -267,9 +267,14 @@ def __init__(self, message):
class ProxyError(CondaError):
- def __init__(self, message):
- msg = '%s' % message
- super(ProxyError, self).__init__(msg)
+ def __init__(self):
+ message = dals("""
+ Conda cannot proceed due to an error in your proxy configuration.
+ Check for typos and other configuration errors in any '.netrc' file in your home directory,
+ any environment variables ending in '_PROXY', and any other system-wide proxy
+ configuration settings.
+ """)
+ super(ProxyError, self).__init__(message)
class CondaIOError(CondaError, IOError):
diff --git a/conda/gateways/download.py b/conda/gateways/download.py
--- a/conda/gateways/download.py
+++ b/conda/gateways/download.py
@@ -7,7 +7,8 @@
from threading import Lock
import warnings
-from requests.exceptions import ConnectionError, HTTPError, InvalidSchema, SSLError
+from requests.exceptions import (ConnectionError, HTTPError, InvalidSchema,
+ ProxyError as RequestsProxyError, SSLError)
from .. import CondaError
from .._vendor.auxlib.ish import dals
@@ -16,7 +17,7 @@
from ..common.compat import text_type
from ..connection import CondaSession
from ..exceptions import (BasicClobberError, CondaDependencyError, CondaHTTPError,
- MD5MismatchError, maybe_raise)
+ MD5MismatchError, maybe_raise, ProxyError)
log = getLogger(__name__)
@@ -117,6 +118,8 @@ def download(url, target_full_path, md5sum):
log.debug("MD5 sums mismatch for download: %s (%s != %s), "
"trying again" % (url, digest_builder.hexdigest(), md5sum))
raise MD5MismatchError(url, target_full_path, md5sum, actual_md5sum)
+ except RequestsProxyError:
+ raise ProxyError() # see #3962
except InvalidSchema as e:
if 'SOCKS' in text_type(e):
| Cannot install packages after fresh install
Hi there,
I keep getting this error message, whenever I try to install any package after a fresh miniconda install.
Any help would be very much appreciated.
Thanks in advance!
--
Current conda install:
platform : linux-64
conda version : 4.2.12
conda is private : False
conda-env version : 4.2.12
conda-build version : not installed
python version : 3.5.2.final.0
requests version : 2.11.1
root environment : /home/pichama3/miniconda3 (writable)
default environment : /home/pichama3/miniconda3
envs directories : /home/pichama3/miniconda3/envs
package cache : /home/pichama3/miniconda3/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/pichama3/miniconda3/bin/conda install snakemake`
Traceback (most recent call last):
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main
exit_code = args.func(args, p)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/cli/install.py", line 238, in install
prefix=prefix)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/api.py", line 24, in get_index
index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/fetch.py", line 310, in fetch_index
repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/fetch.py", line 310, in <listcomp>
repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
File "/home/pichama3/miniconda3/lib/python3.5/concurrent/futures/_base.py", line 405, in result
return self.__get_result()
File "/home/pichama3/miniconda3/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
raise self._exception
File "/home/pichama3/miniconda3/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/fetch.py", line 74, in func
res = f(*args, **kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/conda/fetch.py", line 116, in fetch_repodata
timeout=(3.05, 60))
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 589, in urlopen
self._prepare_proxy(conn)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 797, in _prepare_proxy
conn.connect()
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 254, in connect
conn = self._new_conn()
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/home/pichama3/miniconda3/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 66, in create_connection
if host.startswith('['):
AttributeError: 'NoneType' object has no attribute 'startswith'
| Probably an issue with requests, fixed with a requests update.
Reopened this ticket, because it's the first report of several duplicate issues.
From https://github.com/conda/conda/issues/4724#issuecomment-282239443:
> My bad. I'd managed to remove one of the forward slashes of the proxy in the .condarc file. (https:/ instead of https://)
For anyone having this issue, please investigate your proxy configuration. Also if you find an error, report back on the details of where you configured in an error, so that we can help give conda better error messages in the future.
@kalefranz
I tried print the proxies used at runtime, and got this:
**OrderedDict([('http', 'http://'), ('https', 'https://'), ('ftp', 'ftp://')])**
That proxies are from **requests.adapters:get_connection** function's parameter. Then the **select_proxy** will select ('https', 'https://') as proxy, that's why no host in following steps.
I don't have any VPN enabled, and there's no proxy in Windows system when executing conda.
For now, I just add one statement in **HTTPSConnectionPool._new_conn** function to hide proxy, and it works:
![image](https://user-images.githubusercontent.com/8531280/31279416-978988c8-aadb-11e7-877b-4e6206298ddc.png)
I think the proxies passed to requests.adapters may have some problems, but I don't have more time on debugging it. The no-proxy solution works fine for now, but it won't be final solution.
Following are my debug info, hope can do something useful
DEBUG conda.core.index:fetch_index(114): channel_urls=OrderedDict([('https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64', ('https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free', 0)), ('https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch', ('https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free', 0)), ('https://repo.continuum.io/pkgs/main/win-64', ('defaults', 1)), ('https://repo.continuum.io/pkgs/main/noarch', ('defaults', 1)), ('https://repo.continuum.io/pkgs/free/win-64', ('defaults', 2)), ('https://repo.continuum.io/pkgs/free/noarch', ('defaults', 2)), ('https://repo.continuum.io/pkgs/r/win-64', ('defaults', 3)), ('https://repo.continuum.io/pkgs/r/noarch', ('defaults', 3)), ('https://repo.continuum.io/pkgs/pro/win-64', ('defaults', 4)), ('https://repo.continuum.io/pkgs/pro/noarch', ('defaults', 4)), ('https://repo.continuum.io/pkgs/msys2/win-64', ('defaults', 5)), ('https://repo.continuum.io/pkgs/msys2/noarch', ('defaults', 5))])
Fetching package metadata ...DEBUG urllib3.util.retry:from_int(200): Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
DEBUG conda.core.repodata:fetch_repodata(458): Locally invalidating cached repodata for https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64 at C:\Users\Fox\Anaconda3\pkgs\cache\a2eb941d.json
DEBUG requests.utils:select_proxy(707):
FOXADDED urlparts.hostname:mirrors.tuna.tsinghua.edu.cn
DEBUG requests.adapters:get_connection(302):
FOXADDED url:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/repodata.json proxy.host : https:// proxies:OrderedDict([('http', 'http://'), ('https', 'https://'), ('ftp', 'ftp://')])
DEBUG urllib3.poolmanager:connection_from_url(279):
FOXADDED url->https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/repodata.json host->mirrors.tuna.tsinghua.edu.cn scheme->https
DEBUG urllib3.poolmanager:connection_from_host(217):
FOXADDED host->mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connectionpool:__init__(184):
FOXADDED proxy.host : None
DEBUG requests.adapters:get_connection(313):
FOXADDED conn.host->mirrors.tuna.tsinghua.edu.cn
DEBUG requests.utils:select_proxy(707):
FOXADDED urlparts.hostname:mirrors.tuna.tsinghua.edu.cn
DEBUG requests.adapters:send(413):
FOXADDED url->/anaconda/pkgs/free/win-64/repodata.json
DEBUG requests.adapters:send(414):
FOXADDED conn.proxy->https://:443 conn.host->mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connectionpool:_new_conn(827): Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connection:__init__(222):
FOXADDED --> 6 host: mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connection:__init__(107):
FOXADDED -->1
DEBUG urllib3.connection:set_cert(276):
FOXADDED -->8 assert_hostname: None
DEBUG urllib3.connectionpool:urlopen(594):
FOXADDED conn.host->mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connection:connect(292):
FOXADDED -->9 self.host: mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connection:_new_conn(134):
FOXADDED -->2 self.host: mirrors.tuna.tsinghua.edu.cn
DEBUG urllib3.connection:_match_hostname(366):
FOXADDED -->10 | 2017-10-20T20:00:10 |
|
conda/conda | 6,221 | conda__conda-6221 | [
"6220"
] | ddf0446e73bcfc889f653d5d08b34bacfd9764ac | diff --git a/conda_env/env.py b/conda_env/env.py
--- a/conda_env/env.py
+++ b/conda_env/env.py
@@ -48,9 +48,9 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False):
pip_pkgs = sorted(installed - conda_pkgs)
if no_builds:
- dependencies = ['='.join(a.quad[0:3]) for a in sorted(conda_pkgs)]
+ dependencies = ['='.join((a.name, a.version)) for a in sorted(conda_pkgs)]
else:
- dependencies = ['='.join(a.quad[0:3]) for a in sorted(conda_pkgs)]
+ dependencies = ['='.join((a.name, a.version, a.build)) for a in sorted(conda_pkgs)]
if len(pip_pkgs) > 0:
dependencies.append({'pip': ['=='.join(a.rsplit('-', 2)[:2]) for a in pip_pkgs]})
# conda uses ruamel_yaml which returns a ruamel_yaml.comments.CommentedSeq
| diff --git a/tests/conda_env/test_cli.py b/tests/conda_env/test_cli.py
--- a/tests/conda_env/test_cli.py
+++ b/tests/conda_env/test_cli.py
@@ -8,6 +8,7 @@
from conda_env.exceptions import SpecNotFound
from conda_env.cli.main import create_parser
+from conda_env.yaml import load as yaml_load
from conda.base.context import context
from conda.base.constants import ROOT_ENV_NAME
@@ -243,7 +244,7 @@ def test_create_env(self):
run_conda_command(Commands.CREATE, test_env_name_2)
self.assertTrue(env_is_created(test_env_name_2))
- def test_export(self):
+ def test_env_export(self):
"""
Test conda env export
"""
@@ -257,11 +258,20 @@ def test_export(self):
env_yaml.write(snowflake)
env_yaml.flush()
env_yaml.close()
+
run_env_command(Commands.ENV_REMOVE, test_env_name_2)
self.assertFalse(env_is_created(test_env_name_2))
run_env_command(Commands.ENV_CREATE, env_yaml.name)
self.assertTrue(env_is_created(test_env_name_2))
+ # regression test for #6220
+ snowflake, e, = run_env_command(Commands.ENV_EXPORT, test_env_name_2, '--no-builds')
+ assert not e.strip()
+ env_description = yaml_load(snowflake)
+ assert len(env_description['dependencies'])
+ for spec_str in env_description['dependencies']:
+ assert spec_str.count('=') == 1
+
def test_list(self):
"""
Test conda list -e and conda create from txt
| Add flag to build environment.yml without build strings
https://gitter.im/conda/conda?at=59ef54ebe44c43700a70e9a4
https://twitter.com/drvinceknight/status/922837449092542464?ref_src=twsrc%5Etfw
> Due to hashes of packages being introduced in `envinronment.yml` I'm getting all sorts of issues with building envs from file. (Very new problem)
| Actually, looks like the flag might already be there as `--no-builds`
```
kfranz@0283:~/continuum/conda *4.3.x ❯ /conda/bin/conda env export --help
usage: conda-env export [-h] [-c CHANNEL] [--override-channels]
[-n ENVIRONMENT | -p PATH] [-f FILE] [--no-builds]
[--ignore-channels] [--json] [--debug] [--verbose]
Export a given environment
Options:
optional arguments:
-h, --help Show this help message and exit.
-c CHANNEL, --channel CHANNEL
Additional channel to include in the export
--override-channels Do not include .condarc channels
-n ENVIRONMENT, --name ENVIRONMENT
Name of environment (in
/conda/envs:/Users/kfranz/.conda/envs).
-p PATH, --prefix PATH
Full path to environment prefix (default: /conda).
-f FILE, --file FILE
--no-builds Remove build specification from dependencies
--ignore-channels Do not include channel names with package names.
--json Report all output as json. Suitable for using conda
programmatically.
--debug Show debug output.
--verbose, -v Use once for info, twice for debug, three times for
trace.
examples:
conda env export
conda env export --file SOME_FILE
```
But the `--no-builds` flag appears not to work, based on a spot test. | 2017-10-24T17:09:02 |
conda/conda | 6,274 | conda__conda-6274 | [
"6243"
] | 478137a45fcd12c80d93a441ecd4528535967c1a | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -282,7 +282,13 @@ def root_dir(self):
@property
def root_writable(self):
from ..gateways.disk.test import prefix_is_writable
- return prefix_is_writable(self.root_prefix)
+ try:
+ return prefix_is_writable(self.root_prefix)
+ except CondaError:
+ # With pyinstaller, conda code can sometimes be called even though sys.prefix isn't
+ # a conda environment with a conda-meta/ directory. In this case, it's safe to return
+ # False, because conda shouldn't itself be mutating that environment. See #6243
+ return False
@property
def envs_dirs(self):
| diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -191,7 +191,7 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
def test_activate_deactivate(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 11, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2018, 1, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
@@ -208,7 +208,7 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
def test_activate_root_simple(shell):
- if shell == "bash.exe" and datetime.now() < datetime(2017, 11, 1):
+ if shell == "bash.exe" and datetime.now() < datetime(2018, 1, 1):
pytest.xfail("fix this soon")
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -552,7 +552,7 @@ def test_remove_all(self):
assert not exists(prefix)
@pytest.mark.skipif(on_win, reason="nomkl not present on windows")
- @pytest.mark.xfail(conda.__version__.startswith('4.3') and datetime.now() < datetime(2017, 11, 1), reason='currently broken in 4.3')
+ @pytest.mark.xfail(conda.__version__.startswith('4.3') and datetime.now() < datetime(2018, 1, 1), reason='currently broken in 4.3')
def test_remove_features(self):
with make_temp_env("python=2 numpy nomkl") as prefix:
assert exists(join(prefix, PYTHON_BINARY))
@@ -701,7 +701,7 @@ def test_update_deps_flag_absent(self):
assert package_is_installed(prefix, 'itsdangerous-0.23')
assert package_is_installed(prefix, 'flask')
- @pytest.mark.xfail(datetime.now() < datetime(2017, 11, 1), reason="#5263", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2018, 1, 1), reason="#5263", strict=True)
def test_update_deps_flag_present(self):
with make_temp_env("python=2 itsdangerous=0.23") as prefix:
assert package_is_installed(prefix, 'python-2')
diff --git a/tests/test_export.py b/tests/test_export.py
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -31,7 +31,7 @@ def test_basic(self):
output2, error= run_command(Commands.LIST, prefix2, "-e")
self.assertEqual(output, output2)
- @pytest.mark.xfail(datetime.now() < datetime(2017, 11, 1), reason="Bring back `conda list --export` #3445", strict=True)
+ @pytest.mark.xfail(datetime.now() < datetime(2018, 1, 1), reason="Bring back `conda list --export` #3445", strict=True)
def test_multi_channel_export(self):
"""
When try to import from txt
diff --git a/tests/test_priority.py b/tests/test_priority.py
--- a/tests/test_priority.py
+++ b/tests/test_priority.py
@@ -15,7 +15,7 @@
class PriorityIntegrationTests(TestCase):
@pytest.mark.skipif(on_win, reason="xz packages are different on windows than unix")
- @pytest.mark.skipif(conda.__version__.startswith('4.3') and datetime.now() < datetime(2017, 11, 1),
+ @pytest.mark.skipif(conda.__version__.startswith('4.3') and datetime.now() < datetime(2018, 1, 1),
reason='currently broken in 4.3')
def test_channel_order_channel_priority_true(self):
with make_temp_env("python=3.5 pycosat==0.6.1") as prefix:
| test.py error "prefix is not writeable"
While attempting to use "pyinstaller" to create a standalone conda-index executable, the resulting binary failed in “conda/gateways/disk/test.py” prefix_is_writable because that method assumes the prefix is a python root directory, and in the case of the standalone, the “prefix” is the executable’s current directory. If I add append sys.executable to the end of the “find_first_existing” call parameter list, then it worked as expected.
Of course, this particular writability check seems unnecessary for conda-index, because the only writing is to the target, not the conda-meta directory.
Any change that would allow the creation of a standalone conda-index is appreciated.
| Adding @msarahan since we had an email conversation about this
Hey @tomashek, not opposed to adding `sys.executable` at the moment. It's possible it won't be completely future proof though, and it might be better to understand why conda-build's index needs to call that function. Can you attach the stack trace for the failure so we can see the code path?
Here is the stacktrace. Note that pyinstaller bundles the necessary files into a self-extracting executable that extracts to /tmp then executes the script from that location. That's why you see '/tmp/_MEI5zjz52' as the prefix. The first stack is only the relevant conda files. I also included the full stack trace that has the pyinstaller wrappers as well:
Traceback (most recent call last):
File "conda-index.py", line 7, in <module>
File "site-packages/conda_build/cli/main_index.py", line 7, in <module>
File "site-packages/conda_build/conda_interface.py", line 44, in <module>
File "site-packages/conda/exports.py", line 75, in <module>
File "site-packages/conda/config.py", line 70, in <module>
File "site-packages/conda/base/context.py", line 285, in root_writable
File "site-packages/conda/gateways/disk/test.py", line 70, in prefix_is_writable
conda.CondaError: Unable to determine if prefix '/tmp/_MEI5zjz52' is writable.
[19264] Failed to execute script conda-index
Traceback (most recent call last):
File "conda-index.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "/localdisk/work/miniconda3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/conda_build/cli/main_index.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "/localdisk/work/miniconda3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/conda_build/conda_interface.py", line 44, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "/localdisk/work/miniconda3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/conda/exports.py", line 75, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "/localdisk/work/miniconda3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/conda/config.py", line 70, in <module>
File "site-packages/conda/base/context.py", line 285, in root_writable
File "site-packages/conda/gateways/disk/test.py", line 70, in prefix_is_writable
conda.CondaError: Unable to determine if prefix '/tmp/_MEI5zjz52' is writable.
[19264] Failed to execute script conda-index
@kalefranz, any other ideas on a fix? Can the writability check be avoided for this operation? | 2017-11-07T19:37:26 |
conda/conda | 6,275 | conda__conda-6275 | [
"5680"
] | b934b58893b19c6d3a0b16322d4f7c020f5edcaf | diff --git a/conda_env/cli/main_create.py b/conda_env/cli/main_create.py
--- a/conda_env/cli/main_create.py
+++ b/conda_env/cli/main_create.py
@@ -110,7 +110,7 @@ def execute(args, parser):
sys.stderr.write(textwrap.dedent("""
Unable to install package for {0}.
- Please double check and ensure you dependencies file has
+ Please double check and ensure your dependencies file has
the correct spelling. You might also try installing the
conda-env-{0} package to see if provides the required
installer.
diff --git a/conda_env/env.py b/conda_env/env.py
--- a/conda_env/env.py
+++ b/conda_env/env.py
@@ -9,6 +9,7 @@
from conda.cli import common # TODO: this should never have to import form conda.cli
from conda.common.serialize import yaml_load
from conda.core.linked_data import linked
+from conda.models.match_spec import MatchSpec
from conda_env.yaml import dump
from . import compat, exceptions, yaml
from .pip_util import add_pip_installed
@@ -102,6 +103,12 @@ def parse(self):
else:
self['conda'].append(common.arg2spec(line))
+ if 'pip' in self:
+ if not self['pip']:
+ del self['pip']
+ if not any(MatchSpec(s).name == 'pip' for s in self['conda']):
+ self['conda'].append('pip')
+
# TODO only append when it's not already present
def add(self, package_name):
self.raw.append(package_name)
| diff --git a/tests/conda_env/test_env.py b/tests/conda_env/test_env.py
--- a/tests/conda_env/test_env.py
+++ b/tests/conda_env/test_env.py
@@ -90,7 +90,7 @@ def test_other_tips_of_dependencies_are_supported(self):
dependencies=['nltk', {'pip': ['foo', 'bar']}]
)
expected = OrderedDict([
- ('conda', ['nltk']),
+ ('conda', ['nltk', 'pip']),
('pip', ['foo', 'bar'])
])
self.assertEqual(e.dependencies, expected)
| Trivial pip subsection breaks conda env create
I observe that an empty-but-present pip subsection under dependencies breaks `conda env create`. I expect this command to run as if the `- pip:` subsection was not present.
```
$ cat environment.yml
dependencies:
- pip:
$ conda env create -n recreate --file=environment.yml
Fetching package metadata ...........
Solving package specifications: 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.3.13
conda is private : False
conda-env version : 4.3.13
conda-build version : 2.1.5
python version : 3.5.2.final.0
requests version : 2.13.0
root environment : /opt/ts/services/miniconda.ext_public_miniconda/dist (read only)
default environment : /opt/ts/services/miniconda.ext_public_miniconda/dist
envs directories : /nas/dft/ire/rhys/envs
/opt/ts/services/miniconda.ext_public_miniconda/dist/envs
/home/rhys/.conda/envs
package cache : /opt/ts/services/miniconda.ext_public_miniconda/dist/pkgs
/home/rhys/.conda/pkgs
channel URLs : http://python3.app.twosigma.com/conda/twosigma.com/ts/linux-64
http://python3.app.twosigma.com/conda/twosigma.com/ts/noarch
http://python3.app.twosigma.com/conda/twosigma.com/ext/linux-64
http://python3.app.twosigma.com/conda/twosigma.com/ext/noarch
http://python3.app.twosigma.com/conda/repo.continuum.io/pkgs/free/linux-64
http://python3.app.twosigma.com/conda/repo.continuum.io/pkgs/free/noarch
http://python3.app.twosigma.com/conda/repo.continuum.io/pkgs/pro/linux-64
http://python3.app.twosigma.com/conda/repo.continuum.io/pkgs/pro/noarch
config file : /home/rhys/.condarc
offline mode : False
user-agent : conda/4.3.13 requests/2.13.0 CPython/3.5.2 Linux/4.1.35-pv-ts2 debian/7.10 glibc/2.13
UID:GID : 11082:5000
`$ /opt/ts/services/miniconda.ext_public_miniconda/dist/bin/conda-env create -n recreate --file=environment.yml`
Traceback (most recent call last):
File "/opt/ts/services/miniconda.ext_public_miniconda/dist/lib/python3.5/site-packages/conda/exceptions.py", line 591, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/opt/ts/services/miniconda.ext_public_miniconda/dist/lib/python3.5/site-packages/conda_env/cli/main_create.py", line 108, in execute
installer.install(prefix, pkg_specs, args, env)
File "/opt/ts/services/miniconda.ext_public_miniconda/dist/lib/python3.5/site-packages/conda_env/installers/pip.py", line 8, in install
pip_cmd = pip_args(prefix) + ['install', ] + specs
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
```
| Same here, that's because `pip_args` [returns `None`](https://github.com/conda/conda/blob/master/conda_env/pip_util.py#L38) when pip is not installed; While it's actually used find the [pip command and chains it with arguments](https://github.com/conda/conda/blob/master/conda_env/installers/pip.py#L40).
These seem to be used in [main_create](https://github.com/conda/conda/blob/master/conda_env/cli/main_update.py#L107) and [main_update](https://github.com/conda/conda/blob/master/conda_env/cli/main_update.py#L107) without proper checking (or requirement) for the installer to be available.
Can you verify that this is still a bug as of conda 4.3.30? 4.3.13 is very old at this point.
> Can you verify that this is still a bug as of conda 4.3.30? 4.3.13 is very old at this point.
Sorry , I tested on the latest without saying it;
```
$ conda env create -n whatever -f foo.yml
Using Anaconda API: https://api.anaconda.org
Fetching package metadata .............
Solving package specifications: .
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 : osx-64
conda version : 4.3.30
conda is private : False
conda-env version : 4.3.30
conda-build version : 2.1.17
python version : 3.6.3.final.0
requests version : 2.18.4
root environment : /Users/bussonniermatthias/anaconda (writable)
default environment : /Users/bussonniermatthias/anaconda
envs directories : /Users/bussonniermatthias/anaconda/envs
/Users/bussonniermatthias/.conda/envs
package cache : /Users/bussonniermatthias/anaconda/pkgs
/Users/bussonniermatthias/.conda/pkgs
channel URLs : https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
config file : /Users/bussonniermatthias/.condarc
netrc file : /Users/bussonniermatthias/.netrc
offline mode : False
user-agent : conda/4.3.30 requests/2.18.4 CPython/3.6.3 Darwin/16.7.0 OSX/10.12.6
UID:GID : 501:20
`$ /Users/bussonniermatthias/anaconda/bin/conda-env create -n whatever -f foo.yml`
Traceback (most recent call last):
File "/Users/bussonniermatthias/anaconda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/Users/bussonniermatthias/anaconda/lib/python3.6/site-packages/conda_env/cli/main_create.py", line 108, in execute
installer.install(prefix, pkg_specs, args, env)
File "/Users/bussonniermatthias/anaconda/lib/python3.6/site-packages/conda_env/installers/pip.py", line 8, in install
pip_cmd = pip_args(prefix) + ['install', ] + specs
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
$ cat foo.yml
name: whatever
channels:
- conda-forge
dependencies:
- python=3.6
- ipython
#- pip # uncomment and it works
- pip:
- toml
```
The example I give for env.yml is the the trivial one (just to make sure install still works), but the reason is the same; the place I linked to in my previous comment don't check for None (hence the crash), and arguably `pip_args` should maybe also be type stable.
Same thing happen with updating an env.
Also, please consider making pip a default package. The number of users that
```
$ conda create env
$ source activate env
(env) $ pip install <whatever>
```
And don't understand why whatever is not working is large. Even I, who know what' going on get confused sometime; At least inject a fake `pip` executabe that just return a status of -1 and print "please conda install pip".
| 2017-11-07T21:36:36 |
conda/conda | 6,277 | conda__conda-6277 | [
"6057"
] | d75d6a6a89049fb71d13b8eb0d719c0cf0937f3b | diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -6,11 +6,12 @@
from .base.constants import CONDA_TARBALL_EXTENSION, DEFAULTS_CHANNEL_NAME, MAX_CHANNEL_PRIORITY
from .base.context import context
-from .common.compat import iteritems, iterkeys, itervalues, string_types
+from .common.compat import iteritems, iterkeys, itervalues, on_win, string_types
from .common.io import time_recorder
from .exceptions import CondaValueError, ResolvePackageNotFound, UnsatisfiableError
from .logic import Clauses, minimal_unsatisfiable_subset
from .models.dist import Dist
+from .models.enums import NoarchType
from .models.index_record import IndexRecord
from .toposort import toposort
from .version import VersionSpec, normalized_version
@@ -698,11 +699,29 @@ def dependency_sort(self, must_have):
# type: (Dict[package_name, Dist]) -> List[Dist]
assert isinstance(must_have, dict)
- digraph = {}
- for key, dist in iteritems(must_have):
+ digraph = {} # Dict[package_name, Set[dependent_package_names]]
+ for package_name, dist in iteritems(must_have):
if dist in self.index:
- depends = set(ms.name for ms in self.ms_depends(dist))
- digraph[key] = depends
+ digraph[package_name] = set(ms.name for ms in self.ms_depends(dist))
+
+ # There are currently at least three special cases to be aware of.
+ # 1. The `toposort()` function, called below, contains special case code to remove
+ # any circular dependency between python and pip.
+ # 2. conda/plan.py has special case code for menuinst
+ # Always link/unlink menuinst first/last on windows in case a subsequent
+ # package tries to import it to create/remove a shortcut
+ # 3. On windows, python noarch packages need an implicit dependency on conda added, if
+ # conda is in the list of packages for the environment. Python noarch packages
+ # that have entry points use conda's own conda.exe python entry point binary. If conda
+ # is going to be updated during an operation, the unlink / link order matters.
+ # See issue #6057.
+
+ if on_win and 'conda' in digraph:
+ for package_name, dist in iteritems(must_have):
+ record = self.index.get(dist)
+ if hasattr(record, 'noarch') and record.noarch == NoarchType.python:
+ digraph[package_name].add('conda')
+
sorted_keys = toposort(digraph)
must_have = must_have.copy()
# Take all of the items in the sorted keys
| CondaError: Cannot link a source that does not exist. C:\Users\...\Anaconda3\Scripts\conda.exe
I get this error when trying to conda install tqdm. Pip install works fine. However, when trying conda install spacy, I still get the same error because the conda installation for spacy attempts to conda install tqdm.
| Do you still get the error after running `conda clean --all --yes`?
If you need additional help, please include more details. At a minimum, `conda info`, the command that gave the error, and the full stack trace. Whatever details are necessary to independently reproduce the issue you're seeing.
Thanks @kalefranz. I had tried `Conda clean --all`. The error went away when I updated everything with `conda update anaconda `
Had the same error and @AVSuni thank you so much! Also thanks to @kalefranz (it occured when installing spacy)
We've run into this with nbconvert as well. I setup [a repo](https://github.com/minrk/debug-conda-appveyor) to do some testing:
On AppVeyor, installing nbconvert from conda-forge has started failing with:
```
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::nbconvert-5.3.1-py_1'.
CondaError: Cannot link a source that does not exist. C:\Miniconda-x64\Scripts\conda.exe
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\Miniconda-x64\Scripts\conda.exe
```
Possibly relevant bits of info:
- `conda clean --all` does not help
- Failure only occurs on [Windows + Python 2](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.9)
- It only occurs when conda is upgraded or downgraded during the same install. Disabling auto_update_conda [fixes the issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.10)
- Appears to be a regression between conda [4.3.8](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.21) and [4.3.9](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.22)
- nbconvert has `noarch: python` and an entry-point, as does tqdm
- installing last nbconvert release prior to noarch [has no issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.11)
- installing other, lighter packages with noarch + entrypoint (geojsonio) [doesn't reproduce the issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.6) so there might be something else special about nbconvert+tqdm, or it could just be the ordering of packages causing the correct sequence of events to occur that `conda.exe` is removed while it's attempted to be linked.
I'm seeing this in damianavila/RISE#315 on win64 / py36 / conda 4.3.22
`conda clean --all` doesn't help - same error.
Reverting to `conda=4.2.16` *"fixed"* the problem for me.
Whereby *"fixed"* means the broken post-install script didn't run. That was easily fixed with a `jupyter nbextension enable ...` command so perhaps thre should be an `--ignore-errors` flag to allow users to proceed at their own risk rather than forcing them to downgrade conda to do so.
Hi all, I've run into this issue while trying to install the "tweepy" package. [win10 / conda 4.3.30 / Python 3.6.3]
Command: `conda install -c conda-forge tweepy`
**Error:**
oauthlib-2.0.6 100% |###############################| Time: 0:00:00 0.00 B/s
conda-4.3.29-p 100% |###############################| Time: 0:00:00 3.20 MB/s
requests-oauth 100% |###############################| Time: 0:00:00 0.00 B/s
tweepy-3.5.0-p 100% |###############################| Time: 0:00:00 3.37 MB/s
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::pyjwt-1.5.3-py_0'.
CondaError: Cannot link a source that does not exist. C:\Users\Maurice\Anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\Users\Maurice\Anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
**Error End**
I tried the above steps of `conda clean --all --yes` and `conda update anaconda` but I didn't have any success.
Any recommendations on what else I could try? Thanks.
It's clear to me that this is an issue with entry point creation for python noarch packages on windows. Looking into it.
> or it could just be the ordering of packages causing the correct sequence of events to occur that conda.exe is removed while it's attempted to be linked.
That's exactly what's happening.
```
DEBUG conda.core.link:create_from_dists(119): instantiating UnlinkLinkTransaction with
target_prefix: C:\Users\builder\Miniconda3
unlink_dists:
defaults::conda-4.3.24-py36_0
defaults::conda-env-2.6.0-0
defaults::openssl-1.0.2l-vc14_0
link_dists:
conda-forge::ca-certificates-2017.7.27.1-0
conda-forge::conda-env-2.6.0-0
conda-forge::openssl-1.0.2l-vc14_0
conda-forge::vc-14-0
conda-forge::pyjwt-1.5.3-py_0
conda-forge::conda-4.3.29-py36_0
```
Sometime around 4.3.8, we removed the embedded `cli-64.exe` / `cli-32.exe` files like what's in conda-build (https://github.com/conda/conda-build/tree/master/conda_build), realizing we already had the identical python entry point binary already available with conda.exe.
As you can see in the above operation plan, conda is unlinked, but then installed last, after pyjwt, which is what needs the entry point binary to hard link. | 2017-11-08T02:23:12 |
|
conda/conda | 6,295 | conda__conda-6295 | [
"6220",
"6243"
] | 824ffae0ae9344a99343fe7aafbcefa89a74544c | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -11,7 +11,7 @@
from .constants import (APP_NAME, DEFAULTS_CHANNEL_NAME, DEFAULT_CHANNELS, DEFAULT_CHANNEL_ALIAS,
ERROR_UPLOAD_URL, PLATFORM_DIRECTORIES, PathConflict, ROOT_ENV_NAME,
SEARCH_PATH, SafetyChecks)
-from .. import __version__ as CONDA_VERSION
+from .. import __version__ as CONDA_VERSION, CondaError
from .._vendor.appdirs import user_data_dir
from .._vendor.auxlib.collection import frozendict
from .._vendor.auxlib.decorators import memoize, memoizedproperty
@@ -312,7 +312,13 @@ def root_dir(self):
@property
def root_writable(self):
from ..gateways.disk.test import prefix_is_writable
- return prefix_is_writable(self.root_prefix)
+ try:
+ return prefix_is_writable(self.root_prefix)
+ except CondaError: # pragma: no cover
+ # With pyinstaller, conda code can sometimes be called even though sys.prefix isn't
+ # a conda environment with a conda-meta/ directory. In this case, it's safe to return
+ # False, because conda shouldn't itself be mutating that environment. See #6243
+ return False
@property
def envs_dirs(self):
diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -570,9 +570,13 @@ def generate_package_count(self, C, missing):
return {self.push_MatchSpec(C, nm): 1 for nm in missing}
def generate_version_metrics(self, C, specs, include0=False):
- eqc = {} # a C.minimize() objective: Dict[varname, coeff]
- eqv = {} # a C.minimize() objective: Dict[varname, coeff]
- eqb = {} # a C.minimize() objective: Dict[varname, coeff]
+ # each of these are weights saying how well packages match the specs
+ # format for each: a C.minimize() objective: Dict[varname, coeff]
+ eqc = {} # channel
+ eqv = {} # version
+ eqb = {} # build number
+ eqt = {} # timestamp
+
sdict = {} # Dict[package_name, Dist]
for s in specs:
@@ -594,18 +598,21 @@ def generate_version_metrics(self, C, specs, include0=False):
if targets and any(dist == t for t in targets):
continue
if pkey is None:
- ic = iv = ib = 0
+ ic = iv = ib = it = 0
# valid package, channel priority
elif pkey[0] != version_key[0] or pkey[1] != version_key[1]:
ic += 1
- iv = ib = 0
+ iv = ib = it = 0
# version
elif pkey[2] != version_key[2]:
iv += 1
- ib = 0
- # build number, timestamp
- elif pkey[3] != version_key[3] or pkey[4] != version_key[4]:
+ ib = it = 0
+ # build number
+ elif pkey[3] != version_key[3]:
ib += 1
+ it = 0
+ elif pkey[4] != version_key[4]:
+ it += 1
if ic or include0:
eqc[dist.full_name] = ic
@@ -613,9 +620,11 @@ def generate_version_metrics(self, C, specs, include0=False):
eqv[dist.full_name] = iv
if ib or include0:
eqb[dist.full_name] = ib
+ if it or include0:
+ eqt[dist.full_name] = it
pkey = version_key
- return eqc, eqv, eqb
+ return eqc, eqv, eqb, eqt
def dependency_sort(self, must_have):
# type: (Dict[package_name, Dist]) -> List[Dist]
@@ -865,10 +874,10 @@ def mysat(specs, add_if=False):
log.debug('Package removal metric: %d', obj7)
# Requested packages: maximize versions
- eq_req_c, eq_req_v, eq_req_b = r2.generate_version_metrics(C, specr)
+ eq_req_c, eq_req_v, eq_req_b, eq_req_t = r2.generate_version_metrics(C, specr)
solution, obj3a = C.minimize(eq_req_c, solution)
solution, obj3 = C.minimize(eq_req_v, solution)
- log.debug('Initial package version metric: %d/%d', obj3a, obj3)
+ log.debug('Initial package channel/version metric: %d/%d', obj3a, obj3)
# Track features: minimize feature count
eq_feature_count = r2.generate_feature_count(C)
@@ -897,11 +906,17 @@ def mysat(specs, add_if=False):
log.debug('Dependency update count: %d', obj50)
# Remaining packages: maximize versions, then builds
- eq_c, eq_v, eq_b = r2.generate_version_metrics(C, speca)
+ eq_c, eq_v, eq_b, eq_t = r2.generate_version_metrics(C, speca)
solution, obj5a = C.minimize(eq_c, solution)
solution, obj5 = C.minimize(eq_v, solution)
solution, obj6 = C.minimize(eq_b, solution)
- log.debug('Additional package version/build metrics: %d/%d/%d', obj5a, obj5, obj6)
+ log.debug('Additional package channel/version/build metrics: %d/%d/%d',
+ obj5a, obj5, obj6)
+
+ # Maximize timestamps
+ eq_t.update(eq_req_t)
+ solution, obj6t = C.minimize(eq_t, solution)
+ log.debug('Timestamp metric: %d', obj6t)
# Prune unnecessary packages
eq_c = r2.generate_package_count(C, specm)
diff --git a/conda_env/env.py b/conda_env/env.py
--- a/conda_env/env.py
+++ b/conda_env/env.py
@@ -51,9 +51,9 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False):
pip_pkgs = sorted(installed - conda_pkgs)
if no_builds:
- dependencies = ['='.join(a.quad[0:3]) for a in sorted(conda_pkgs)]
+ dependencies = ['='.join((a.name, a.version)) for a in sorted(conda_pkgs)]
else:
- dependencies = ['='.join(a.quad[0:3]) for a in sorted(conda_pkgs)]
+ dependencies = ['='.join((a.name, a.version, a.build)) for a in sorted(conda_pkgs)]
if len(pip_pkgs) > 0:
dependencies.append({'pip': ['=='.join(a.rsplit('-', 2)[:2]) for a in pip_pkgs]})
# conda uses ruamel_yaml which returns a ruamel_yaml.comments.CommentedSeq
| diff --git a/conda/gateways/disk/test.py b/conda/gateways/disk/test.py
--- a/conda/gateways/disk/test.py
+++ b/conda/gateways/disk/test.py
@@ -4,6 +4,7 @@
from logging import getLogger
from os import W_OK, access
from os.path import basename, dirname, isdir, isfile, join
+from uuid import uuid4
from .create import create_link
from .delete import rm_rf, try_rmdir_all_empty
@@ -12,6 +13,7 @@
from .update import touch
from ..._vendor.auxlib.decorators import memoize
from ...base.constants import PREFIX_MAGIC_FILE
+from ...common.compat import text_type
from ...common.path import expand, get_python_short_path
from ...models.enums import LinkType
@@ -91,7 +93,7 @@ def hardlink_supported(source_file, dest_dir):
# file system configuration, a symbolic link may be created
# instead. If a symbolic link is created instead of a hard link,
# return False.
- test_file = join(dest_dir, '.tmp.' + basename(source_file))
+ test_file = join(dest_dir, '.tmp.%s.%s' % (basename(source_file), text_type(uuid4())[:8]))
assert isfile(source_file), source_file
assert isdir(dest_dir), dest_dir
if lexists(test_file):
diff --git a/tests/conda_env/test_cli.py b/tests/conda_env/test_cli.py
--- a/tests/conda_env/test_cli.py
+++ b/tests/conda_env/test_cli.py
@@ -16,6 +16,7 @@
from conda.install import rm_rf
from conda_env.cli.main import create_parser
from conda_env.exceptions import SpecNotFound
+from conda_env.yaml import load as yaml_load
environment_1 = '''
name: env-1
@@ -240,7 +241,7 @@ def test_create_remove_env(self):
self.assertFalse(env_is_created(test_env_name_3))
- def test_export(self):
+ def test_env_export(self):
"""
Test conda env export
"""
@@ -254,11 +255,20 @@ def test_export(self):
env_yaml.write(snowflake)
env_yaml.flush()
env_yaml.close()
+
run_env_command(Commands.ENV_REMOVE, test_env_name_2)
self.assertFalse(env_is_created(test_env_name_2))
run_env_command(Commands.ENV_CREATE, env_yaml.name)
self.assertTrue(env_is_created(test_env_name_2))
+ # regression test for #6220
+ snowflake, e, = run_env_command(Commands.ENV_EXPORT, test_env_name_2, '--no-builds')
+ assert not e.strip()
+ env_description = yaml_load(snowflake)
+ assert len(env_description['dependencies'])
+ for spec_str in env_description['dependencies']:
+ assert spec_str.count('=') == 1
+
def test_list(self):
"""
Test conda list -e and conda create from txt
diff --git a/tests/test_resolve.py b/tests/test_resolve.py
--- a/tests/test_resolve.py
+++ b/tests/test_resolve.py
@@ -158,7 +158,7 @@ def test_generate_eq_1():
reduced_index = r.get_reduced_index(['anaconda'])
r2 = Resolve(reduced_index, True, True)
C = r2.gen_clauses()
- eqc, eqv, eqb = r2.generate_version_metrics(C, list(r2.groups.keys()))
+ eqc, eqv, eqb, eqt = r2.generate_version_metrics(C, list(r2.groups.keys()))
# Should satisfy the following criteria:
# - lower versions of the same package should should have higher
# coefficients.
@@ -170,6 +170,7 @@ def test_generate_eq_1():
eqc = {Dist(key).to_filename(): value for key, value in iteritems(eqc)}
eqv = {Dist(key).to_filename(): value for key, value in iteritems(eqv)}
eqb = {Dist(key).to_filename(): value for key, value in iteritems(eqb)}
+ eqt = {Dist(key).to_filename(): value for key, value in iteritems(eqt)}
assert eqc == {}
assert eqv == {
'accelerate-1.0.0-np15py26_p0.tar.bz2': 2,
@@ -483,6 +484,9 @@ def test_generate_eq_1():
'zeromq-2.2.0-0.tar.bz2': 1,
}
+ # No timestamps in the current data set
+ assert eqt == {}
+
def test_unsat():
# scipy 0.12.0b1 is not built for numpy 1.5, only 1.6 and 1.7
@@ -499,6 +503,48 @@ def test_nonexistent():
assert raises(ResolvePackageNotFound, lambda: r.install(['numpy 1.5']))
+def test_timestamps_and_deps():
+ # If timestamp maximization is performed too early in the solve optimization,
+ # it will force unnecessary changes to dependencies. Timestamp maximization needs
+ # to be done at low priority so that conda is free to consider packages with the
+ # same version and build that are most compatible with the installed environment.
+ index2 = {Dist(key): value for key, value in iteritems(index)}
+ index2[Dist('mypackage-1.0-hash12_0.tar.bz2')] = IndexRecord(**{
+ 'build': 'hash27_0',
+ 'build_number': 0,
+ 'depends': ['libpng 1.2.*'],
+ 'name': 'mypackage',
+ 'requires': ['libpng 1.2.*'],
+ 'version': '1.0',
+ 'timestamp': 1,
+ })
+ index2[Dist('mypackage-1.0-hash15_0.tar.bz2')] = IndexRecord(**{
+ 'build': 'hash15_0',
+ 'build_number': 0,
+ 'depends': ['libpng 1.5.*'],
+ 'name': 'mypackage',
+ 'requires': ['libpng 1.5.*'],
+ 'version': '1.0',
+ 'timestamp': 0,
+ })
+ r = Resolve(index2)
+ installed1 = r.install(['libpng 1.2.*', 'mypackage'])
+ print([k.dist_name for k in installed1])
+ assert any(k.name == 'libpng' and k.version.startswith('1.2') for k in installed1)
+ assert any(k.name == 'mypackage' and k.build == 'hash12_0' for k in installed1)
+ installed2 = r.install(['libpng 1.5.*', 'mypackage'])
+ assert any(k.name == 'libpng' and k.version.startswith('1.5') for k in installed2)
+ assert any(k.name == 'mypackage' and k.build == 'hash15_0' for k in installed2)
+ # this is testing that previously installed reqs are not disrupted by newer timestamps.
+ # regression test of sorts for https://github.com/conda/conda/issues/6271
+ installed3 = r.install(['mypackage'], r.install(['libpng 1.2.*']))
+ assert installed1 == installed3
+ installed4 = r.install(['mypackage'], r.install(['libpng 1.5.*']))
+ assert installed2 == installed4
+ # unspecified python version should maximize libpng (v1.5), even though it has a lower timestamp
+ installed5 = r.install(['mypackage'])
+ assert installed2 == installed5
+
def test_nonexistent_deps():
index2 = index.copy()
index2['mypackage-1.0-py33_0.tar.bz2'] = IndexRecord(**{
@@ -1169,7 +1215,7 @@ def test_channel_priority_2():
dists = this_r.get_reduced_index(spec)
r2 = Resolve(dists, True, True, channels=channels)
C = r2.gen_clauses()
- eqc, eqv, eqb = r2.generate_version_metrics(C, list(r2.groups.keys()))
+ eqc, eqv, eqb, eqt = r2.generate_version_metrics(C, list(r2.groups.keys()))
eqc = {str(Dist(key)): value for key, value in iteritems(eqc)}
assert eqc == {
'channel-3::openssl-1.0.1c-0': 1,
@@ -1266,7 +1312,7 @@ def test_channel_priority_2():
dists = this_r.get_reduced_index(spec)
r2 = Resolve(dists, True, True, channels=channels)
C = r2.gen_clauses()
- eqc, eqv, eqb = r2.generate_version_metrics(C, list(r2.groups.keys()))
+ eqc, eqv, eqb, eqt = r2.generate_version_metrics(C, list(r2.groups.keys()))
eqc = {str(Dist(key)): value for key, value in iteritems(eqc)}
assert eqc == {
'channel-1::accelerate-1.0.0-np16py27_p0': 2,
| Add flag to build environment.yml without build strings
https://gitter.im/conda/conda?at=59ef54ebe44c43700a70e9a4
https://twitter.com/drvinceknight/status/922837449092542464?ref_src=twsrc%5Etfw
> Due to hashes of packages being introduced in `envinronment.yml` I'm getting all sorts of issues with building envs from file. (Very new problem)
test.py error "prefix is not writeable"
While attempting to use "pyinstaller" to create a standalone conda-index executable, the resulting binary failed in “conda/gateways/disk/test.py” prefix_is_writable because that method assumes the prefix is a python root directory, and in the case of the standalone, the “prefix” is the executable’s current directory. If I add append sys.executable to the end of the “find_first_existing” call parameter list, then it worked as expected.
Of course, this particular writability check seems unnecessary for conda-index, because the only writing is to the target, not the conda-meta directory.
Any change that would allow the creation of a standalone conda-index is appreciated.
| 2017-11-13T21:43:58 |
|
conda/conda | 6,299 | conda__conda-6299 | [
"6012"
] | d5d002acefe580451a6bf5cbf26dbada3ad45c9a | diff --git a/conda_env/cli/main_create.py b/conda_env/cli/main_create.py
--- a/conda_env/cli/main_create.py
+++ b/conda_env/cli/main_create.py
@@ -6,7 +6,7 @@
import textwrap
from conda.cli import common, install as cli_install
-from conda.gateways.disk.delete import rm_rf
+from conda.gateways.disk.delete import rm_rf, delete_trash
from conda.misc import touch_nonadmin
from conda.plan import is_root_prefix
@@ -119,5 +119,6 @@ def execute(args, parser):
return -1
touch_nonadmin(prefix)
+ delete_trash()
if not args.json:
print(cli_install.print_activate(args.name if args.name else prefix))
| Purging the ".trash" folder.
OS: Windows.
When updating an environment, a snapshot of the environment get stored in the ```[miniconda]\pkgs\.trash```
Is there a way to clean up this trash directory with a ```conda``` command?
| I also have this problem and would be interested in a solution. My reading of the code is that a call to `delete_trash()` needs to be added somewhere, but I'm not sufficiently familiar with the code to know the best way to do this.
Further to this, if you try to manually delete the environment snapshots, you'll get a "Access denied" error if the environment is in use.
The `.trash` directory is what we've resorted to for dealing with windows file locking. This is really a Windows OS issue. Windows aggressively locks files on a per-process basis, which means if a process is "using" a file, conda won't be able to delete it. We can rename it however, and move it to the .trash directory.
The `delete_trash()` function is called at the end of `create`, `install`, `update`, and `remove` operations. See:
* https://github.com/conda/conda/blob/4.3.x/conda/cli/main_create.py#L69
* https://github.com/conda/conda/blob/4.3.x/conda/cli/main_install.py#L81
* https://github.com/conda/conda/blob/4.3.x/conda/cli/main_update.py#L66
* https://github.com/conda/conda/blob/4.3.x/conda/cli/main_remove.py#L172
Maybe we could get a ```delete_trash()``` when dealing with environments?
https://github.com/conda/conda/blob/4.3.x/conda_env/cli/main_create.py
Yeah good idea.
Sent from my iPhone
> On Sep 29, 2017, at 2:11 AM, Toke Jepsen <[email protected]> wrote:
>
> Maybe we could get a delete_trash() when dealing with environments?
>
> https://github.com/conda/conda/blob/4.3.x/conda_env/cli/main_create.py
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
| 2017-11-14T02:43:44 |
|
conda/conda | 6,352 | conda__conda-6352 | [
"5827"
] | 58f340d45f87a3bebfcd6f2058e21aabb99f2021 | diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -122,14 +122,13 @@ def error(self, message):
else:
argument = None
if argument and argument.dest == "cmd":
- m = re.compile(r"invalid choice: u?'([\w\-]+)'").match(exc.message)
+ m = re.match(r"invalid choice: u?'(\w+)'", exc.message)
if m:
cmd = m.group(1)
executable = find_executable('conda-' + cmd)
if not executable:
from ..exceptions import CommandNotFoundError
raise CommandNotFoundError(cmd)
-
args = [find_executable('conda-' + cmd)]
args.extend(sys.argv[2:])
os.execv(args[0], args)
@@ -140,10 +139,13 @@ def print_help(self):
super(ArgumentParser, self).print_help()
if sys.argv[1:] in ([], ['help'], ['-h'], ['--help']):
- print(dedent("""
- other commands, such as "conda build", are available when additional conda
- packages (e.g. conda-build) are installed
- """))
+ from .find_commands import find_commands
+ other_commands = find_commands()
+ if other_commands:
+ builder = ['']
+ builder.append("conda commands available from other packages:")
+ builder.extend(' %s' % cmd for cmd in sorted(other_commands))
+ print('\n'.join(builder))
class NullCountAction(_CountAction):
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -170,6 +170,21 @@ def __init__(self, target_path, incompatible_package_dists, context):
class CommandNotFoundError(CondaError):
def __init__(self, command):
+ conda_commands = {
+ 'clean',
+ 'config',
+ 'create',
+ 'help',
+ 'info',
+ 'install',
+ 'list',
+ 'package',
+ 'remove',
+ 'search',
+ 'uninstall',
+ 'update',
+ 'upgrade',
+ }
build_commands = {
'build',
'convert',
@@ -180,22 +195,19 @@ def __init__(self, command):
'render',
'skeleton',
}
- needs_source = {
- 'activate',
- 'deactivate'
- }
if command in build_commands:
- message = dals("""
- You need to install conda-build in order to
- use the 'conda %(command)s' command.
- """)
- elif command in needs_source and not on_win:
- message = dals("""
- '%(command)s is not a conda command.
- Did you mean 'source %(command)s'?
- """)
+ message = "To use 'conda %(command)s', install conda-build."
else:
- message = "'%(command)s'"
+ from difflib import get_close_matches
+ from .cli.find_commands import find_commands
+ message = "Error: No command 'conda %(command)s'."
+ choices = conda_commands | build_commands | set(find_commands())
+ close = get_close_matches(command, choices)
+ if close:
+ message += "\nDid you mean 'conda %s'?" % close[0]
+ from .base.context import context
+ from .cli.main import init_loggers
+ init_loggers(context)
super(CommandNotFoundError, self).__init__(message, command=command)
| diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -338,7 +338,8 @@ def test_CommandNotFoundError_simple(self):
conda_exception_handler(_raise_helper, exc)
assert not c.stdout
- assert c.stderr.strip() == "CommandNotFoundError: 'instate'"
+ assert c.stderr.strip() == ("CommandNotFoundError: Error: No command 'conda instate'.\n"
+ "Did you mean 'conda install'?")
def test_CommandNotFoundError_conda_build(self):
cmd = "build"
@@ -359,35 +360,7 @@ def test_CommandNotFoundError_conda_build(self):
conda_exception_handler(_raise_helper, exc)
assert not c.stdout
- assert c.stderr.strip() == ("CommandNotFoundError: You need to install conda-build in order to\n" \
- "use the 'conda build' command.")
-
- def test_CommandNotFoundError_activate(self):
- cmd = "activate"
- exc = CommandNotFoundError(cmd)
-
- with env_var("CONDA_JSON", "yes", reset_context):
- with captured() as c:
- conda_exception_handler(_raise_helper, exc)
-
- json_obj = json.loads(c.stdout)
- assert not c.stderr
- assert json_obj['exception_type'] == "<class 'conda.exceptions.CommandNotFoundError'>"
- assert json_obj['message'] == text_type(exc)
- assert json_obj['error'] == repr(exc)
-
- with env_var("CONDA_JSON", "no", reset_context):
- with captured() as c:
- conda_exception_handler(_raise_helper, exc)
-
- assert not c.stdout
-
- if on_win:
- message = "CommandNotFoundError: 'activate'"
- else:
- message = ("CommandNotFoundError: 'activate is not a conda command.\n"
- "Did you mean 'source activate'?")
- assert c.stderr.strip() == message
+ assert c.stderr.strip() == ("CommandNotFoundError: To use 'conda build', install conda-build.")
@patch('requests.post', side_effect=(
AttrDict(headers=AttrDict(Location='somewhere.else'), status_code=302,
| No error generated on non-existent sub-command
```
[root@70a337fa2e68 build_scripts]# conda info
active environment : None
user config file : /root/.condarc
populated config files : /opt/miniconda/.condarc
conda version : 4.4.0rc0
conda-build version : 3.0.9
python version : 3.6.1.final.0
base environment : /opt/miniconda (writable)
channel URLs : https://conda.anaconda.org/c3i_test/linux-64
https://conda.anaconda.org/c3i_test/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
package cache : /opt/miniconda/pkgs
/root/.conda/pkgs
envs directories : /opt/miniconda/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/4.4.0rc0 requests/2.14.2 CPython/3.6.1 Linux/3.10.0-514.el7.x86_64 centos/6.9 glibc/2.12
UID:GID : 0:0
netrc file : None
offline mode : False
[root@70a337fa2e68 build_scripts]# conda this-is-not-a-subcommand
[root@70a337fa2e68 build_scripts]# echo $?
1
```
| We just need to switch conda over to click already. | 2017-11-28T03:25:08 |
conda/conda | 6,363 | conda__conda-6363 | [
"6181"
] | a3254b18f1d7a379620f502ec6dd7e845cb03ae8 | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from enum import Enum
from genericpath import exists
from logging import DEBUG, getLogger
from os.path import join
-from enum import Enum
-
from .index import get_reduced_index
from .link import PrefixSetup, UnlinkLinkTransaction
from .linked_data import PrefixData, linked_data
@@ -15,7 +14,7 @@
from ..common.compat import iteritems, itervalues, odict, string_types, text_type
from ..common.constants import NULL
from ..common.io import spinner
-from ..common.path import paths_equal
+from ..common.path import get_major_minor_version, paths_equal
from ..exceptions import PackagesNotFoundError
from ..gateways.logging import TRACE
from ..history import History
@@ -235,6 +234,16 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
specs_map = {pkg_name: MatchSpec(spec.name, optional=spec.optional)
for pkg_name, spec in iteritems(specs_map)}
+ # As a business rule, we never want to update python beyond the current minor version,
+ # unless that's requested explicitly by the user (which we actively discourage).
+ if 'python' in specs_map:
+ python_prefix_rec = prefix_data.get('python')
+ if python_prefix_rec:
+ python_spec = specs_map['python']
+ if not python_spec.get('version'):
+ pinned_version = get_major_minor_version(python_prefix_rec.version) + '.*'
+ specs_map['python'] = MatchSpec(python_spec, version=pinned_version)
+
# For the aggressive_update_packages configuration parameter, we strip any target
# that's been set.
if not context.offline:
| diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py
--- a/tests/core/test_solve.py
+++ b/tests/core/test_solve.py
@@ -467,12 +467,11 @@ def test_update_all_1():
'channel-1::tk-8.5.13-0',
'channel-1::zlib-1.2.7-0',
'channel-1::llvm-3.2-0',
- 'channel-1::python-2.7.5-0',
- 'channel-1::llvmpy-0.10.2-py27_0',
- 'channel-1::meta-0.4.2.dev-py27_0',
- 'channel-1::nose-1.3.0-py27_0',
- 'channel-1::numpy-1.7.1-py27_0',
- 'channel-1::numba-0.6.0-np17py27_0'
+ 'channel-1::python-2.6.8-6', # stick with python=2.6 even though UPDATE_ALL
+ 'channel-1::llvmpy-0.10.2-py26_0',
+ 'channel-1::nose-1.3.0-py26_0',
+ 'channel-1::numpy-1.7.1-py26_0',
+ 'channel-1::numba-0.6.0-np17py26_0',
)
assert tuple(final_state_2) == tuple(solver._index[Dist(d)] for d in order)
@@ -1336,7 +1335,6 @@ def test_freeze_deps_1():
)
assert tuple(final_state_1) == tuple(solver._index[Dist(d)] for d in order)
- # to keep six=1.7 as a requested spec, we have to downgrade python to 2.7
specs_to_add = MatchSpec("bokeh"),
with get_solver_2(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver:
final_state_2 = solver.solve_final_state()
@@ -1351,23 +1349,18 @@ def test_freeze_deps_1():
'channel-2::xz-5.2.2-1',
'channel-2::yaml-0.1.6-0',
'channel-2::zlib-1.2.8-3',
- 'channel-2::python-2.7.13-0',
- 'channel-2::backports-1.0-py27_0',
- 'channel-2::backports_abc-0.5-py27_0',
- 'channel-2::futures-3.1.1-py27_0',
- 'channel-2::markupsafe-0.23-py27_2',
- 'channel-2::numpy-1.13.0-py27_0',
- 'channel-2::pyyaml-3.12-py27_0',
- 'channel-2::requests-2.14.2-py27_0',
- 'channel-2::setuptools-27.2.0-py27_0',
- 'channel-2::six-1.7.3-py27_0',
- 'channel-2::bkcharts-0.2-py27_0',
- 'channel-2::jinja2-2.9.6-py27_0',
- 'channel-2::python-dateutil-2.6.0-py27_0',
- 'channel-2::singledispatch-3.4.0.3-py27_0',
- 'channel-2::ssl_match_hostname-3.4.0.2-py27_1',
- 'channel-2::tornado-4.5.1-py27_0',
- 'channel-2::bokeh-0.12.6-py27_0',
+ 'channel-2::python-3.4.5-0',
+ 'channel-2::backports_abc-0.5-py34_0',
+ 'channel-2::markupsafe-0.23-py34_2',
+ 'channel-2::numpy-1.13.0-py34_0',
+ 'channel-2::pyyaml-3.12-py34_0',
+ 'channel-2::requests-2.14.2-py34_0',
+ 'channel-2::setuptools-27.2.0-py34_0',
+ 'channel-2::six-1.7.3-py34_0',
+ 'channel-2::jinja2-2.9.6-py34_0',
+ 'channel-2::python-dateutil-2.6.0-py34_0',
+ 'channel-2::tornado-4.4.2-py34_0',
+ 'channel-2::bokeh-0.12.4-py34_0',
)
assert tuple(final_state_2) == tuple(solver._index[Dist(d)] for d in order)
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -898,13 +898,13 @@ def test_package_pinning(self):
run_command(Commands.UPDATE, prefix, "--all")
assert package_is_installed(prefix, "itsdangerous-0.23")
# assert not package_is_installed(prefix, "python-3.5") # should be python-3.6, but it's not because of add_defaults_to_specs
- assert not package_is_installed(prefix, "python-2.7") # add_defaults_to_specs is right now removed for python pinning, TODO: discuss
+ assert package_is_installed(prefix, "python-2.7")
assert not package_is_installed(prefix, "pytz-2015.7")
assert package_is_installed(prefix, "pytz-")
run_command(Commands.UPDATE, prefix, "--all --no-pin")
- assert not package_is_installed(prefix, "python-2.7")
+ assert package_is_installed(prefix, "python-2.7")
assert not package_is_installed(prefix, "itsdangerous-0.23")
def test_package_optional_pinning(self):
| make sure conda 4.4 has soft-pinning for python
https://github.com/conda/conda/issues/6164#issuecomment-336733311
| 2017-11-29T15:27:57 |
|
conda/conda | 6,364 | conda__conda-6364 | [
"5417"
] | aba43f2015c8713a236d858aa91e7b3205d33845 | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from enum import Enum
from genericpath import exists
from logging import DEBUG, getLogger
from os.path import join
-from enum import Enum
-
from .index import get_reduced_index
from .link import PrefixSetup, UnlinkLinkTransaction
-from .linked_data import PrefixData, linked_data
+from .linked_data import PrefixData
from .._vendor.boltons.setutils import IndexedSet
from ..base.context import context
from ..common.compat import iteritems, itervalues, odict, string_types, text_type
@@ -380,7 +379,11 @@ def solve_for_diff(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
"""
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
- previous_records = IndexedSet(itervalues(linked_data(self.prefix)))
+ previous_records = IndexedSet(self._index[d] for d in self._r.dependency_sort(
+ {prefix_rec.name: Dist(prefix_rec)
+ for prefix_rec in PrefixData(self.prefix).iter_records()}
+ ))
+
unlink_precs = previous_records - final_precs
link_precs = final_precs - previous_records
@@ -397,6 +400,9 @@ def solve_for_diff(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
# TODO: force_reinstall might not yet be fully implemented in :meth:`solve_final_state`,
# at least as described in the docstring.
+ unlink_precs = IndexedSet(reversed(sorted(unlink_precs,
+ key=lambda x: previous_records.index(x))))
+ link_precs = IndexedSet(sorted(link_precs, key=lambda x: final_precs.index(x)))
return unlink_precs, link_precs
def solve_for_transaction(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
| diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py
--- a/tests/core/test_solve.py
+++ b/tests/core/test_solve.py
@@ -170,49 +170,49 @@ def test_prune_1():
specs_to_remove = MatchSpec("numbapro"),
with get_solver(specs_to_remove=specs_to_remove, prefix_records=final_state_1,
history_specs=specs) as solver:
- final_state_2 = solver.solve_final_state(prune=False)
+ unlink_precs, link_precs = solver.solve_for_diff(prune=False)
# PrefixDag(final_state_2, specs).open_url()
- print([Dist(rec).full_name for rec in final_state_2])
- order = (
- 'channel-1::libnvvm-1.0-p0',
- 'channel-1::openssl-1.0.1c-0',
- 'channel-1::readline-6.2-0',
- 'channel-1::sqlite-3.7.13-0',
- 'channel-1::system-5.8-1',
- 'channel-1::tk-8.5.13-0',
- 'channel-1::zlib-1.2.7-0',
- 'channel-1::llvm-3.2-0',
- 'channel-1::mkl-rt-11.0-p0',
- 'channel-1::python-2.7.3-7',
- 'channel-1::bitarray-0.8.1-py27_0',
- 'channel-1::llvmpy-0.11.2-py27_0',
- 'channel-1::meta-0.4.2.dev-py27_0',
- 'channel-1::mkl-service-1.0.0-py27_p0',
- 'channel-1::numpy-1.6.2-py27_p4',
- 'channel-1::numba-0.8.1-np16py27_0',
- 'channel-1::numexpr-2.1-np16py27_p0',
- 'channel-1::scipy-0.12.0-np16py27_p0',
- 'channel-1::scikit-learn-0.13.1-np16py27_p0',
- 'channel-1::mkl-11.0-np16py27_p0',
+ print([Dist(rec).full_name for rec in unlink_precs])
+ unlink_order = (
+ 'channel-1::accelerate-1.1.0-np16py27_p0',
+ 'channel-1::numbapro-0.11.0-np16py27_p0',
)
- assert tuple(final_state_2) == tuple(solver._index[Dist(d)] for d in order)
+ assert tuple(unlink_precs) == tuple(solver._index[Dist(d)] for d in unlink_order)
+
+ print([Dist(rec).full_name for rec in link_precs])
+ link_order = ()
+ assert tuple(link_precs) == tuple(solver._index[Dist(d)] for d in link_order)
with get_solver(specs_to_remove=specs_to_remove, prefix_records=final_state_1,
history_specs=specs) as solver:
- final_state_2 = solver.solve_final_state(prune=True)
+ unlink_precs, link_precs = solver.solve_for_diff(prune=True)
# PrefixDag(final_state_2, specs).open_url()
- print([Dist(rec).full_name for rec in final_state_2])
- order = (
- 'channel-1::openssl-1.0.1c-0',
- 'channel-1::readline-6.2-0',
- 'channel-1::sqlite-3.7.13-0',
- 'channel-1::system-5.8-1',
- 'channel-1::tk-8.5.13-0',
- 'channel-1::zlib-1.2.7-0',
- 'channel-1::python-2.7.3-7',
+ print([Dist(rec).full_name for rec in unlink_precs])
+ unlink_order = (
+ 'channel-1::accelerate-1.1.0-np16py27_p0',
+ 'channel-1::mkl-11.0-np16py27_p0',
+ 'channel-1::scikit-learn-0.13.1-np16py27_p0',
+ 'channel-1::numbapro-0.11.0-np16py27_p0',
+ 'channel-1::scipy-0.12.0-np16py27_p0',
+ 'channel-1::numexpr-2.1-np16py27_p0',
+ 'channel-1::numba-0.8.1-np16py27_0',
+ 'channel-1::numpy-1.6.2-py27_p4',
+ 'channel-1::mkl-service-1.0.0-py27_p0',
+ 'channel-1::meta-0.4.2.dev-py27_0',
+ 'channel-1::llvmpy-0.11.2-py27_0',
+ 'channel-1::bitarray-0.8.1-py27_0',
+ 'channel-1::mkl-rt-11.0-p0',
+ 'channel-1::llvm-3.2-0',
+ 'channel-1::libnvvm-1.0-p0',
+ )
+ assert tuple(unlink_precs) == tuple(solver._index[Dist(d)] for d in unlink_order)
+
+ print([Dist(rec).full_name for rec in link_precs])
+ link_order = (
'channel-1::numpy-1.6.2-py27_4',
)
- assert tuple(final_state_2) == tuple(solver._index[Dist(d)] for d in order)
+ assert tuple(link_precs) == tuple(solver._index[Dist(d)] for d in link_order)
+
def test_force_remove_1():
| Respecting topological sorting for environment removal
Not sure if this is implemented in newer versions of `conda`, but it would be nice if environment removal performed a topological sort and uninstalled packages based on this sorting. Namely only removing packages that are not required for anything else first. For the most part this doesn't matter, but when `pre-unlink` scripts are involved it does.
| Also ran into a similar issue when doing `conda update --all` recently.
I *think* this should be done in 4.4. I'm adding the milestone so I can confirm later. If it's not done yet, it might get bumped past 4.4.0. Hopefully it's already done.
That's great news! Thanks @kalefranz. 😄 | 2017-11-29T17:33:27 |
conda/conda | 6,367 | conda__conda-6367 | [
"6201"
] | aba43f2015c8713a236d858aa91e7b3205d33845 | diff --git a/conda/cli/main_search.py b/conda/cli/main_search.py
--- a/conda/cli/main_search.py
+++ b/conda/cli/main_search.py
@@ -36,7 +36,7 @@ def execute(args, parser):
channels_urls = tuple(calculate_channel_urls(
channel_urls=context.channels,
prepend=not args.override_channels,
- platform=None,
+ platform=subdirs[0],
use_local=args.use_local,
))
from ..exceptions import PackagesNotFoundError
| Conda 4.4 doesn't support --platform flag correctly?
For example, the portpicker package is not available for Windows. But it still reports it:
```
(base) [nwani@centos6x64 aggregate]$ conda search portpicker --platform win-64
Loading channels: done
Name Version Build Channel
portpicker 1.2.0 py27h86e0a49_0 https://repo.continuum.io/pkgs/main
portpicker 1.2.0 py35h8f64c34_0 https://repo.continuum.io/pkgs/main
portpicker 1.2.0 py36h7b3aa6a_0 https://repo.continuum.io/pkgs/main
```
Conda 4.3 is right here:
```
(root) [nwani@some-machine test-pkgs-nwani]$ conda search portpicker --platform win-64
Fetching package metadata ...........
PackageNotFoundError: Packages missing in current channels:
- portpicker
We have searched for the packages in the following channels:
- https://repo.continuum.io/pkgs/main/linux-64
- https://repo.continuum.io/pkgs/main/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
```
| Equivalent syntax in conda 4.4 is
conda search */win-64::portpicker
conda search portpicker[subdir=win-64]
I'm not seeing what you are I don't think
```
kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search portpicker --platform win-64
Loading channels: done
PackagesNotFoundError: The following packages are not available from current channels:
- portpicker
Current channels:
- https://repo.continuum.io/pkgs/main/osx-64
- https://repo.continuum.io/pkgs/main/noarch
- https://repo.continuum.io/pkgs/free/osx-64
- https://repo.continuum.io/pkgs/free/noarch
- https://repo.continuum.io/pkgs/r/osx-64
- https://repo.continuum.io/pkgs/r/noarch
- https://repo.continuum.io/pkgs/pro/osx-64
- https://repo.continuum.io/pkgs/pro/noarch
(1)kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search */win-64::portpicker
Loading channels: done
PackagesNotFoundError: The following packages are not available from current channels:
- portpicker[subdir=win-64]
Current channels:
- https://repo.continuum.io/pkgs/main/osx-64
- https://repo.continuum.io/pkgs/main/noarch
- https://repo.continuum.io/pkgs/free/osx-64
- https://repo.continuum.io/pkgs/free/noarch
- https://repo.continuum.io/pkgs/r/osx-64
- https://repo.continuum.io/pkgs/r/noarch
- https://repo.continuum.io/pkgs/pro/osx-64
- https://repo.continuum.io/pkgs/pro/noarch
(1)kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search */linux-64::portpicker
Loading channels: done
Name Version Build Channel
portpicker 1.1.1 py27_0 defaults
portpicker 1.1.1 py35_0 defaults
portpicker 1.1.1 py36_0 defaults
portpicker 1.2.0 py27h86e0a49_0 defaults
portpicker 1.2.0 py35h8f64c34_0 defaults
portpicker 1.2.0 py36h7b3aa6a_0 defaults
```
However, I do see that the error message is wrong. The error message is giving `osx-64` subdirs even though I'm specifying something else. | 2017-11-29T22:36:01 |
|
conda/conda | 6,368 | conda__conda-6368 | [
"6045"
] | aba43f2015c8713a236d858aa91e7b3205d33845 | diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -112,7 +112,6 @@ def _get_action_from_name(self, name):
def error(self, message):
import re
from .find_commands import find_executable
-
exc = sys.exc_info()[1]
if exc:
# this is incredibly lame, but argparse stupidly does not expose
@@ -122,23 +121,27 @@ def error(self, message):
else:
argument = None
if argument and argument.dest == "cmd":
- m = re.match(r"invalid choice: u?'(\w+)'", exc.message)
+ m = re.match(r"invalid choice: u?'(\w*?)'", exc.message)
if m:
cmd = m.group(1)
- executable = find_executable('conda-' + cmd)
- if not executable:
- from ..exceptions import CommandNotFoundError
- raise CommandNotFoundError(cmd)
- args = [find_executable('conda-' + cmd)]
- args.extend(sys.argv[2:])
- os.execv(args[0], args)
+ if not cmd:
+ self.print_help()
+ sys.exit(0)
+ else:
+ executable = find_executable('conda-' + cmd)
+ if not executable:
+ from ..exceptions import CommandNotFoundError
+ raise CommandNotFoundError(cmd)
+ args = [find_executable('conda-' + cmd)]
+ args.extend(sys.argv[2:])
+ os.execv(args[0], args)
super(ArgumentParser, self).error(message)
def print_help(self):
super(ArgumentParser, self).print_help()
- if sys.argv[1:] in ([], ['help'], ['-h'], ['--help']):
+ if sys.argv[1:] in ([], [''], ['help'], ['-h'], ['--help']):
from .find_commands import find_commands
other_commands = find_commands()
if other_commands:
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -200,7 +200,7 @@ def __init__(self, command):
else:
from difflib import get_close_matches
from .cli.find_commands import find_commands
- message = "Error: No command 'conda %(command)s'."
+ message = "No command 'conda %(command)s'."
choices = conda_commands | build_commands | set(find_commands())
close = get_close_matches(command, choices)
if close:
| diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -338,7 +338,7 @@ def test_CommandNotFoundError_simple(self):
conda_exception_handler(_raise_helper, exc)
assert not c.stdout
- assert c.stderr.strip() == ("CommandNotFoundError: Error: No command 'conda instate'.\n"
+ assert c.stderr.strip() == ("CommandNotFoundError: No command 'conda instate'.\n"
"Did you mean 'conda install'?")
def test_CommandNotFoundError_conda_build(self):
| conda 4.4 + zsh: conda:shift:1: shift count must be <= $#
With conda 4.4.0rc1 and zsh, calling the new conda shell function with no arguments results in
```
$ conda
conda:shift:1: shift count must be <= $#
usage: conda [-h] [-V] command ...
conda: error: argument command: invalid choice: '' (choose from 'clean', 'config', 'create', 'help', 'info', 'install', 'list', 'package', 'remove', 'uninstall', 'search', 'update', 'upgrade')
```
It's mostly an esthetic point but it would be nice if the shell error message (shift count) was not shown.
| Thanks for the report!
Sent from my iPhone
> On Sep 30, 2017, at 12:06 AM, Antony Lee <[email protected]> wrote:
>
> With conda 4.4.0rc1 and zsh, calling the new conda shell function with no arguments results in
>
> $ conda
> conda:shift:1: shift count must be <= $#
> usage: conda [-h] [-V] command ...
> conda: error: argument command: invalid choice: '' (choose from 'clean', 'config', 'create', 'help', 'info', 'install', 'list', 'package', 'remove', 'uninstall', 'search', 'update', 'upgrade')
> It's mostly an esthetic point but it would be nice if the shell error message (shift count) was not shown.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
Some related issues:
1. `conda nonexistentcommand` exits with status 1 but does not print any error message.
2. The changelog recommends putting conda.sh in a profile folder but this usually won't work if the user's terminals are not login shells (as is the default on Linux): nonlogin shells do not read the profile folder and do not inherit *functions* (even though the *environment* is inherited. I just sourced conda.sh in my .zshrc (rather than my .zprofile). | 2017-11-29T22:58:35 |
conda/conda | 6,369 | conda__conda-6369 | [
"6366"
] | bf233020b4666cfbcaea6f8a2a4c28647aafce32 | diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -6,7 +6,7 @@
from logging import getLogger
import os
import sys
-from traceback import format_exception_only, format_exception
+from traceback import format_exception, format_exception_only
from . import CondaError, CondaExitZero, CondaMultiError, text_type
from ._vendor.auxlib.entity import EntityEncoder
@@ -170,6 +170,10 @@ def __init__(self, target_path, incompatible_package_dists, context):
class CommandNotFoundError(CondaError):
def __init__(self, command):
+ activate_commands = {
+ 'activate',
+ 'deactivate',
+ }
conda_commands = {
'clean',
'config',
@@ -195,13 +199,47 @@ def __init__(self, command):
'render',
'skeleton',
}
- if command in build_commands:
+ # TODO: Point users to a page at conda-docs, which explains this context in more detail
+ if command in activate_commands:
+ from .base.context import context
+ builder = ["Your shell has not been properly configured to use 'conda %(command)s'."]
+ builder.append(dals("""
+ If your shell is Bash or a Bourne variant, enable conda for the current user with
+
+ $ echo ". %(root_prefix)s/etc/profile.d/conda.sh" >> ~/%(config_file)s
+
+ or, for all users, enable conda with
+
+ $ sudo ln -s %(root_prefix)s/etc/profile.d/conda.sh /etc/profile.d/conda.sh
+
+ The options above will permanently enable the 'conda' command, but they do NOT
+ put conda's base (root) environment on PATH. To do so, run
+
+ $ conda activate
+
+ in your terminal, or to put the base environment on PATH permanently, run
+
+ $ echo "conda activate" >> ~/%(config_file)s
+
+ Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
+ your ~/%(config_file)s file. You should manually remove the line that looks like
+
+ export PATH="%(root_prefix)s/bin:$PATH"
+
+ ^^^ The above line should NO LONGER be in your ~/%(config_file)s file! ^^^
+ """) % {
+ 'root_prefix': context.root_prefix,
+ 'macos_fix': " ''" if sys.platform == 'darwin' else "",
+ 'config_file': '.bash_profile' if sys.platform == 'darwin' else '.bashrc',
+ })
+ message = '\n'.join(builder)
+ elif command in build_commands:
message = "To use 'conda %(command)s', install conda-build."
else:
from difflib import get_close_matches
from .cli.find_commands import find_commands
message = "No command 'conda %(command)s'."
- choices = conda_commands | build_commands | set(find_commands())
+ choices = activate_commands | conda_commands | build_commands | set(find_commands())
close = get_close_matches(command, choices)
if close:
message += "\nDid you mean 'conda %s'?" % close[0]
| Better error message for when `conda activate` isn't a command
Tell users how to get `conda activate` as a command in 4.4 through a better error message.
| 2017-11-29T23:46:42 |
||
conda/conda | 6,370 | conda__conda-6370 | [
"6194"
] | c06adf205b195329c7c13533cac2fd3e20302145 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -89,6 +89,7 @@ class Context(Configuration):
add_pip_as_python_dependency = PrimitiveParameter(True)
allow_softlinks = PrimitiveParameter(False)
auto_update_conda = PrimitiveParameter(True, aliases=('self_update',))
+ notify_outdated_conda = PrimitiveParameter(True)
clobber = PrimitiveParameter(False)
changeps1 = PrimitiveParameter(True)
concurrent = PrimitiveParameter(True)
@@ -755,6 +756,10 @@ def get_help_dict():
Allows completion of conda's create, install, update, and remove operations, for
non-privileged (non-root or non-administrator) users.
"""),
+ 'notify_outdated_conda': dals("""
+ Notify if a newer version of conda is detected during a create, install, update,
+ or remove operation.
+ """),
'offline': dals("""
Restrict conda to cached download content and file:// based urls.
"""),
diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -5,10 +5,14 @@
from genericpath import exists
from logging import DEBUG, getLogger
from os.path import join
+import sys
+from textwrap import dedent
from .index import get_reduced_index
from .link import PrefixSetup, UnlinkLinkTransaction
from .linked_data import PrefixData
+from .repodata import query_all
+from .. import __version__ as CONDA_VERSION
from .._vendor.boltons.setutils import IndexedSet
from ..base.context import context
from ..common.compat import iteritems, itervalues, odict, string_types, text_type
@@ -22,6 +26,7 @@
from ..models.dag import PrefixDag
from ..models.dist import Dist
from ..models.match_spec import MatchSpec
+from ..models.version import VersionOrder
from ..resolve import Resolve, dashlist
try:
@@ -450,7 +455,30 @@ def solve_for_transaction(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NU
self.specs_to_remove, self.specs_to_add)
# TODO: Only explicitly requested remove and update specs are being included in
# History right now. Do we need to include other categories from the solve?
- return UnlinkLinkTransaction(stp)
+
+ if context.notify_outdated_conda:
+ conda_newer_spec = MatchSpec('conda >%s' % CONDA_VERSION)
+ if not any(conda_newer_spec.match(prec) for prec in link_precs):
+ conda_newer_records = sorted(
+ query_all(self.channels, self.subdirs, conda_newer_spec),
+ key=lambda x: VersionOrder(x.version)
+ )
+ if conda_newer_records:
+ latest_version = conda_newer_records[-1].version
+ sys.stderr.write(dedent("""
+
+ ==> WARNING: A newer version of conda exists. <==
+ current version: %s
+ latest version: %s
+
+ Please update conda by running
+
+ $ conda update -n base conda
+
+
+ """) % (CONDA_VERSION, latest_version))
+
+ return UnlinkLinkTransaction(stp)
def _prepare(self, prepared_specs):
# All of this _prepare() method is hidden away down here. Someday we may want to further
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -1277,6 +1277,7 @@ def side_effect(self, url, **kwargs):
del result.headers[header]
return result
+ SubdirData._cache_.clear()
mock_method.side_effect = side_effect
stdout, stderr = run_command(Commands.INFO, prefix, "flask --json")
assert mock_method.called
| conda only updates itself in the root environment
I was listening to a presentation about conda a couple of days ago where it was mentioned that conda aggressively auto-updates itself. Aggressive auto-updates can be problematic, because they can result in the quick spread of a buggy release that is no longer able to update itself, which has happened to me and co-workers in the past. But in general they are a good thing, because they can help make sure that the installed user base is (a) not using outdated versions where problems were fixed long ago, and (b) are using a similar set of versions so that we don't have to reason about the effects of all possible version combinations.
However, the main benefits of aggressively auto-updating only accrue if all or nearly all installations auto-update, which does not appear to be the case. Right now, it looks to me like auto-updates happen only when people regularly use the root environment. In my own workflows, I haven't installed anything in the root environment in many months; I always work on one of a number of more specialized environments instead. I didn't even realize this until recently, when I ran into a bug fixed several months ago in conda, and which I expected not to apply to me. I eventually fixed it by switching to the root environment and running ``conda update conda``, which was fine, but it was not at all clear that this would be needed. I imagine other users who don't use the root environment may encounter similar issues. I don't think conda is installed in any environment other than root, but maybe the other environments could warn on a ``conda install`` command if conda itself is more than a month or so out of date?
| This problem just reared its head in practice: as of conda 4.3.27, new packages are going into ``https://repo.continuum.io/pkgs/main/``, and so when I tried to install packages in any environment, I was getting out of date packages. After ``conda update conda`` to upgrade 4.3.25, it works fine, but I only knew to do that (given that my conda version wasn't even very old) because of an in-person suggestion from Michael Grant. This seems like something that will cause lots of confusion for any users who habitually use sub-environments.
Related issue: https://github.com/conda/conda/issues/6232 | 2017-11-30T00:23:30 |
conda/conda | 6,371 | conda__conda-6371 | [
"5370"
] | 640e48a1da494669aae40458e2d18b15b21e0c99 | diff --git a/conda/core/index.py b/conda/core/index.py
--- a/conda/core/index.py
+++ b/conda/core/index.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from concurrent.futures import as_completed
from itertools import chain
from logging import getLogger
-from concurrent.futures import as_completed
-
from .linked_data import linked_data
from .package_cache import PackageCache
from .repodata import SubdirData, make_feature_record
@@ -21,11 +20,12 @@
from ..models.match_spec import MatchSpec
from ..models.package_cache_record import PackageCacheRecord
from ..models.prefix_record import PrefixRecord
+from ..resolve import dashlist
try:
- from cytoolz.itertoolz import concat, concatv, take
+ from cytoolz.itertoolz import concat, concatv, groupby, take
except ImportError: # pragma: no cover
- from .._vendor.toolz.itertoolz import concat, concatv, take # NOQA
+ from .._vendor.toolz.itertoolz import concat, concatv, groupby, take # NOQA
log = getLogger(__name__)
@@ -161,6 +161,13 @@ def get_reduced_index(prefix, channels, subdirs, specs):
with backdown_thread_pool() as executor:
channel_urls = all_channel_urls(channels, subdirs=subdirs)
+ if context.offline:
+ grouped_urls = groupby(lambda url: url.startswith('file://'), channel_urls)
+ ignored_urls = grouped_urls.get(False, ())
+ if ignored_urls:
+ log.info("Ignoring the following channel urls because mode is offline.%s",
+ dashlist(ignored_urls))
+ channel_urls = IndexedSet(grouped_urls.get(True, ()))
subdir_datas = tuple(SubdirData(Channel(url)) for url in channel_urls)
records = IndexedSet()
| conda install --offline still performs online operations
Even `conda` seems to notice that it shouldn't be doing an online operation when the `--offline` flag has been specified:
```bash
$ conda install --offline statsmodels
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment C:\Users\d53542\AppData\Local\Continuum\Anaconda2:
The following packages will be UPDATED:
statsmodels: 0.6.1-np111py27_1 --> 0.8.0-np111py27_0
Proceed ([y]/n)? y
CondaError: RuntimeError(u'EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/win-64/statsmodels-0.8.0-np111py27_0.tar.bz2\nThis command is using a remote connection in offline m
ode.\n',)
CondaError: RuntimeError(u'EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/win-64/statsmodels-0.8.0-np111py27_0.tar.bz2\nThis command is using a remote connection in offline m
ode.\n',)
CondaError: RuntimeError(u'EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/win-64/statsmodels-0.8.0-np111py27_0.tar.bz2\nThis command is using a remote connection in offline m
ode.\n',)
C:\Users\d53542\Documents\GIT\health_score>conda -V
conda 4.3.17
```
I'm at PyCon and am seeing this on the computer of someone I'm talking to (an Anaconda user)
| Can you add a `-vv` so we can get the full stack trace?
Oh. Wait. Try 4.3.18.
There were two PRs in 4.3.18 that hopefully killed at least a couple of these code paths.
@ijstokes Can you confirm that you're still seeing this with conda 4.3.18?
Unfortunately the problem is still there:
```bash
$ conda install --offline statsmodels
Fetching package metadata .........
Solving package specifications: .
Package plan for installation in environment /Users/ijstokes/anaconda/envs/oracletest:
The following NEW packages will be INSTALLED:
mkl: 2017.0.1-0
numpy: 1.12.1-py36_0
openssl: 1.0.2k-2
pandas: 0.20.1-np112py36_0
patsy: 0.4.1-py36_0
pip: 9.0.1-py36_1
python: 3.6.1-2
python-dateutil: 2.6.0-py36_0
pytz: 2017.2-py36_0
readline: 6.2-2
scipy: 0.19.0-np112py36_0
setuptools: 27.2.0-py36_0
six: 1.10.0-py36_0
sqlite: 3.13.0-0
statsmodels: 0.8.0-np112py36_0
tk: 8.5.18-0
wheel: 0.29.0-py36_0
xz: 5.2.2-1
zlib: 1.2.8-3
Proceed ([y]/n)? y
CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/osx-64/patsy-0.4.1-py36_0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/osx-64/patsy-0.4.1-py36_0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/osx-64/patsy-0.4.1-py36_0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
$ conda -V
conda 4.3.18
```
Here is the debug version:
```
$ conda install -vv --offline statsmodels
```
Output is here:
[log.txt](https://github.com/conda/conda/files/1015977/log.txt)
[log.txt](https://github.com/conda/conda/files/1015978/log.txt)
```
Thanks Ian. This is a new code path for triggering the EnforceUnusedAdapter that I don't think we've seen before. This is helpful.
```
Traceback (most recent call last):
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/exceptions.py", line 632, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/cli/main.py", line 134, in _main
exit_code = args.func(args, p)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/cli/install.py", line 357, in install
execute_actions(actions, index, verbose=not context.quiet)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 100, in PROGRESSIVEFETCHEXTRACT_CMD
progressive_fetch_extract.execute()
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 494, in execute
self._execute_action(action)
File "/Users/ijstokes/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 516, in _execute_action
raise CondaMultiError(exceptions)
conda.CondaMultiError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/osx-64/patsy-0.4.1-py36_0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
```
@kalefranz this is killing me. I'm doing a tonne of work this week offline and I can barely use conda because of this. Planes, buses, rooftops, etc. No internet, and `--offline` is continuing to give me the 3x `EnforceUnusedAdapter` error message before borking out. I'm amazed other people aren't also suffering from this. Anyway, this is just to say that I don't think this is triggered in `--offline` edge-cases, it feels to me like it still happens "regularly" when that option is used. Of if I have some weird config somewhere please let me know so I can at least reduce the frequency of the problem until the issue is resolved.
I am using conda 4.3.21
@kalefranz: I'm now on conda v4.4.0rc1 (on Linux x86_64) and I continue to get online operations when using `--offline`:
```
$ conda create -p /nfs/shared/commonenvs/ana44py36 anaconda=4.4 python=3.6 --offline
Solving environment: done
## Package Plan ##
environment location: /nfs/shared/commonenvs/ana44py36
added / updated specs:
- anaconda=4.4
- python=3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
anaconda-navigator-1.6.2 | py36_0 3.8 MB
asn1crypto-0.22.0 | py36_0 148 KB
anaconda-client-1.6.3 | py36_0 129 KB
astroid-1.4.9 | py36_0 265 KB
anaconda-project-0.6.0 | py36_0 209 KB
_license-1.1 | py36_1 356 KB
alabaster-0.7.10 | py36_0 14 KB
babel-2.4.0 | py36_0 4.9 MB
astropy-1.3.2 | np112py36_0 9.1 MB
------------------------------------------------------------
Total: 18.9 MB
```
And the obligatory `conda info -a`:
```
$ conda info -a
active environment : None
user config file : /home/anaconda/.condarc
populated config files :
conda version : 4.4.0rc1
conda-build version : not installed
python version : 3.6.1.final.0
base environment : /nfs/shared/anaconda (writable)
channel URLs : 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
package cache : /nfs/shared/anaconda/pkgs
/home/anaconda/.conda/pkgs
envs directories : /nfs/shared/anaconda/envs
/home/anaconda/.conda/envs
platform : linux-64
user-agent : conda/4.4.0rc1 requests/2.14.2 CPython/3.6.1 Linux/3.10.0-514.26.2.el7.x86_64 centos/7 glibc/2.17
UID:GID : 2112:2112
netrc file : None
offline mode : False
# conda environments:
#
base * /nfs/shared/anaconda
sys.version: 3.6.1 |Anaconda 4.4.0 (64-bit)| (default...
sys.prefix: /nfs/shared/anaconda
sys.executable: /nfs/shared/anaconda/bin/python
conda location: /nfs/shared/anaconda/lib/python3.6/site-packages/conda
conda-build: None
conda-env: /nfs/shared/anaconda/bin/conda-env
conda-server: /nfs/shared/anaconda/bin/conda-server
user site dirs:
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
LD_LIBRARY_PATH: <not set>
PATH: /nfs/shared/anaconda/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/anaconda/.local/bin:/home/anaconda/bin
PYTHONHOME: <not set>
PYTHONPATH: <not set>
License directories:
/home/anaconda/.continuum
/nfs/shared/anaconda/licenses
License files (license*.txt):
Package/feature end dates:
```
OK, interesting: with the example above I selected "N" to not proceed, but then on the same system I tried a variation and had a repeat of the `RuntimeError` already reported above in https://github.com/conda/conda/issues/5370#issuecomment-302855573 above
```
$ conda create -p /nfs/shared/commonenvs/py36 python=3.6 --offline
Solving environment: done
## Package Plan ##
environment location: /nfs/shared/commonenvs/py36
added / updated specs:
- python=3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
python-3.6.2 | 0 16.5 MB
xz-5.2.3 | 0 667 KB
zlib-1.2.11 | 0 109 KB
------------------------------------------------------------
Total: 17.2 MB
The following NEW packages will be INSTALLED:
openssl: 1.0.2l-0
pip: 9.0.1-py36_1
python: 3.6.2-0
readline: 6.2-2
setuptools: 27.2.0-py36_0
sqlite: 3.13.0-0
tk: 8.5.18-0
wheel: 0.29.0-py36_0
xz: 5.2.3-0
zlib: 1.2.11-0
Proceed ([y]/n)? y
Downloading and Extracting Packages
python 3.6.2: | 0%
xz 5.2.3: | 0%
zlib 1.2.11: | 0%
RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/python-3.6.2-0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/xz-5.2.3-0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/zlib-1.2.11-0.tar.bz2\nThis command is using a remote connection in offline mode.\n',)
```
I believe I am experiencing this same issue, or at least the same symptoms. I am trying to install a module into a conda created environment with --offline, and am getting the runtime error. I am using Conda 4.3.29.
I have the standard install of Anaconda 5.0, and I added the theano package.
If I create a new environment, and use "conda install --offline theano", then I get a dozen or so packages it says it will install, along with theano, and then it gives the RunTimeError on the numpy package.
If I create a new environment, and use "conda install --offline anaconda", that succeeds. If I then do the offline theano install, that ALSO succeeds.
Should I post the debug output, or start a new thread about this instead of posting here?
Thanks.
@robgics I believe you're seeing expected behavior. The packages that the solver decides to install need to be in the package cache, otherwise conda will go out and try to get them. The solver has no information about which packages are in the package cache and which don't.
However, perhaps with the `--offline` flag, we should only be exposing to the solver packages that are in the package cache and packages that are already in the target environment. We could probably make that happen.
To clarify, what I meant was that `--offline` flag should mean that we never add full repodata to the index handed to the solver.
@kalefranz to this point:
> However, perhaps with the --offline flag, we should only be exposing to the solver packages that are in the package cache and packages that are already in the target environment.
What other interpretation than this would make sense in the presence of the `--offline` flag?
The distinction is that we currently use the cached, although full, repodata.json file to construct index. I'm agreeing that the logic is flawed there. In this case, we should only be constructing the index from cached packages on disk, any packages installed in the target prefix, and any channels that are located at `file://` urls.
I agree that --offline should mean that it does not try to go online.
What I don't understand is how it doesn't work with the packages that are already installed, namely numpy. The files are all there, because if I install anaconda first and then theano, it all works (all while being disconnected physically from the internet). But if I try to install theano without anaconda first, it dies on numpy.
The solver is probably just selecting a version of numpy that is not available locally, and so there's no choice but to try going out and getting it. The solution I outlined above will prevent the solver from even having an unavailable package as an option to choose.
Sounds good, I look forward to it!
Is there a relatively simple workaround in the meantime? It would help my project move forward. Thanks.
| 2017-11-30T00:36:31 |
|
conda/conda | 6,434 | conda__conda-6434 | [
"6429"
] | c06adf205b195329c7c13533cac2fd3e20302145 | 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
@@ -25,7 +25,7 @@
def execute(args, parser):
- if not (args.all or args.package_names or args.features):
+ if not (args.all or args.package_names):
raise CondaValueError('no package names supplied,\n'
' try "conda remove -h" for more details')
| conda 4.4.0rc2 AttributeError on 'conda remove'
"command": "/home/matt/anaconda3/bin/conda remove --name tensorflow"
```
AttributeError", "exception_type": "<class 'AttributeError'>", "traceback": "Traceback (most recent call last):
File \"/home/matt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py\", line 683, in __call__
return func(*args, **kwargs)
File \"/home/matt/anaconda3/lib/python3.6/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/matt/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/matt/anaconda3/lib/python3.6/site-packages/conda/cli/main_remove.py\", line 28, in execute
if not (args.all or args.package_names or args.features):
AttributeError: 'Namespace' object has no attribute 'features'
```
| 2017-12-11T18:12:15 |
||
conda/conda | 6,436 | conda__conda-6436 | [
"6431"
] | c06adf205b195329c7c13533cac2fd3e20302145 | 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
@@ -195,33 +195,25 @@ def get_info_dict(system=False):
info_dict['UID'] = os.geteuid()
info_dict['GID'] = os.getegid()
- if system:
- evars = {
- 'CIO_TEST',
- 'CONDA_DEFAULT_ENV',
- 'CONDA_ENVS_PATH',
- 'DYLD_LIBRARY_PATH',
- 'FTP_PROXY',
- 'HTTP_PROXY',
- 'HTTPS_PROXY',
- 'LD_LIBRARY_PATH',
- 'PATH',
- 'PYTHONHOME',
- 'PYTHONPATH',
- 'REQUESTS_CA_BUNDLE',
- 'SSL_CERT_FILE',
- }
-
- evars.update(v for v in os.environ if v.startswith('CONDA_'))
- evars.update(v for v in os.environ if v.startswith('conda_'))
-
- info_dict.update({
- 'sys.version': sys.version,
- 'sys.prefix': sys.prefix,
- 'sys.executable': sys.executable,
- 'site_dirs': get_user_site(),
- 'env_vars': {ev: os.getenv(ev, os.getenv(ev.lower(), '<not set>')) for ev in evars},
- })
+ evars = {
+ 'CIO_TEST',
+ 'REQUESTS_CA_BUNDLE',
+ 'SSL_CERT_FILE',
+ }
+
+ # add all relevant env vars, e.g. startswith('CONDA') or endswith('PATH')
+ evars.update(v for v in os.environ if v.upper().startswith('CONDA'))
+ evars.update(v for v in os.environ if v.upper().startswith('PYTHON'))
+ evars.update(v for v in os.environ if v.upper().endswith('PROXY'))
+ evars.update(v for v in os.environ if v.upper().endswith('PATH'))
+
+ info_dict.update({
+ 'sys.version': sys.version,
+ 'sys.prefix': sys.prefix,
+ 'sys.executable': sys.executable,
+ 'site_dirs': get_user_site(),
+ 'env_vars': {ev: os.getenv(ev, os.getenv(ev.lower(), '<not set>')) for ev in evars},
+ })
return info_dict
| diff --git a/tests/test_info.py b/tests/test_info.py
--- a/tests/test_info.py
+++ b/tests/test_info.py
@@ -31,12 +31,8 @@ def test_info():
conda_info_s_out, conda_info_s_err, rc = run_command(Commands.INFO, '-s')
assert_equals(conda_info_s_err, '')
for name in ['sys.version', 'sys.prefix', 'sys.executable', 'conda location',
- 'conda-build', 'CONDA_DEFAULT_ENV', 'PATH', 'PYTHONPATH']:
+ 'conda-build', 'PATH']:
assert_in(name, conda_info_s_out)
- if context.platform == 'linux':
- assert_in('LD_LIBRARY_PATH', conda_info_s_out)
- if context.platform == 'osx':
- assert_in('DYLD_LIBRARY_PATH', conda_info_s_out)
conda_info_all_out, conda_info_all_err, rc = run_command(Commands.INFO, '--all')
assert_equals(conda_info_all_err, '')
| conda 4.4.0rc2 AssertionError on 'conda create'
"command": "/home/travis/miniconda/bin/conda create -y -p /home/travis/build/conda/conda-build/tests/conda_build_bootstrap_test git"
```
Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 265, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/gateways/disk/read.py\", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
FileNotFoundError: [Errno 2] No such file or directory: '/home/travis/miniconda/pkgs/test_source_files-1-0/info/repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 276, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/gateways/disk/read.py\", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
FileNotFoundError: [Errno 2] No such file or directory: '/home/travis/miniconda/pkgs/test_source_files-1-0/info/index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/exceptions.py\", line 683, in __call__
return func(*args, **kwargs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/cli/main_create.py\", line 11, in execute
install(args, parser, 'create')
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/cli/install.py\", line 241, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/cli/install.py\", line 258, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/link.py\", line 704, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/link.py\", line 687, in make_legacy_action_groups
pfe.prepare()
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 504, in prepare
for prec in self.link_precs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 504, in <genexpr>
for prec in self.link_precs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 399, in make_actions_for_record
), None)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 396, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 397, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 208, in _package_cache_records
return self.__package_cache_records or self.load() or self.__package_cache_records
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 88, in load
package_cache_record = self._make_single_record(base_name)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/core/package_cache.py\", line 291, in _make_single_record
extract_tarball(package_tarball_full_path, extracted_package_dir)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda-4.4.0rc2.post15+0dc8573d-py3.6.egg/conda/gateways/disk/create.py\", line 133, in extract_tarball
assert not lexists(destination_directory), destination_directory
AssertionError: /home/travis/miniconda/pkgs/test_source_files-1-0
```
| This was in Travix CI, and a post 4.4.0rc2 version. | 2017-12-11T18:35:55 |
conda/conda | 6,442 | conda__conda-6442 | [
"6441"
] | 5c0cf2afb1c2d0b1dddd7e396cf13f4bfaecf4d6 | diff --git a/conda/models/match_spec.py b/conda/models/match_spec.py
--- a/conda/models/match_spec.py
+++ b/conda/models/match_spec.py
@@ -349,10 +349,8 @@ def _make(field_name, value):
matcher = value
elif field_name in _implementors:
matcher = _implementors[field_name](value)
- elif text_type(value):
- matcher = StrMatch(value)
else:
- raise NotImplementedError()
+ matcher = StrMatch(text_type(value))
return field_name, matcher
| conda 4.4.0rc2 NotImplementedError on 'conda list'
"command": "/home/rob/miniconda3/bin/conda list"
```
Traceback (most recent call last):
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/exceptions.py\", line 683, in __call__
return func(*args, **kwargs)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 150, in execute
show_channel_urls=context.show_channel_urls)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 90, in print_packages
show_channel_urls=show_channel_urls)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 52, in list_packages
info = is_linked(prefix, dist)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/core/linked_data.py\", line 166, in is_linked
elif MatchSpec(dist).match(prefix_record):
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 67, in __call__
return super(MatchSpecType, cls).__call__(**parsed)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 178, in __init__
self._match_components = self._build_components(**kwargs)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 359, in _build_components
return frozendict(_make(key, value) for key, value in iteritems(kwargs))
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 359, in <genexpr>
return frozendict(_make(key, value) for key, value in iteritems(kwargs))
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 355, in _make
raise NotImplementedError()
NotImplementedError
```
| 2017-12-12T18:06:40 |
||
conda/conda | 6,446 | conda__conda-6446 | [
"6419"
] | 3d8374eba3a0335c3ac466c3000898d057187792 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -51,7 +51,7 @@ def __init__(self, shell, arguments=None):
self.shift_args = 0
self.unset_var_tmpl = 'unset %s'
- self.set_var_tmpl = 'export %s="%s"'
+ self.set_var_tmpl = "export %s='%s'"
self.run_script_tmpl = '. "%s"'
elif shell == 'csh':
@@ -73,7 +73,7 @@ def __init__(self, shell, arguments=None):
self.shift_args = 0
self.unset_var_tmpl = 'del $%s'
- self.set_var_tmpl = '$%s = "%s"'
+ self.set_var_tmpl = "$%s = '%s'"
self.run_script_tmpl = 'source "%s"'
elif shell == 'cmd.exe':
@@ -257,6 +257,8 @@ def build_activate(self, env_name_or_prefix):
}
deactivate_scripts = ()
+ self._update_prompt(set_vars, conda_prompt_modifier)
+
return {
'unset_vars': (),
'set_vars': set_vars,
@@ -283,6 +285,7 @@ def build_deactivate(self):
assert old_conda_shlvl > 0
if old_conda_shlvl == 1:
# TODO: warn conda floor
+ conda_prompt_modifier = ''
unset_vars = (
'CONDA_PREFIX',
'CONDA_DEFAULT_ENV',
@@ -311,6 +314,8 @@ def build_deactivate(self):
}
activate_scripts = self._get_activate_scripts(new_prefix)
+ self._update_prompt(set_vars, conda_prompt_modifier)
+
return {
'unset_vars': unset_vars,
'set_vars': set_vars,
@@ -399,6 +404,19 @@ def _replace_prefix_in_path(self, old_prefix, new_prefix, starting_path_dirs=Non
path_list.insert(idx, join(new_prefix, 'bin'))
return self.path_conversion(path_list)
+ def _update_prompt(self, set_vars, conda_prompt_modifier):
+ if not context.changeps1:
+ return
+
+ if self.shell == 'posix':
+ ps1 = os.environ.get('PS1', '')
+ current_prompt_modifier = os.environ.get('CONDA_PROMPT_MODIFIER')
+ if current_prompt_modifier:
+ ps1 = re.sub(re.escape(current_prompt_modifier), r'', ps1)
+ set_vars.update({
+ 'PS1': conda_prompt_modifier + ps1,
+ })
+
def _default_env(self, prefix):
if prefix == context.root_prefix:
return 'base'
| diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -152,6 +152,8 @@ def test_build_activate_shlvl_0(self):
activator = Activator('posix')
builder = activator.build_activate(td)
new_path = activator.pathsep_join(activator._add_prefix_to_path(td))
+ conda_prompt_modifier = "(%s) " % td
+ ps1 = conda_prompt_modifier + os.environ.get('PS1', '')
assert builder['unset_vars'] == ()
@@ -161,7 +163,8 @@ def test_build_activate_shlvl_0(self):
'CONDA_PREFIX': td,
'CONDA_SHLVL': 1,
'CONDA_DEFAULT_ENV': td,
- 'CONDA_PROMPT_MODIFIER': "(%s) " % td,
+ 'CONDA_PROMPT_MODIFIER': conda_prompt_modifier,
+ 'PS1': ps1,
}
assert builder['set_vars'] == set_vars
assert builder['activate_scripts'] == (activator.path_conversion(activate_d_1),)
@@ -182,6 +185,8 @@ def test_build_activate_shlvl_1(self):
activator = Activator('posix')
builder = activator.build_activate(td)
new_path = activator.pathsep_join(activator._add_prefix_to_path(td))
+ conda_prompt_modifier = "(%s) " % td
+ ps1 = conda_prompt_modifier + os.environ.get('PS1', '')
assert builder['unset_vars'] == ()
@@ -191,7 +196,8 @@ def test_build_activate_shlvl_1(self):
'CONDA_PREFIX_1': old_prefix,
'CONDA_SHLVL': 2,
'CONDA_DEFAULT_ENV': td,
- 'CONDA_PROMPT_MODIFIER': "(%s) " % td,
+ 'CONDA_PROMPT_MODIFIER': conda_prompt_modifier,
+ 'PS1': ps1,
}
assert builder['set_vars'] == set_vars
assert builder['activate_scripts'] == (activator.path_conversion(activate_d_1),)
@@ -218,6 +224,8 @@ def test_build_activate_shlvl_2(self):
activator = Activator('posix')
builder = activator.build_activate(td)
new_path = activator.pathsep_join(activator._add_prefix_to_path(td))
+ conda_prompt_modifier = "(%s) " % td
+ ps1 = conda_prompt_modifier + os.environ.get('PS1', '')
assert builder['unset_vars'] == ()
@@ -225,7 +233,8 @@ def test_build_activate_shlvl_2(self):
'PATH': new_path,
'CONDA_PREFIX': td,
'CONDA_DEFAULT_ENV': td,
- 'CONDA_PROMPT_MODIFIER': "(%s) " % td,
+ 'CONDA_PROMPT_MODIFIER': conda_prompt_modifier,
+ 'PS1': ps1,
}
assert builder['set_vars'] == set_vars
assert builder['activate_scripts'] == (activator.path_conversion(activate_d_1),)
@@ -289,13 +298,16 @@ def test_build_deactivate_shlvl_2(self):
assert builder['unset_vars'] == ('CONDA_PREFIX_1',)
new_path = activator.pathsep_join(activator.path_conversion(original_path))
+ conda_prompt_modifier = "(%s) " % old_prefix
+ ps1 = conda_prompt_modifier + os.environ.get('PS1', '')
set_vars = {
'PATH': new_path,
'CONDA_SHLVL': 1,
'CONDA_PREFIX': old_prefix,
'CONDA_DEFAULT_ENV': old_prefix,
- 'CONDA_PROMPT_MODIFIER': "(%s) " % old_prefix,
+ 'CONDA_PROMPT_MODIFIER': conda_prompt_modifier,
+ 'PS1': ps1,
}
assert builder['set_vars'] == set_vars
assert builder['activate_scripts'] == (activator.path_conversion(activate_d_1),)
@@ -327,6 +339,7 @@ def test_build_deactivate_shlvl_1(self):
assert builder['set_vars'] == {
'PATH': new_path,
'CONDA_SHLVL': 0,
+ 'PS1': os.environ.get('PS1', ''),
}
assert builder['activate_scripts'] == ()
assert builder['deactivate_scripts'] == (activator.path_conversion(deactivate_d_1),)
@@ -389,12 +402,13 @@ def test_posix_basic(self):
new_path_parts = activator._add_prefix_to_path(self.prefix)
assert activate_data == dals("""
- export CONDA_DEFAULT_ENV="%(native_prefix)s"
- export CONDA_PREFIX="%(native_prefix)s"
- export CONDA_PROMPT_MODIFIER="(%(native_prefix)s) "
- export CONDA_PYTHON_EXE="%(sys_executable)s"
- export CONDA_SHLVL="1"
- export PATH="%(new_path)s"
+ export CONDA_DEFAULT_ENV='%(native_prefix)s'
+ export CONDA_PREFIX='%(native_prefix)s'
+ export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
+ export CONDA_PYTHON_EXE='%(sys_executable)s'
+ export CONDA_SHLVL='1'
+ export PATH='%(new_path)s'
+ export PS1='%(ps1)s'
. "%(activate1)s"
""") % {
'converted_prefix': activator.path_conversion(self.prefix),
@@ -402,6 +416,7 @@ def test_posix_basic(self):
'new_path': activator.pathsep_join(new_path_parts),
'sys_executable': activator.path_conversion(sys.executable),
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.sh')),
+ 'ps1': '(%s) ' % self.prefix + os.environ.get('PS1', '')
}
with env_vars({
@@ -416,8 +431,8 @@ def test_posix_basic(self):
reactivate_data = c.stdout
assert reactivate_data == dals("""
- export CONDA_PROMPT_MODIFIER="(%(native_prefix)s) "
- export CONDA_SHLVL="1"
+ export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
+ export CONDA_SHLVL='1'
. "%(deactivate1)s"
. "%(activate1)s"
""") % {
@@ -438,13 +453,14 @@ def test_posix_basic(self):
unset CONDA_PREFIX
unset CONDA_PROMPT_MODIFIER
unset CONDA_PYTHON_EXE
- export CONDA_SHLVL="0"
- export PATH="%(new_path)s"
+ export CONDA_SHLVL='0'
+ export PATH='%(new_path)s'
+ export PS1='%(ps1)s'
. "%(deactivate1)s"
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.sh')),
-
+ 'ps1': os.environ.get('PS1', ''),
}
def test_cmd_exe_basic(self):
@@ -612,12 +628,12 @@ def test_xonsh_basic(self):
new_path_parts = activator._add_prefix_to_path(self.prefix)
assert activate_data == dals("""
- $CONDA_DEFAULT_ENV = "%(native_prefix)s"
- $CONDA_PREFIX = "%(native_prefix)s"
- $CONDA_PROMPT_MODIFIER = "(%(native_prefix)s) "
- $CONDA_PYTHON_EXE = "%(sys_executable)s"
- $CONDA_SHLVL = "1"
- $PATH = "%(new_path)s"
+ $CONDA_DEFAULT_ENV = '%(native_prefix)s'
+ $CONDA_PREFIX = '%(native_prefix)s'
+ $CONDA_PROMPT_MODIFIER = '(%(native_prefix)s) '
+ $CONDA_PYTHON_EXE = '%(sys_executable)s'
+ $CONDA_SHLVL = '1'
+ $PATH = '%(new_path)s'
source "%(activate1)s"
""") % {
'converted_prefix': activator.path_conversion(self.prefix),
@@ -642,8 +658,8 @@ def test_xonsh_basic(self):
rm_rf(reactivate_result)
assert reactivate_data == dals("""
- $CONDA_PROMPT_MODIFIER = "(%(native_prefix)s) "
- $CONDA_SHLVL = "1"
+ $CONDA_PROMPT_MODIFIER = '(%(native_prefix)s) '
+ $CONDA_SHLVL = '1'
source "%(deactivate1)s"
source "%(activate1)s"
""") % {
@@ -667,8 +683,8 @@ def test_xonsh_basic(self):
del $CONDA_PREFIX
del $CONDA_PROMPT_MODIFIER
del $CONDA_PYTHON_EXE
- $CONDA_SHLVL = "0"
- $PATH = "%(new_path)s"
+ $CONDA_SHLVL = '0'
+ $PATH = '%(new_path)s'
source "%(deactivate1)s"
""") % {
'new_path': new_path,
@@ -931,7 +947,7 @@ def tearDown(self):
def basic_posix(self, shell):
shell.assert_env_var('CONDA_SHLVL', '0')
shell.sendline('conda activate root')
- shell.assert_env_var('PS1', '\$CONDA_PROMPT_MODIFIER.*')
+ shell.assert_env_var('PS1', '(base).*')
shell.assert_env_var('CONDA_SHLVL', '1')
shell.sendline('conda activate "%s"' % self.prefix)
shell.assert_env_var('CONDA_SHLVL', '2')
@@ -959,10 +975,10 @@ def test_dash_basic_integration(self):
shell.sendline('env | sort')
self.basic_posix(shell)
- # @pytest.mark.skipif(not which('zsh'), reason='zsh not installed')
- # def test_zsh_basic_integration(self):
- # with InteractiveShell('zsh') as shell:
- # self.basic_posix(shell)
+ @pytest.mark.skipif(not which('zsh'), reason='zsh not installed')
+ def test_zsh_basic_integration(self):
+ with InteractiveShell('zsh') as shell:
+ self.basic_posix(shell)
@pytest.mark.skipif(not which('cmd.exe'), reason='cmd.exe not installed')
def test_cmd_exe_basic_integration(self):
| conda 4.4 weird prompt addition in zsh
Before conda 4.4 my prompt with zsh would look like this, when I'm in my conda env `stable`:
![screenshot 2017-12-08 13 03 34](https://user-images.githubusercontent.com/69774/33783092-6ecd025c-dc18-11e7-8901-de81ac085f2c.png)
After the update to conda 4.4 (using the blog instructions), I have this:
![screenshot 2017-12-08 13 03 43](https://user-images.githubusercontent.com/69774/33783112-8784582c-dc18-11e7-9388-fa681f85de5a.png)
Note the addition of '\[\]' that was added after the environment ID.
How can I get rid of that?
Using zsh 5.4.2 on macOS 10.12.6
| 2017-12-13T16:31:58 |
|
conda/conda | 6,447 | conda__conda-6447 | [
"6445"
] | 63234e0470d793e2e2bcfd958de094bbe9223571 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -191,14 +191,8 @@ def _yield_commands(self, cmds_dict):
yield self.run_script_tmpl % script
def build_activate(self, env_name_or_prefix):
- test_path = expand(env_name_or_prefix)
- if isdir(test_path):
- prefix = test_path
- if not isdir(join(prefix, 'conda-meta')):
- from .exceptions import EnvironmentLocationNotFound
- raise EnvironmentLocationNotFound(prefix)
- elif re.search(r'\\|/', env_name_or_prefix):
- prefix = env_name_or_prefix
+ if re.search(r'\\|/', env_name_or_prefix):
+ prefix = expand(env_name_or_prefix)
if not isdir(join(prefix, 'conda-meta')):
from .exceptions import EnvironmentLocationNotFound
raise EnvironmentLocationNotFound(prefix)
| conda 4.4.0rc: 'Not a conda environment' plus environments that shouldn't be there
I have a python 3.6 root environment with conda 4.4.0rc2 installed in /usr/local/Anaconda/conda_root/3.6. I sourced $CONDA_ROOT/etc/profile.d/conda.sh.
```shell
$ conda --version
conda 4.4.0rc2
$ conda info
active environment : base
active env location : /usr/local/Anaconda/conda_root/3.6
shell level : 1
user config file : /home/helixapp/.condarc
populated config files : /usr/local/Anaconda/conda_root/3.6/.condarc
conda version : 4.4.0rc2
conda-build version : not installed
python version : 3.6.3.final.0
base environment : /usr/local/Anaconda/conda_root/3.6 (writable)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/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
package cache : /usr/local/Anaconda/conda_root/3.6/pkgs
/home/$USER/.conda/pkgs
envs directories : /usr/local/Anaconda/conda_root/3.6/envs
/home/$USER/.conda/envs
platform : linux-64
user-agent : conda/4.4.0rc2 requests/2.14.2 CPython/3.6.2 Linux/3.10.0-693.2.2.el7.x86_64 centos/7 glibc/2.17
UID:GID : 31672:57823
netrc file : None
offline mode : False
```
### Issue 1
`conda info --envs` and `conda env list` see environments outside of the envs directories
```shell
$ conda info --envs
# conda environments:
#
0.2.2 /spin1/sys2/usrlocal/Anaconda/envs_app/crossmap/0.2.2
1.0.0 /spin1/sys2/usrlocal/Anaconda/envs_app/iva/1.0.0
1.0.2 /spin1/sys2/usrlocal/Anaconda/envs_app/iva/1.0.2
base * /usr/local/Anaconda/conda_root/3.6
test /usr/local/Anaconda/conda_root/3.6/envs/test
R3.4 /usr/local/Anaconda/envs/R3.4
py2.7 /usr/local/Anaconda/envs/py2.7
py3.5 /usr/local/Anaconda/envs/py3.5
```
`conda env list` returns the same result
We have many more environments which aren't seen. But it seems to me the only ones listed should be `base` and `test`.
### Issue 2
`conda activate test` fails due to the existence of the directory `/home/$USER/test`
```shell
$ conda activate test
Not a conda environment: /home/$USER/test
$ ls -lhd /home/$USER/test
drwxr-xr-x 3 $USER group 4.0K Nov 23 10:56 /home/$USER/test
```
`conda activate /usr/local/Anaconda/conda_root/3.6/envs/test` works.
This works fine for `/usr/local/Anaconda/conda_root/3.6/envs/c44testing`, because the name is unique:
```shell
$ conda activate c44testing
(c44testing)$
```
Why is `conda activate` looking in `$HOME` for names matching the environment name? `$HOME` is not in the list of environment directories (`$HOME`/.conda/envs is)
| > `conda info --envs` and `conda env list` see environments outside of the envs directories
This is intentional and as-designed, so long as those paths are indeed conda environments.
Issue 2 needs a solution for sure though. | 2017-12-13T16:44:22 |
|
conda/conda | 6,448 | conda__conda-6448 | [
"6283"
] | 63234e0470d793e2e2bcfd958de094bbe9223571 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -575,7 +575,6 @@ def list_parameters(self):
'ignore_pinned',
'max_shlvl',
'migrated_custom_channels',
- 'no_dependencies',
'only_dependencies',
'prune',
'root_prefix',
@@ -763,6 +762,10 @@ def get_help_dict():
A list of previously-used channel_alias values, useful for example when switching
between different Anaconda Repository instances.
"""),
+ 'no_dependencies': dals("""
+ Do not install, update, remove, or change dependencies. This WILL lead to broken
+ environments and inconsistent behavior. Use at your own risk.
+ """),
'non_admin_enabled': dals("""
Allows completion of conda's create, install, update, and remove operations, for
non-privileged (non-root or non-administrator) users.
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -987,7 +987,8 @@ def add_parser_create_install_update(p):
p.add_argument(
"--no-deps",
action="store_true",
- help="Do not install dependencies.",
+ help="Do not install, update, remove, or change dependencies. This WILL lead "
+ "to broken environments and inconsistent behavior. Use at your own risk.",
)
p.add_argument(
"--only-deps",
diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -298,7 +298,6 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
if log.isEnabledFor(DEBUG):
log.debug("final specs to add: %s",
dashlist(sorted(text_type(s) for s in final_environment_specs)))
- pre_solution = solution
solution = r.solve(tuple(final_environment_specs)) # return value is List[dist]
# add back inconsistent packages to solution
@@ -312,13 +311,25 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
# Special case handling for various DepsModifer flags. Maybe this block could be pulled
# out into its own non-public helper method?
if deps_modifier == DepsModifier.NO_DEPS:
- # In the NO_DEPS case we're just filtering out packages from the solution.
- dont_add_packages = []
- new_packages = set(solution) - set(pre_solution)
- for dist in new_packages:
- if not any(spec.match(index[dist]) for spec in specs_to_add):
- dont_add_packages.append(dist)
- solution = tuple(rec for rec in solution if rec not in dont_add_packages)
+ # In the NO_DEPS case, we need to start with the original list of packages in the
+ # environment, and then only modify packages that match specs_to_add or
+ # specs_to_remove.
+ _no_deps_solution = IndexedSet(Dist(rec) for rec in prefix_data.iter_records())
+ only_remove_these = set(dist
+ for spec in specs_to_remove
+ for dist in _no_deps_solution
+ if spec.match(index[dist]))
+ _no_deps_solution -= only_remove_these
+
+ only_add_these = set(dist
+ for spec in specs_to_add
+ for dist in solution
+ if spec.match(index[dist]))
+ remove_before_adding_back = set(dist.name for dist in only_add_these)
+ _no_deps_solution = IndexedSet(dist for dist in _no_deps_solution
+ if dist.name not in remove_before_adding_back)
+ _no_deps_solution |= only_add_these
+ solution = _no_deps_solution
elif deps_modifier == DepsModifier.ONLY_DEPS:
# Using a special instance of the DAG to remove leaf nodes that match the original
# specs_to_add. It's important to only remove leaf nodes, because a typical use
| conda update .. --no-deps wants to remove dependencies
Using conda 4.4rc, when trying to update a single package with `--no-deps`, it actually wants to remove a whole lot of (unrelated) packages:
```
joris@joris-XPS-13-9350:~/scipy$ conda update shapely --no-deps
Solving environment: done
## Package Plan ##
environment location: /home/joris/miniconda3
added / updated specs:
- shapely
The following packages will be downloaded:
package | build
---------------------------|-----------------
shapely-1.6.2 | py35_1 703 KB conda-forge
The following packages will be REMOVED:
bottleneck: 1.2.1-np113py35_0 conda-forge
fiona: 1.7.9-py35_0 conda-forge
geos: 3.5.1-1 conda-forge
h5py: 2.7.0-np113py35_1 conda-forge
libgdal: 2.1.4-2 conda-forge
libspatialite: 4.3.0a-15 conda-forge
mahotas: 1.4.3-np113py35_1 conda-forge
numba: 0.34.0-np113py35_0
numexpr: 2.6.2-np113py35_0 conda-forge
numpy: 1.13.1-py35_blas_openblas_200 conda-forge [blas_openblas]
opencv: 3.2.0-np113py35_blas_openblas_204 conda-forge [blas_openblas]
pytables: 3.4.2-np113py35_1 conda-forge
pywavelets: 0.5.2-np113py35_0 conda-forge
statsmodels: 0.8.0-np113py35_0 conda-forge
turbodbc: 2.2.0-np113py35_0 conda-forge
The following packages will be UPDATED:
shapely: 1.6.0-py35_0 conda-forge --> 1.6.2-py35_1 conda-forge
Proceed ([y]/n)?
```
I don't see this behaviour when downgrading conda to 4.3
(see also discussion on gitter: https://gitter.im/conda/conda?at=5a01863532e080696e74a5aa)
I am using conda-forge as default channel:
```
joris@joris-XPS-13-9350:~/scipy$ conda info
active environment : None
shell level : 0
user config file : /home/joris/.condarc
populated config files : /home/joris/.condarc
conda version : 4.4.0rc1
conda-build version : 3.0.1
python version : 3.5.4.final.0
base environment : /home/joris/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-canary/linux-64
https://conda.anaconda.org/conda-canary/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/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
package cache : /home/joris/miniconda3/pkgs
/home/joris/.conda/pkgs
envs directories : /home/joris/miniconda3/envs
/home/joris/.conda/envs
platform : linux-64
user-agent : conda/4.4.0rc1 requests/2.13.0 CPython/3.5.4 Linux/4.4.0-97-generic ubuntu/16.04 glibc/2.23
UID:GID : 1000:1000
netrc file : None
offline mode : False
```
| The original reason I tried `--no-deps` is because without that it actually tried to downgrade numpy and a bunch of depending packages (that might be the actual problem actually):
```
joris@joris-XPS-13-9350:~/scipy$ conda update shapely
Solving environment: done
## Package Plan ##
environment location: /home/joris/miniconda3
added / updated specs:
- shapely
The following packages will be downloaded:
package | build
---------------------------|-----------------
numexpr-2.6.4 | py35_0 426 KB conda-forge
geos-3.6.2 | 0 19.9 MB conda-forge
fiona-1.7.0 | np111py35_0 1.1 MB conda-forge
libgdal-2.0.0 | 1 47.0 MB
numba-0.34.0 | np111py35_0 2.5 MB
shapely-1.6.2 | py35_1 703 KB conda-forge
gdal-2.0.0 | py35_1 1.4 MB
opencv-3.3.0 |py35_blas_openblas_200 49.2 MB conda-forge
numpy-1.11.3 |py35_blas_openblas_202 7.5 MB conda-forge
turbodbc-2.4.1 | py35_1 9.0 MB conda-forge
mahotas-1.4.4 | py35_0 4.1 MB conda-forge
pywavelets-0.5.2 | py35_1 5.6 MB conda-forge
pytables-3.4.2 | py35_5 7.0 MB conda-forge
libspatialite-4.3.0a | 16 4.6 MB conda-forge
------------------------------------------------------------
Total: 160.1 MB
The following NEW packages will be INSTALLED:
gdal: 2.0.0-py35_1
The following packages will be UPDATED:
bottleneck: 1.2.1-np113py35_0 conda-forge --> 1.2.1-py35_1 conda-forge
geos: 3.5.1-1 conda-forge --> 3.6.2-0 conda-forge
h5py: 2.7.0-np113py35_1 conda-forge --> 2.7.1-py35_1 conda-forge
libspatialite: 4.3.0a-15 conda-forge --> 4.3.0a-16 conda-forge
mahotas: 1.4.3-np113py35_1 conda-forge --> 1.4.4-py35_0 conda-forge
numba: 0.34.0-np113py35_0 --> 0.34.0-np111py35_0
numexpr: 2.6.2-np113py35_0 conda-forge --> 2.6.4-py35_0 conda-forge
opencv: 3.2.0-np113py35_blas_openblas_204 conda-forge [blas_openblas] --> 3.3.0-py35_blas_openblas_200 conda-forge [blas_openblas]
pytables: 3.4.2-np113py35_1 conda-forge --> 3.4.2-py35_5 conda-forge
pywavelets: 0.5.2-np113py35_0 conda-forge --> 0.5.2-py35_1 conda-forge
shapely: 1.6.0-py35_0 conda-forge --> 1.6.2-py35_1 conda-forge
statsmodels: 0.8.0-np113py35_0 conda-forge --> 0.8.0-py35_0 conda-forge
turbodbc: 2.2.0-np113py35_0 conda-forge --> 2.4.1-py35_1 conda-forge
The following packages will be DOWNGRADED:
fiona: 1.7.9-py35_0 conda-forge --> 1.7.0-np111py35_0 conda-forge
libgdal: 2.1.4-2 conda-forge --> 2.0.0-1
numpy: 1.13.1-py35_blas_openblas_200 conda-forge [blas_openblas] --> 1.11.3-py35_blas_openblas_202 conda-forge [blas_openblas]
Proceed ([y]/n)? n
```
So this might also be a problem with the shapely package (although it seems to correctly specify only lower bound for numpy https://github.com/conda-forge/shapely-feedstock/blob/master/recipe/meta.yaml#L26)
Thanks for the report. This is probably a bug. I'll add it to the list to investigate.
Has there been any update on this? I came to this via #6281 . My conda installation is essentially unusable now for installing anything, as trying to install anything results in conda wanting to downgrade unrelated packages and upgrade even more unrelated packages.
@BrenBarn this issue is for conda 4.4, not conda 4.3 as in #6281. | 2017-12-13T17:25:02 |
|
conda/conda | 6,467 | conda__conda-6467 | [
"5158",
"6400"
] | 3d8374eba3a0335c3ac466c3000898d057187792 | diff --git a/conda/core/index.py b/conda/core/index.py
--- a/conda/core/index.py
+++ b/conda/core/index.py
@@ -160,6 +160,8 @@ def get_reduced_index(prefix, channels, subdirs, specs):
with backdown_thread_pool() as executor:
channel_urls = all_channel_urls(channels, subdirs=subdirs)
+ check_whitelist(channel_urls)
+
if context.offline:
grouped_urls = groupby(lambda url: url.startswith('file://'), channel_urls)
ignored_urls = grouped_urls.get(False, ())
| re-implement --override-channels
Work out a way for `--override-channels` to start working again, without violating the security model.
Will probably need to add an `#!exclude` flag for sequence config parameters as part of this task.
conda search --override-channels not working (4.3.30)?
My understanding of `--override-channels` is that results should be returned *only* for the specified channel. I'm pretty sure that was the previous behaviour.
As can be seen below despite specifying `--override-channels` and my anaconda.org channel results are being brought back from both conda-forge and defaults.
```
λ conda search --override-channels --channel https://conda.anaconda.org/dhirschfeld tensorflow
Fetching package metadata ...................
r-tensorflow 0.7 r3.3.2_0 conda-forge
0.7 r3.4.1_0 conda-forge
0.8.2 r3.4.1_0 defaults
1.4 r342h0bf44f9_0 defaults
tensorflow 0.12.0rc0 py35_0 dhirschfeld
0.12.1 py35_1 conda-forge
0.12.1 py35_2 conda-forge
1.0.0 py35_0 conda-forge
1.1.0 py35_0 conda-forge
1.1.0 np112py35_0 defaults
1.1.0 np112py36_0 defaults
1.2.0 py35_0 conda-forge
1.2.0 py36_0 conda-forge
1.2.0 py36_0 dhirschfeld
1.2.1 py35_0 conda-forge
1.2.1 py36_0 conda-forge
1.2.1 py35_0 defaults
1.2.1 py36_0 defaults
1.3.0 py35_0 conda-forge
1.3.0 py36_0 conda-forge
1.4.0 py35_0 conda-forge
* 1.4.0 py36_0 conda-forge
tensorflow-gpu 1.1.0 np112py35_0 defaults
1.1.0 np112py36_0 defaults
```
| Also `allow_other_channels` per #4026.
Any news on this bug ?
A workaround for this issue is to temporarily add the lines
```
default_channels: []
channels: []
```
to the `.condarc` file. This seems to disable all channels except those specified on the command line.
```
platform : win-64
conda version : 4.3.30
conda is private : False
conda-env version : 4.3.30
conda-build version : 0+unknown
python version : 3.6.3.final.0
requests version : 2.18.4
root environment : C:\Miniconda3 (writable)
default environment : C:\Miniconda3
envs directories : C:\Miniconda3\envs
C:\Users\dhirschf\AppData\Local\conda\conda\envs
C:\Users\dhirschf\.conda\envs
package cache : C:\Miniconda3\pkgs
C:\Users\dhirschf\AppData\Local\conda\conda\pkgs
channel URLs : https://conda.anaconda.org/dhirschfeld/win-64
https://conda.anaconda.org/dhirschfeld/noarch
https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/numba/win-64
https://conda.anaconda.org/numba/noarch
config file : C:\Users\dhirschf\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.30 requests/2.18.4 CPython/3.6.3 Windows/7 Windows/6.1.7601
administrator : True
```
What happened to the `channel_priority` in the `conda info` output? I'm sure it used to be there :confused:
```
λ conda info | grep priority
C:\dev\src
λ cat C:\Users\dhirschf\.condarc
channels:
- https://conda.anaconda.org/dhirschfeld
- defaults
- https://conda.anaconda.org/conda-forge
- https://conda.anaconda.org/numba
channel_priority: false
C:\dev\src
λ
I've been encountering this on OSX El Capitan with the same version while investigating another issue.
```
conda create --yes --name FIONATEST python=3.6
source activate FIONATEST
conda install --yes -c conda-forge --override-channels geopandas
conda list
```
fiona is a dependency of geopandas but the defaults channel version is what gets installed. This ends up breaking geopandas. It's also not the only package this happens with.
If I specifically install fiona along with geopandas, the correct channel is used.
```
source deactivate
conda env remove --yes --name FIONATEST
conda create --yes --name FIONATEST python=3.6
source activate FIONATEST
conda install --yes -c conda-forge --override-channels geopandas fiona
conda list
```
version info
```
platform : osx-64
conda version : 4.3.30
conda is private : False
conda-env version : 4.3.30
conda-build version : 3.0.27
python version : 3.6.3.final.0
requests version : 2.18.4
```
I'm having the same problem.
`--override-channel` has been broken for some time, see #5158.
I guess in the short term grep on the channel works. | 2017-12-15T16:30:44 |
|
conda/conda | 6,470 | conda__conda-6470 | [
"6466"
] | 3d8374eba3a0335c3ac466c3000898d057187792 | diff --git a/conda/egg_info.py b/conda/egg_info.py
--- a/conda/egg_info.py
+++ b/conda/egg_info.py
@@ -75,7 +75,7 @@ def get_egg_info(prefix, all_pkgs=False):
"""
installed_pkgs = linked_data(prefix)
sp_dir = get_site_packages_dir(installed_pkgs)
- if sp_dir is None:
+ if sp_dir is None or not isdir(join(prefix, sp_dir)):
return set()
conda_files = set()
| conda 4.4 rc2: failure in conda list when editable install has been moved
`conda list` for my root environment is working nicely using conda 4.3, but when upgrading with canary to conda 4.4.0 rc2, the `conda list` command fails with the following error:
```
joris@joris-XPS-13-9350:~/scipy$ conda list
# packages in environment at /home/joris/miniconda3:
#
`$ /home/joris/miniconda3/bin/conda list`
Traceback (most recent call last):
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/exceptions.py", line 683, in __call__
return func(*args, **kwargs)
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/cli/main_list.py", line 150, in execute
show_channel_urls=context.show_channel_urls)
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/cli/main_list.py", line 85, in print_packages
other_python = get_egg_info(prefix)
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/egg_info.py", line 86, in get_egg_info
for path in get_egg_info_files(join(prefix, sp_dir)):
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/egg_info.py", line 35, in get_egg_info_files
for egg in get_egg_info_files(reader.readline().strip()):
File "/home/joris/miniconda3/lib/python3.5/site-packages/conda/egg_info.py", line 32, in get_egg_info_files
for fn in os.listdir(sp_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/home/joris/scipy/dateutil'
```
The reason for this is that I once did `pip install -e .` in the '/home/joris/scipy/dateutil' directory to test out a dev install of dateutil. But later I removed it. Until now it was not a problem, but so now it is starting to give problems with conda 4.4.
I know I can fix this by removing it manually from easy-install.pth, but IMO it could be handles more gracefully by conda.
| . | 2017-12-15T17:49:40 |
|
conda/conda | 6,491 | conda__conda-6491 | [
"6350"
] | 334bb2ee17d0410460705b34eae16ec97e5ea8e1 | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -143,20 +143,34 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
# `solution` and `specs_map` are mutated throughout this method
prefix_data = PrefixData(self.prefix)
solution = tuple(Dist(d) for d in prefix_data.iter_records())
+ specs_from_history_map = History(self.prefix).get_requested_specs_map()
if prune or deps_modifier == DepsModifier.UPDATE_ALL:
- # start with empty specs map for UPDATE_ALL because we're optimizing the update
- # only for specs the user has requested; it's ok to remove dependencies
+ # Start with empty specs map for UPDATE_ALL because we're optimizing the update
+ # only for specs the user has requested; it's ok to remove dependencies.
specs_map = odict()
+
+ # However, because of https://github.com/conda/constructor/issues/138, we need
+ # to hard-code keeping conda, conda-build, and anaconda, if they're already in
+ # the environment.
+ solution_pkg_names = set(d.name for d in solution)
+ ensure_these = (pkg_name for pkg_name in {
+ 'anaconda', 'conda', 'conda-build',
+ } if pkg_name not in specs_from_history_map and pkg_name in solution_pkg_names)
+ for pkg_name in ensure_these:
+ specs_from_history_map[pkg_name] = MatchSpec(pkg_name)
else:
specs_map = odict((d.name, MatchSpec(d.name)) for d in solution)
# add in historically-requested specs
- specs_from_history_map = History(self.prefix).get_requested_specs_map()
specs_map.update(specs_from_history_map)
# let's pretend for now that this is the right place to build the index
- prepared_specs = tuple(concatv(specs_to_remove, specs_to_add,
- itervalues(specs_from_history_map)))
+ prepared_specs = set(concatv(
+ specs_to_remove,
+ specs_to_add,
+ itervalues(specs_from_history_map),
+ ))
+
index, r = self._prepare(prepared_specs)
if specs_to_remove:
@@ -247,6 +261,12 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
if deps_modifier == DepsModifier.UPDATE_ALL:
specs_map = {pkg_name: MatchSpec(spec.name, optional=spec.optional)
for pkg_name, spec in iteritems(specs_map)}
+ # The anaconda spec is a special case here, because of the 'custom' version.
+ # Because of https://github.com/conda/conda/issues/6350, and until we implement
+ # something like https://github.com/ContinuumIO/anaconda-issues/issues/4298, I think
+ # this is the best we're going to do.
+ if 'anaconda' in specs_map:
+ specs_map['anaconda'] = MatchSpec('anaconda>1')
# As a business rule, we never want to update python beyond the current minor version,
# unless that's requested explicitly by the user (which we actively discourage).
| update --all broken in 4.4.0rc
In 4.4.0rc an `update --all` wants to *remove* 90% of my packages. IMO an update should never remove any packages so the current behaviour seems pretty broken to me.
```
λ conda update --all
Solving environment: done
## Package Plan ##
environment location: C:\Miniconda3
The following packages will be downloaded:
package | build
---------------------------|-----------------
openssl-1.0.2m | vc14_0 5.4 MB conda-forge
The following packages will be REMOVED:
_license: 1.1-py36_1
altair: 1.2.1-py_0 conda-forge
anaconda-client: 1.6.5-py36hd36550c_0 https://repo.continuum.io/pkgs/main
anaconda-navigator: 1.6.9-py36hc720852_0 https://repo.continuum.io/pkgs/main
anaconda-project: 0.8.2-py36_0 conda-forge
astroid: 1.5.3-py36h9d85297_0 https://repo.continuum.io/pkgs/main
astropy: 2.0.2-py36h06391c4_4 https://repo.continuum.io/pkgs/main
<snip>
```
| Can you give me the output of `conda list` for your environment so I can reproduce?
The result of `conda env export` is available at:
https://gist.github.com/dhirschfeld/0d8f57906980e90468f9060932d7962a
NB: internal channels have been removed since they're not reproducible but they may potentially play a part in the update plan? The internal channels are just a semi-up-to-date mirror of the continuum repos. In my dev env our internal code is all symlinked from git checkouts rather than installed as conda packages.
To help debugging I've posted the `-vvv` output at:
https://gist.github.com/dhirschfeld/43bd8019f1450e3a04f88b68275f734a
Can you repro this behaviour? I note the fix is scheduled for 4.4.1. At least for me, this bug means I'll have to skip 4.4.0 as `update --all` is a fundamental workflow for me to keep all my packages up to date.
Probably worth a different issue, but `--force` doesn't seem to do what it used to pre-4.4
```
λ conda install conda=4.3* --force
Solving environment: done
## Package Plan ##
environment location: C:\Miniconda3
added / updated specs:
- conda=4.3
The following packages will be UPDATED:
gflags: 2.2.0-vc14_0 [vc14] --> 2.2.0-vc14_1 conda-forge [vc14]
hdf5: 1.10.1-h98b8871_1 --> 1.10.1-vc14_1 conda-forge [vc14]
libtiff: 4.0.9-h0f13578_0 --> 4.0.9-vc14_0 conda-forge [vc14]
The following packages will be DOWNGRADED:
boost: 1.65.1-py36_vc14h50d208f_3 [vc14] --> 1.65.1-py36_vc14_0 conda-forge [vc14]
boost-cpp: 1.65.1-vc14h7942e50_3 [vc14] --> 1.65.1-vc14_1 conda-forge [vc14]
conda: 4.4.0rc2-py36h5d836c4_0 conda-canary --> 4.3.30-py36h7e176b0_0
curl: 7.55.1-h3b839b5_4 --> 7.55.1-vc14_0 conda-forge [vc14]
hdf4: 4.2.13-h712560f_2 --> 4.2.13-vc14_0 conda-forge [vc14]
icu: 58.2-ha66f8fd_1 --> 58.2-vc14_0 conda-forge [vc14]
krb5: 1.14.2-h63dfc2a_6 --> 1.14.2-vc14_0 conda-forge [vc14]
libnetcdf: 4.5.0-hd92ae6e_5 --> 4.5.0-vc14_3 conda-forge [vc14]
libssh2: 1.8.0-h75d9407_3 --> 1.8.0-vc14_2 conda-forge [vc14]
snappy: 1.1.7-h777316e_3 --> 1.1.7-vc14_1 conda-forge [vc14]
yaml: 0.1.7-hc54c509_2 --> 0.1.7-vc14_0 conda-forge [vc14]
Proceed ([y]/n)? n
```
i.e. I *just* wanted to downgrade conda without touching any other packages - previously exactly what `--force` was useful for. Now, conda wants to muck with my environment despite the `--force` flag being present.
Is this a new bug in 4.4?
Also, the final downgrade threw an error:
```
The following packages will be DOWNGRADED:
conda: 4.4.0rc2-py36h5d836c4_0 conda-canary --> 4.3.30-py36h7e176b0_0
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
The batch file cannot be found.
C:\Miniconda3\Library\bin\conda.bat
At line:1 char:1
+ conda install conda=4.3* --force --override-channels -c defaults
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException
```
...but the downgrade did seem to work fine.
#6283 seems to be the same underlying issue with 4.4. | 2017-12-19T18:10:39 |
|
conda/conda | 6,494 | conda__conda-6494 | [
"6057"
] | 334bb2ee17d0410460705b34eae16ec97e5ea8e1 | diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -6,13 +6,14 @@
from .base.constants import DEFAULTS_CHANNEL_NAME, MAX_CHANNEL_PRIORITY
from .base.context import context
-from .common.compat import iteritems, iterkeys, itervalues, odict, string_types, text_type
+from .common.compat import iteritems, iterkeys, itervalues, odict, on_win, string_types, text_type
from .common.io import time_recorder
from .common.logic import Clauses, minimal_unsatisfiable_subset
from .common.toposort import toposort
from .exceptions import ResolvePackageNotFound, UnsatisfiableError
from .models.channel import Channel, MultiChannel
from .models.dist import Dist
+from .models.enums import NoarchType
from .models.index_record import PackageRef
from .models.match_spec import MatchSpec
from .models.version import VersionOrder
@@ -620,11 +621,29 @@ def dependency_sort(self, must_have):
# type: (Dict[package_name, Dist]) -> List[Dist]
assert isinstance(must_have, dict)
- digraph = {}
- for key, dist in iteritems(must_have):
+ digraph = {} # Dict[package_name, Set[dependent_package_names]]
+ for package_name, dist in iteritems(must_have):
if dist in self.index:
- depends = set(ms.name for ms in self.ms_depends(dist))
- digraph[key] = depends
+ digraph[package_name] = set(ms.name for ms in self.ms_depends(dist))
+
+ # There are currently at least three special cases to be aware of.
+ # 1. The `toposort()` function, called below, contains special case code to remove
+ # any circular dependency between python and pip.
+ # 2. conda/plan.py has special case code for menuinst
+ # Always link/unlink menuinst first/last on windows in case a subsequent
+ # package tries to import it to create/remove a shortcut
+ # 3. On windows, python noarch packages need an implicit dependency on conda added, if
+ # conda is in the list of packages for the environment. Python noarch packages
+ # that have entry points use conda's own conda.exe python entry point binary. If conda
+ # is going to be updated during an operation, the unlink / link order matters.
+ # See issue #6057.
+
+ if on_win and 'conda' in digraph:
+ for package_name, dist in iteritems(must_have):
+ record = self.index.get(dist)
+ if hasattr(record, 'noarch') and record.noarch == NoarchType.python:
+ digraph[package_name].add('conda')
+
sorted_keys = toposort(digraph)
must_have = must_have.copy()
# Take all of the items in the sorted keys
| CondaError: Cannot link a source that does not exist. C:\Users\...\Anaconda3\Scripts\conda.exe
I get this error when trying to conda install tqdm. Pip install works fine. However, when trying conda install spacy, I still get the same error because the conda installation for spacy attempts to conda install tqdm.
| Do you still get the error after running `conda clean --all --yes`?
If you need additional help, please include more details. At a minimum, `conda info`, the command that gave the error, and the full stack trace. Whatever details are necessary to independently reproduce the issue you're seeing.
Thanks @kalefranz. I had tried `Conda clean --all`. The error went away when I updated everything with `conda update anaconda `
Had the same error and @AVSuni thank you so much! Also thanks to @kalefranz (it occured when installing spacy)
We've run into this with nbconvert as well. I setup [a repo](https://github.com/minrk/debug-conda-appveyor) to do some testing:
On AppVeyor, installing nbconvert from conda-forge has started failing with:
```
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::nbconvert-5.3.1-py_1'.
CondaError: Cannot link a source that does not exist. C:\Miniconda-x64\Scripts\conda.exe
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\Miniconda-x64\Scripts\conda.exe
```
Possibly relevant bits of info:
- `conda clean --all` does not help
- Failure only occurs on [Windows + Python 2](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.9)
- It only occurs when conda is upgraded or downgraded during the same install. Disabling auto_update_conda [fixes the issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.10)
- Appears to be a regression between conda [4.3.8](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.21) and [4.3.9](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.22)
- nbconvert has `noarch: python` and an entry-point, as does tqdm
- installing last nbconvert release prior to noarch [has no issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.11)
- installing other, lighter packages with noarch + entrypoint (geojsonio) [doesn't reproduce the issue](https://ci.appveyor.com/project/minrk/debug-conda-appveyor/build/1.0.6) so there might be something else special about nbconvert+tqdm, or it could just be the ordering of packages causing the correct sequence of events to occur that `conda.exe` is removed while it's attempted to be linked.
I'm seeing this in damianavila/RISE#315 on win64 / py36 / conda 4.3.22
`conda clean --all` doesn't help - same error.
Reverting to `conda=4.2.16` *"fixed"* the problem for me.
Whereby *"fixed"* means the broken post-install script didn't run. That was easily fixed with a `jupyter nbextension enable ...` command so perhaps thre should be an `--ignore-errors` flag to allow users to proceed at their own risk rather than forcing them to downgrade conda to do so.
Hi all, I've run into this issue while trying to install the "tweepy" package. [win10 / conda 4.3.30 / Python 3.6.3]
Command: `conda install -c conda-forge tweepy`
**Error:**
oauthlib-2.0.6 100% |###############################| Time: 0:00:00 0.00 B/s
conda-4.3.29-p 100% |###############################| Time: 0:00:00 3.20 MB/s
requests-oauth 100% |###############################| Time: 0:00:00 0.00 B/s
tweepy-3.5.0-p 100% |###############################| Time: 0:00:00 3.37 MB/s
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::pyjwt-1.5.3-py_0'.
CondaError: Cannot link a source that does not exist. C:\Users\Maurice\Anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\Users\Maurice\Anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
**Error End**
I tried the above steps of `conda clean --all --yes` and `conda update anaconda` but I didn't have any success.
Any recommendations on what else I could try? Thanks.
It's clear to me that this is an issue with entry point creation for python noarch packages on windows. Looking into it.
> or it could just be the ordering of packages causing the correct sequence of events to occur that conda.exe is removed while it's attempted to be linked.
That's exactly what's happening.
```
DEBUG conda.core.link:create_from_dists(119): instantiating UnlinkLinkTransaction with
target_prefix: C:\Users\builder\Miniconda3
unlink_dists:
defaults::conda-4.3.24-py36_0
defaults::conda-env-2.6.0-0
defaults::openssl-1.0.2l-vc14_0
link_dists:
conda-forge::ca-certificates-2017.7.27.1-0
conda-forge::conda-env-2.6.0-0
conda-forge::openssl-1.0.2l-vc14_0
conda-forge::vc-14-0
conda-forge::pyjwt-1.5.3-py_0
conda-forge::conda-4.3.29-py36_0
```
Sometime around 4.3.8, we removed the embedded `cli-64.exe` / `cli-32.exe` files like what's in conda-build (https://github.com/conda/conda-build/tree/master/conda_build), realizing we already had the identical python entry point binary already available with conda.exe.
As you can see in the above operation plan, conda is unlinked, but then installed last, after pyjwt, which is what needs the entry point binary to hard link. | 2017-12-19T22:52:38 |
|
conda/conda | 6,510 | conda__conda-6510 | [
"6509"
] | c12f2e8432324199728deb2bb2418b6c858766c1 | 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
@@ -17,7 +17,7 @@
from .. import CondaError
from ..base.constants import CONDA_HOMEPAGE_URL
from ..base.context import context
-from ..common.compat import isiterable, iteritems, string_types, text_type
+from ..common.compat import isiterable, iteritems, itervalues, string_types, text_type
from ..common.constants import NULL
from ..config import (rc_bool_keys, rc_list_keys, rc_other, rc_string_keys, sys_rc_path,
user_rc_path)
@@ -264,8 +264,10 @@ def execute_config(args, parser):
cls=EntityEncoder))
else:
# coerce channels
- d['custom_channels'] = {k: text_type(v).replace(k, '') # TODO: the replace here isn't quite right # NOQA
- for k, v in iteritems(d['custom_channels'])}
+ d['custom_channels'] = {
+ channel.name: "%s://%s" % (channel.scheme, channel.location)
+ for channel in itervalues(d['custom_channels'])
+ }
# TODO: custom_multichannels needs better formatting
d['custom_multichannels'] = {k: json.dumps([text_type(c) for c in chnls])
for k, chnls in iteritems(d['custom_multichannels'])}
| custom_channels incorrect in 'conda config --show'
Especially for anaconda channel, weird replacement happening.
| 2017-12-21T20:22:49 |
||
conda/conda | 6,511 | conda__conda-6511 | [
"6508"
] | eba59e3d6ba486b6e9a39864b1daacbc7f99f719 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -982,7 +982,7 @@ def _first_writable_envs_dir():
return envs_dir
from ..exceptions import NotWritableError
- raise NotWritableError(context.envs_dirs[0])
+ raise NotWritableError(context.envs_dirs[0], None)
# backward compatibility for conda-build
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -591,12 +591,13 @@ def __init__(self, message):
super(SafetyError, self).__init__(message)
-class NotWritableError(CondaError):
+class NotWritableError(CondaError, OSError):
- def __init__(self, path):
- kwargs = {
+ def __init__(self, path, errno, **kwargs):
+ kwargs.update({
'path': path,
- }
+ 'errno': errno,
+ })
if on_win:
message = dals("""
The current user does not have write permissions to a required path.
diff --git a/conda/gateways/disk/update.py b/conda/gateways/disk/update.py
--- a/conda/gateways/disk/update.py
+++ b/conda/gateways/disk/update.py
@@ -12,6 +12,7 @@
from .link import lexists
from ...common.compat import on_win
from ...common.path import expand
+from ...exceptions import NotWritableError
log = getLogger(__name__)
@@ -62,29 +63,32 @@ def touch(path, mkdir=False, sudo_safe=False):
# True if the file did not exist but was created
# False if the file already existed
# raises: permissions errors such as EPERM and EACCES
- path = expand(path)
- log.trace("touching path %s", path)
- if lexists(path):
- utime(path, None)
- return True
- else:
- dirpath = dirname(path)
- if not isdir(dirpath) and mkdir:
- if sudo_safe:
- mkdir_p_sudo_safe(dirpath)
- else:
- mkdir_p(dirpath)
- else:
- assert isdir(dirname(path))
- try:
- fh = open(path, 'a')
- except:
- raise
+ try:
+ path = expand(path)
+ log.trace("touching path %s", path)
+ if lexists(path):
+ utime(path, None)
+ return True
else:
- fh.close()
- if sudo_safe and not on_win and os.environ.get('SUDO_UID') is not None:
- uid = int(os.environ['SUDO_UID'])
- gid = int(os.environ.get('SUDO_GID', -1))
- log.trace("chowning %s:%s %s", uid, gid, path)
- os.chown(path, uid, gid)
- return False
+ dirpath = dirname(path)
+ if not isdir(dirpath) and mkdir:
+ if sudo_safe:
+ mkdir_p_sudo_safe(dirpath)
+ else:
+ mkdir_p(dirpath)
+ else:
+ assert isdir(dirname(path))
+ try:
+ fh = open(path, 'a')
+ except:
+ raise
+ else:
+ fh.close()
+ if sudo_safe and not on_win and os.environ.get('SUDO_UID') is not None:
+ uid = int(os.environ['SUDO_UID'])
+ gid = int(os.environ.get('SUDO_GID', -1))
+ log.trace("chowning %s:%s %s", uid, gid, path)
+ os.chown(path, uid, gid)
+ return False
+ except (IOError, OSError) as e:
+ raise NotWritableError(path, e.errno, caused_by=e)
| PermissionError writing to environments.txt
"command": "conda install jupyter_core --yes"
```
Traceback (most recent call last):
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/exceptions.py\", line 721, in __call__
return func(*args, **kwargs)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/cli/main_install.py\", line 11, in execute
install(args, parser, 'install')
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/cli/install.py\", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/cli/install.py\", line 269, in handle_txn
unlink_link_transaction.execute()
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/link.py\", line 220, in execute
self.verify()
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/common/io.py\", line 402, in decorated
return f(*args, **kwds)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/link.py\", line 207, in verify
exceptions = self._verify(self.prefix_setups, self.prefix_action_groups)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/link.py\", line 460, in _verify
cls._verify_transaction_level(prefix_setups),
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/link.py\", line 455, in <genexpr>
exceptions = tuple(exc for exc in concatv(
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/link.py\", line 323, in _verify_individual_level
error_result = axn.verify()
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/core/path_actions.py\", line 870, in verify
touch(USER_ENVIRONMENTS_TXT_FILE, mkdir=True, sudo_safe=True)
File \"/home/nbcommon/anaconda3_420/lib/python3.5/site-packages/conda/gateways/disk/update.py\", line 89, in touch
os.chown(path, uid, gid)
PermissionError: [Errno 1] Operation not permitted: '/home/nbcommon/.conda/environments.txt'
```
| 2017-12-21T20:40:03 |
||
conda/conda | 6,517 | conda__conda-6517 | [
"6516"
] | 09912b87b21b0a66d638e65561ed126677846a91 | diff --git a/conda/core/index.py b/conda/core/index.py
--- a/conda/core/index.py
+++ b/conda/core/index.py
@@ -44,6 +44,8 @@ def check_whitelist(channel_urls):
% (bad_channel.location, bad_channel.canonical_name))
+LAST_CHANNEL_URLS = []
+
@time_recorder("get_index")
def get_index(channel_urls=(), prepend=True, platform=None,
use_local=False, use_cache=False, unknown=None, prefix=None):
@@ -58,6 +60,8 @@ def get_index(channel_urls=(), prepend=True, platform=None,
unknown = True
channel_urls = calculate_channel_urls(channel_urls, prepend, platform, use_local)
+ del LAST_CHANNEL_URLS[:]
+ LAST_CHANNEL_URLS.extend(channel_urls)
check_whitelist(channel_urls)
diff --git a/conda/plan.py b/conda/plan.py
--- a/conda/plan.py
+++ b/conda/plan.py
@@ -18,7 +18,7 @@
from .base.context import context
from .common.compat import itervalues, text_type
from .common.io import time_recorder
-from .core.index import _supplement_index_with_prefix
+from .core.index import _supplement_index_with_prefix, LAST_CHANNEL_URLS
from .core.link import PrefixSetup, UnlinkLinkTransaction
from .core.linked_data import is_linked, linked_data
from .core.solve import get_pinned_specs
@@ -26,7 +26,7 @@
from .history import History
from .instructions import (CHECK_EXTRACT, CHECK_FETCH, EXTRACT, FETCH, LINK, PREFIX,
RM_EXTRACTED, RM_FETCHED, SYMLINK_CONDA, UNLINK)
-from .models.channel import Channel
+from .models.channel import Channel, prioritize_channels
from .models.dist import Dist
from .models.enums import LinkType
from .models.version import normalized_version
@@ -527,7 +527,13 @@ def install_actions(prefix, index, specs, force=False, only_names=None, always_c
channels = IndexedSet(Channel(cn) for cn in channel_names)
subdirs = IndexedSet(basename(url) for url in channel_priority_map)
else:
- channels = subdirs = None
+ if LAST_CHANNEL_URLS:
+ channel_priority_map = prioritize_channels(LAST_CHANNEL_URLS)
+ channel_names = IndexedSet(Channel(url).canonical_name for url in channel_priority_map)
+ channels = IndexedSet(Channel(cn) for cn in channel_names)
+ subdirs = IndexedSet(basename(url) for url in channel_priority_map)
+ else:
+ channels = subdirs = None
specs = tuple(MatchSpec(spec) for spec in specs)
diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -390,7 +390,7 @@ def ms_depends(self, dist):
def version_key(self, dist, vtype=None):
rec = self.index[dist]
channel = rec.channel
- channel_priority = self._channel_priorities_map.get(channel.canonical_name, 1)
+ channel_priority = self._channel_priorities_map.get(channel.name, 1) # TODO: ask @mcg1969 why the default value is 1 here # NOQA
valid = 1 if channel_priority < MAX_CHANNEL_PRIORITY else 0
version_comparator = VersionOrder(rec.get('version', ''))
build_number = rec.get('build_number', 0)
@@ -408,7 +408,7 @@ def _make_channel_priorities(channels):
(Channel(cc) for cc in c._channels) if isinstance(c, MultiChannel) else (c,)
for c in (Channel(c) for c in channels)
)):
- channel_name = chn.canonical_name
+ channel_name = chn.name
if channel_name in priorities_map:
continue
priorities_map[channel_name] = min(priority_counter, MAX_CHANNEL_PRIORITY - 1)
| 4.4+conda-build not prioritizing local channel correctly
I have a package, bzip2, build number 4, locally. I'm expecting it to be used as a dependency. Conda 4.3.31 finds it ok:
```
conda build libnetcdf-feedstock/
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from /home/dev/code/aggregate/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /home/dev/code/aggregate/conda_build_config.yaml
Attempting to finalize metadata for libnetcdf
INFO:conda_build.metadata:Attempting to finalize metadata for libnetcdf
BUILD START: ['libnetcdf-4.5.0-h569e9f1_6.tar.bz2']
The following NEW packages will be INSTALLED:
bzip2: 1.0.6-h9a117a8_4 local
ca-certificates: 2017.08.26-h1d4fec5_0 defaults
curl: 7.55.1-h78862de_4 defaults
hdf4: 4.2.13-h3ca952b_2 defaults
hdf5: 1.8.18-h6792536_1 defaults
jpeg: 9b-h024ee3a_2 defaults
libgcc-ng: 7.2.0-h7cc24e2_2 defaults
libgfortran-ng: 7.2.0-h9f7466a_2 defaults
libssh2: 1.8.0-h2d05a93_3 defaults
libstdcxx-ng: 7.2.0-h7a57d05_2 defaults
openssl: 1.0.2n-hb7f436b_0 defaults
zlib: 1.2.11-ha838bed_2 defaults
```
Conda 4.4.0 does not:
```
[root@69189185e23f aggregate]# conda build libnetcdf-feedstock/
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from /home/dev/code/aggregate/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /home/dev/code/aggregate/conda_build_config.yaml
Attempting to finalize metadata for libnetcdf
INFO:conda_build.metadata:Attempting to finalize metadata for libnetcdf
Solving environment: done
Solving environment: done
Solving environment: done
BUILD START: ['libnetcdf-4.5.0-h569e9f1_6.tar.bz2']
Solving environment: done
## Package Plan ##
environment location: /opt/conda/conda-bld/libnetcdf_1513891848918/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
The following NEW packages will be INSTALLED:
bzip2: 1.0.6-3 defaults
ca-certificates: 2017.08.26-h1d4fec5_0 defaults
curl: 7.55.1-h78862de_4 defaults
hdf4: 4.2.13-h3ca952b_2 defaults
hdf5: 1.8.18-h6792536_1 defaults
jpeg: 9b-h024ee3a_2 defaults
libgcc-ng: 7.2.0-h7cc24e2_2 defaults
libgfortran-ng: 7.2.0-h9f7466a_2 defaults
libssh2: 1.8.0-h2d05a93_3 defaults
libstdcxx-ng: 7.2.0-h7a57d05_2 defaults
openssl: 1.0.2n-hb7f436b_0 defaults
zlib: 1.2.11-ha838bed_2 defaults
```
This is conda-build 3.2.0, if that helps.
| I've identified the issue. Might take some discussion to figure out how to fix it. Here's the issue...
The `install_actions()` function in conda takes a `channel_priority_map` parameter:
https://github.com/conda/conda/blob/4.4.1/conda/plan.py#L515
I guess in conda 4.4 that took on more/different importance.
That parameter currently isn't being passed by conda-build:
https://github.com/conda/conda-build/blob/3.2.0/conda_build/environ.py#L691
So conda is falling back to whatever is configured for `context.channels`.
I think we're going to have to talk through this to figure out how to address it.
Does this mean there is an unintentional change to the exported behavior conda build uses? I think we should prioritize restoring that behavior.
But 4.3.x has the `channel_priority_map` input as well, so I don't understand why it would behave differently in 4.4.
In 4.3, we set channel priority on each individual record every time we build the index. In 4.4, we hand channel priority over to Resolve, and let Resolve handle all the dynamic parts of priority.
Stuffing that level of mutability inside of an index record was always problematic. We have the same issue of `add_pip_as_python_dependency`.
Conda-build probably wasn't using that parameter on `install_actions()` because it wasn't important before now, for the flows that conda-build uses (i.e. calling conda's get_index, and then handing that index back to the solver).
I can probably hack something together in conda to make this work again, but I'm pretty sure there will be a performance hit for all the translation.
Maybe it's worthwhile for us to do a code review of the much cleaner APIs that conda 4.4 has for the Solver, and the three individual information sources (i.e. package cache, prefix, and repodata). The Solver API is already locked down in `conda/api.py`, and we can easily do the same thing for the three lower-level APIs too. Then start thinking about how conda-build can make use of them.
OK, so I get that this is an unintentional change, but I think we have to go with the perfomance hit here and revert. Perhaps there's a way to mitigate the performance hit.
An alternative is if we can come up with an easy way on the conda-build side to do the right thing, but it would have to work with conda 4.3 and 4.4...
Can I pass a reasonable channel map somehow? | 2017-12-22T00:11:28 |
|
conda/conda | 6,524 | conda__conda-6524 | [
"6523"
] | 09912b87b21b0a66d638e65561ed126677846a91 | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -144,7 +144,11 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
prefix_data = PrefixData(self.prefix)
solution = tuple(Dist(d) for d in prefix_data.iter_records())
specs_from_history_map = History(self.prefix).get_requested_specs_map()
- if prune or deps_modifier == DepsModifier.UPDATE_ALL:
+ if prune: # or deps_modifier == DepsModifier.UPDATE_ALL # pending conda/constructor#138
+ # Users are struggling with the prune functionality in --update-all, due to
+ # https://github.com/conda/constructor/issues/138. Until that issue is resolved,
+ # and for the foreseeable future, it's best to be more conservative with --update-all.
+
# Start with empty specs map for UPDATE_ALL because we're optimizing the update
# only for specs the user has requested; it's ok to remove dependencies.
specs_map = odict()
| diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py
--- a/tests/core/test_solve.py
+++ b/tests/core/test_solve.py
@@ -1058,28 +1058,29 @@ def test_pinned_1():
)
assert tuple(final_state_5) == tuple(solver._index[Dist(d)] for d in order)
- # now update without pinning
- specs_to_add = MatchSpec("python"),
- history_specs = MatchSpec("python"), MatchSpec("system=5.8=0"), MatchSpec("numba"),
- with get_solver(specs_to_add=specs_to_add, prefix_records=final_state_4,
- history_specs=history_specs) as solver:
- final_state_5 = solver.solve_final_state(deps_modifier=DepsModifier.UPDATE_ALL)
- # PrefixDag(final_state_1, specs).open_url()
- print([Dist(rec).full_name for rec in final_state_5])
- order = (
- 'channel-1::openssl-1.0.1c-0',
- 'channel-1::readline-6.2-0',
- 'channel-1::sqlite-3.7.13-0',
- 'channel-1::system-5.8-1',
- 'channel-1::tk-8.5.13-0',
- 'channel-1::zlib-1.2.7-0',
- 'channel-1::llvm-3.2-0',
- 'channel-1::python-3.3.2-0',
- 'channel-1::llvmpy-0.11.2-py33_0',
- 'channel-1::numpy-1.7.1-py33_0',
- 'channel-1::numba-0.8.1-np17py33_0',
- )
- assert tuple(final_state_5) == tuple(solver._index[Dist(d)] for d in order)
+ # # TODO: re-enable when UPDATE_ALL gets prune behavior again, following completion of https://github.com/conda/constructor/issues/138
+ # # now update without pinning
+ # specs_to_add = MatchSpec("python"),
+ # history_specs = MatchSpec("python"), MatchSpec("system=5.8=0"), MatchSpec("numba"),
+ # with get_solver(specs_to_add=specs_to_add, prefix_records=final_state_4,
+ # history_specs=history_specs) as solver:
+ # final_state_5 = solver.solve_final_state(deps_modifier=DepsModifier.UPDATE_ALL)
+ # # PrefixDag(final_state_1, specs).open_url()
+ # print([Dist(rec).full_name for rec in final_state_5])
+ # order = (
+ # 'channel-1::openssl-1.0.1c-0',
+ # 'channel-1::readline-6.2-0',
+ # 'channel-1::sqlite-3.7.13-0',
+ # 'channel-1::system-5.8-1',
+ # 'channel-1::tk-8.5.13-0',
+ # 'channel-1::zlib-1.2.7-0',
+ # 'channel-1::llvm-3.2-0',
+ # 'channel-1::python-3.3.2-0',
+ # 'channel-1::llvmpy-0.11.2-py33_0',
+ # 'channel-1::numpy-1.7.1-py33_0',
+ # 'channel-1::numba-0.8.1-np17py33_0',
+ # )
+ # assert tuple(final_state_5) == tuple(solver._index[Dist(d)] for d in order)
def test_no_update_deps_1(): # i.e. FREEZE_DEPS
| 'conda update --all' causes "'python' is not recognized as an internal or external command"
repro steps:
1. fresh install of latest version of miniconda
2. `conda update --all` and yes to all questions
3. restart 'Anaconda Prompt'
and you will see
```
'python' is not recognized as an internal or external command,
operable program or batch file.
```
| And i ran 'conda update --all' again and yes to all questions, shortcut 'Anaconda Prompt' is then removed. I'm totally confused. | 2017-12-22T03:34:49 |
conda/conda | 6,525 | conda__conda-6525 | [
"6522"
] | 09912b87b21b0a66d638e65561ed126677846a91 | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -241,7 +241,7 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
the output of 'conda info' and 'conda list' for the active environment, along
with the command you invoked that resulted in this error.
matches_for_spec: %s
- """) % matches_for_spec)
+ """) % dashlist((text_type(s) for s in matches_for_spec), indent=4))
target_dist = matches_for_spec[0]
if deps_modifier == DepsModifier.FREEZE_INSTALLED:
new_spec = MatchSpec(index[target_dist])
| TypeError: not all arguments converted during string formatting
"command": "C:\\Users\\court\\Anaconda3\\Scripts\\conda install matplotlib"
"user_agent": "conda/4.4.1 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.16299"
```
Traceback (most recent call last):
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\exceptions.py\", line 721, in __call__
return func(*args, **kwargs)
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\cli\\main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\cli\\conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\cli\\main_install.py\", line 11, in execute
install(args, parser, 'install')
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\cli\\install.py\", line 220, in install
force_reinstall=context.force,
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\core\\solve.py\", line 503, in solve_for_transaction
force_remove, force_reinstall)
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\core\\solve.py\", line 436, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File \"C:\\Users\\court\\Anaconda3\\lib\\site-packages\\conda\\core\\solve.py\", line 244, in solve_final_state
\"\"\") % matches_for_spec)
TypeError: not all arguments converted during string formatting
```
| 2017-12-22T03:34:59 |
||
conda/conda | 6,526 | conda__conda-6526 | [
"6520"
] | 09912b87b21b0a66d638e65561ed126677846a91 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -160,6 +160,7 @@ class Context(Configuration):
migrated_custom_channels = MapParameter(string_types) # TODO: also take a list of strings
override_channels_enabled = PrimitiveParameter(True)
show_channel_urls = PrimitiveParameter(None, element_type=(bool, NoneType))
+ use_local = PrimitiveParameter(False)
whitelist_channels = SequenceParameter(string_types)
always_softlink = PrimitiveParameter(False, aliases=('softlink',))
@@ -532,6 +533,7 @@ def custom_channels(self):
@property
def channels(self):
+ local_add = ('local',) if self.use_local else ()
if (self._argparse_args and 'override_channels' in self._argparse_args
and self._argparse_args['override_channels']):
if not self.override_channels_enabled:
@@ -546,15 +548,16 @@ def channels(self):
At least one -c / --channel flag must be supplied when using --override-channels.
"""))
else:
- return self._argparse_args['channel']
+ return tuple(IndexedSet(concatv(local_add, self._argparse_args['channel'])))
# add 'defaults' channel when necessary if --channel is given via the command line
if self._argparse_args and 'channel' in self._argparse_args:
# TODO: it's args.channel right now, not channels
argparse_channels = tuple(self._argparse_args['channel'] or ())
if argparse_channels and argparse_channels == self._channels:
- return argparse_channels + (DEFAULTS_CHANNEL_NAME,)
- return self._channels or ()
+ return tuple(IndexedSet(concatv(local_add, argparse_channels,
+ (DEFAULTS_CHANNEL_NAME,))))
+ return tuple(IndexedSet(concatv(local_add, self._channels)))
def get_descriptions(self):
return get_help_dict()
@@ -582,6 +585,7 @@ def list_parameters(self):
# I don't think this documentation is correct any longer. # NOQA
'target_prefix_override', # used to override prefix rewriting, for e.g. building docker containers or RPMs # NOQA
'update_dependencies',
+ 'use_local',
)
return tuple(p for p in super(Context, self).list_parameters()
if p not in UNLISTED_PARAMETERS)
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -1083,7 +1083,7 @@ def add_parser_use_local(p):
p.add_argument(
"--use-local",
action="store_true",
- default=False,
+ default=NULL,
help="Use locally built packages.",
)
| --use-local flag not working in 4.4.0
For some time I've been doing this:
```
conda build --old-build-string --python 2.7
conda install taxcalc=0.0.0 --use-local --yes
```
But that `conda install` command now fails under conda 4.4.0 and 4.4.1.
I have been able to work around this problem by doing this:
```
conda build --old-build-string --python 2.7
conda install --offline ~/anaconda/conda-bld/osx-64/taxcalc-0.0.0-py27_0.tar.bz2
```
Why does my old code fail under conda 4.4.0 and conda 4.4.1?
The failure is that it says it cannot find the package, but it is where it has always been built:
`~/anaconda/conda-bld/osx-64/taxcalc-0.0.0-py27_0.tar.bz2`
| Does this work?
conda install -c local taxcalc=0.0.0
@kalefranz asked:
> Does this work?
>
> `conda install -c local taxcalc=0.0.0`
Thanks for the suggestion. I'm going to try it now.
It's still a bug either way. If that works for you though, it'll at least help narrow down the problem.
After doing `conda build`, I tried the `conda install` command suggested by @kalefranz and that worked although the "solving environment" step took quite a while. Also, to put this command in a bash script it seems as if you need to quiet the progress "spinner". Here is what happened in my test:
```
iMac:conda.recipe$ date ; conda install -c local taxcalc=0.0.0 --quiet --yes ; date
Thu Dec 21 22:44:21 EST 2017
Solving environment: ...working... done
## Package Plan ##
environment location: /Users/mrh/anaconda
added / updated specs:
- taxcalc=0.0.0
The following NEW packages will be INSTALLED:
taxcalc: 0.0.0-py27_0 local
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Thu Dec 21 22:44:57 EST 2017
iMac:conda.recipe$ conda list taxcalc
# packages in environment at /Users/mrh/anaconda:
#
taxcalc 0.0.0 py27_0 local
iMac2:conda.recipe mrh$
```
Thanks for the quick advice @kalefranz.
There's still probably some tuning to be done on the solver behavior, making sure it's not slower than 4.3.
What was the behavior you saw that forced use of the `--quiet` flag in your script? Just curious if there's something that can be done there...
@kalefranz asked:
> What was the behavior you saw that forced use of the --quiet flag in your script? Just curious if there's something that can be done there...
Oh, now that I think about it maybe I just forgot the `--yes` option.
I'll test again without the `--quiet` option.
| 2017-12-22T04:03:06 |
|
conda/conda | 6,533 | conda__conda-6533 | [
"6530"
] | 6c5d2bab095f9a2a4f846515800dbcf38f2fac39 | diff --git a/conda/common/compat.py b/conda/common/compat.py
--- a/conda/common/compat.py
+++ b/conda/common/compat.py
@@ -47,9 +47,11 @@
if PY3: # pragma: py2 no cover
from io import StringIO
from itertools import zip_longest
+ from json import JSONDecodeError
elif PY2: # pragma: py3 no cover
from cStringIO import StringIO
from itertools import izip as zip, izip_longest as zip_longest
+ JSONDecodeError = ValueError
StringIO = StringIO
zip = zip
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
@@ -12,7 +12,8 @@
from .._vendor.auxlib.collection import first
from ..base.constants import CONDA_TARBALL_EXTENSION, PACKAGE_CACHE_MAGIC_FILE
from ..base.context import context
-from ..common.compat import iteritems, itervalues, odict, text_type, with_metaclass
+from ..common.compat import (JSONDecodeError, iteritems, itervalues, odict, text_type,
+ with_metaclass)
from ..common.constants import NULL
from ..common.io import ProgressBar, time_recorder
from ..common.path import expand, url_to_path
@@ -34,7 +35,6 @@
except ImportError: # pragma: no cover
from .._vendor.toolz.itertoolz import concat, concatv, groupby # NOQA
-
log = getLogger(__name__)
@@ -272,13 +272,25 @@ def _make_single_record(self, package_filename):
extracted_package_dir=extracted_package_dir,
)
return package_cache_record
- except (IOError, OSError):
- # no info/repodata_record.json exists
+ except (IOError, OSError, JSONDecodeError) as e:
+ # IOError / OSError if info/repodata_record.json doesn't exists
+ # JsonDecodeError if info/repodata_record.json is partially extracted or corrupted
+ # python 2.7 raises ValueError instead of JsonDecodeError
+ # ValueError("No JSON object could be decoded")
+ log.debug("unable to read %s\n because %r",
+ join(extracted_package_dir, 'info', 'repodata_record.json'), e)
+
# try reading info/index.json
try:
index_json_record = read_index_json(extracted_package_dir)
- except (IOError, OSError):
- # info/index.json doesn't exist either
+ except (IOError, OSError, JSONDecodeError) as e:
+ # IOError / OSError if info/index.json doesn't exist
+ # JsonDecodeError if info/index.json is partially extracted or corrupted
+ # python 2.7 raises ValueError instead of JsonDecodeError
+ # ValueError("No JSON object could be decoded")
+ log.debug("unable to read %s\n because",
+ join(extracted_package_dir, 'info', 'index.json'), e)
+
if isdir(extracted_package_dir) and not isfile(package_tarball_full_path):
# We have a directory that looks like a conda package, but without
# (1) info/repodata_record.json or info/index.json, and (2) a conda package
@@ -295,12 +307,17 @@ def _make_single_record(self, package_filename):
index_json_record = read_index_json(extracted_package_dir)
else:
index_json_record = read_index_json_from_tarball(package_tarball_full_path)
- except (EOFError, ReadError):
+ except (EOFError, ReadError) as e:
# EOFError: Compressed file ended before the end-of-stream marker was reached
# tarfile.ReadError: file could not be opened successfully
+ # We have a corrupted tarball. Remove the tarball so it doesn't affect
+ # anything, and move on.
+ log.debug("unable to extract info/index.json from %s\n because %r",
+ package_tarball_full_path, e)
rm_rf(package_tarball_full_path)
return None
+ # we were able to read info/index.json, so let's continue
if isfile(package_tarball_full_path):
md5 = compute_md5sum(package_tarball_full_path)
else:
| Error when updating/installing packages: ValueError: No JSON object could be decoded
I am hitting this JSON-related `ValueError` basically when trying to update or install any package. For a MWE, I can run the following commands:
$conda create -n testenv
$source activate testenv
$conda install python
The full error message I get is the following:
----
Solving environment: done
`$ /home/pablo/anaconda/bin/conda install python`
Traceback (most recent call last):
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/exceptions.py", line 722, in __call__
return func(*args, **kwargs)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 256, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/link.py", line 706, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/common/io.py", line 402, in decorated
return f(*args, **kwds)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 508, in prepare
for prec in self.link_precs)
File "/home/pablo/anaconda/lib/python2.7/_abcoll.py", line 571, in update
for key, value in other:
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 508, in <genexpr>
for prec in self.link_precs)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 402, in make_actions_for_record
), None)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 399, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 400, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 209, in _package_cache_records
self.load()
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 88, in load
package_cache_record = self._make_single_record(base_name)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/core/package_cache.py", line 279, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File "/home/pablo/anaconda/lib/python2.7/site-packages/conda/gateways/disk/read.py", line 112, in read_index_json
record = IndexJsonRecord(**json.load(fi))
File "/home/pablo/anaconda/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/home/pablo/anaconda/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/home/pablo/anaconda/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/pablo/anaconda/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=testenv
CONDA_PREFIX=/home/pablo/anaconda/envs/testenv
CONDA_PROMPT_MODIFIER=(testenv)
CONDA_PYTHON_EXE=/home/pablo/anaconda/bin/python
CONDA_ROOT=/home/pablo/anaconda
CONDA_SHLVL=1
DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
PATH=/home/pablo/anaconda/envs/testenv/bin:/home/pablo/anaconda/bin:/home/p
ablo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
/usr/games:/usr/local/games:/home/pablo/software_install/mangle/mangle
2.2/bin:/home/pablo/software_install/mangle/mangle2.2/scripts
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
WINDOWPATH=8
active environment : testenv
active env location : /home/pablo/anaconda/envs/testenv
shell level : 1
user config file : /home/pablo/.condarc
populated config files :
conda version : 4.4.2
conda-build version : 2.1.3
python version : 2.7.13.final.0
base environment : /home/pablo/anaconda (writable)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/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
package cache : /home/pablo/anaconda/pkgs
/home/pablo/.conda/pkgs
envs directories : /home/pablo/anaconda/envs
/home/pablo/.conda/envs
platform : linux-64
user-agent : conda/4.4.2 requests/2.14.2 CPython/2.7.13 Linux/3.16.0-38-generic ubuntu/14.04 glibc/2.19
UID:GID : 1000:1000
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]: n
No report sent. To permanently opt-out, use
$ conda config --set report_errors false
----
As I mentioned, I get the same error when trying to install other packages, or updating any existing ones (e.g. `$conda update anaconda` in my root environment).
I have tried cleaning everything with `$conda clean --all` (which actually listed lots of tarballs and packages that were cleaned), but I'm still getting the same error.
I have also run the code suggested by @kalefranz in #4419 and #4425 to identify problematic json files in the `conda-meta` folder, but got no output.
Thanks for your help on this!
| 2017-12-22T15:00:47 |
||
conda/conda | 6,535 | conda__conda-6535 | [
"6536"
] | 6c5d2bab095f9a2a4f846515800dbcf38f2fac39 | 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
@@ -37,7 +37,8 @@ def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs):
requirements.write('\n'.join(specs))
requirements.close()
# pip command line...
- pip_cmd = pip_args(prefix) + ['install', '-r', requirements.name]
+ args, pip_version = pip_args(prefix)
+ pip_cmd = args + ['install', '-r', requirements.name]
# ...run it
process = subprocess.Popen(pip_cmd,
cwd=pip_workdir,
diff --git a/conda_env/pip_util.py b/conda_env/pip_util.py
--- a/conda_env/pip_util.py
+++ b/conda_env/pip_util.py
@@ -34,9 +34,9 @@ def pip_args(prefix):
major_ver = pip_version.split('.')[0]
if int(major_ver) >= 6:
ret.append('--disable-pip-version-check')
- return ret
+ return ret, pip_version
else:
- return None
+ return None, None
class PipPackage(dict):
@@ -51,47 +51,87 @@ def __str__(self):
def installed(prefix, output=True):
- args = pip_args(prefix)
+ args, pip_version = pip_args(prefix)
if args is None:
return
+ pip_major_version = int(pip_version.split('.', 1)[0])
+
env = os.environ.copy()
env[str('PIP_FORMAT')] = str('legacy')
+ args.append('list')
- args += ['list', '--format', 'json']
+ if pip_major_version >= 9:
+ args += ['--format', 'json']
try:
- s = subprocess.check_output(args, universal_newlines=True, env=env)
+ pip_stdout = subprocess.check_output(args, universal_newlines=True, env=env)
except Exception:
# Any error should just be ignored
if output:
print("# Warning: subprocess call to pip failed")
return
- pkgs = json.loads(s)
-
- # For every package in pipinst that is not already represented
- # in installed append a fake name to installed with 'pip'
- # as the build string
- for kwargs in pkgs:
- kwargs['name'] = kwargs['name'].lower()
- if ', ' in kwargs['version']:
- # Packages installed with setup.py develop will include a path in
- # the version. They should be included here, even if they are
- # installed with conda, as they are preferred over the conda
- # version. We still include the conda version, though, because it
- # is still installed.
-
- version, path = kwargs['version'].split(', ')
- # We do this because the code below uses rsplit('-', 2)
- version = version.replace('-', ' ')
- kwargs['version'] = version
- kwargs['path'] = path
- yield PipPackage(**kwargs)
-# canonicalize_{regex,name} inherited from packaging/utils.py
-# Used under BSD license
+ if pip_major_version >= 9:
+ pkgs = json.loads(pip_stdout)
+
+ # For every package in pipinst that is not already represented
+ # in installed append a fake name to installed with 'pip'
+ # as the build string
+ for kwargs in pkgs:
+ kwargs['name'] = kwargs['name'].lower()
+ if ', ' in kwargs['version']:
+ # Packages installed with setup.py develop will include a path in
+ # the version. They should be included here, even if they are
+ # installed with conda, as they are preferred over the conda
+ # version. We still include the conda version, though, because it
+ # is still installed.
+
+ version, path = kwargs['version'].split(', ')
+ # We do this because the code below uses rsplit('-', 2)
+ version = version.replace('-', ' ')
+ kwargs['version'] = version
+ kwargs['path'] = path
+ yield PipPackage(**kwargs)
+ else:
+ # For every package in pipinst that is not already represented
+ # in installed append a fake name to installed with 'pip'
+ # as the build string
+ pat = re.compile('([\w.-]+)\s+\((.+)\)')
+ for line in pip_stdout.splitlines():
+ line = line.strip()
+ if not line:
+ continue
+ m = pat.match(line)
+ if m is None:
+ if output:
+ print('Could not extract name and version from: %r' % line)
+ continue
+ name, version = m.groups()
+ name = name.lower()
+ kwargs = {
+ 'name': name,
+ 'version': version,
+ }
+ if ', ' in version:
+ # Packages installed with setup.py develop will include a path in
+ # the version. They should be included here, even if they are
+ # installed with conda, as they are preferred over the conda
+ # version. We still include the conda version, though, because it
+ # is still installed.
+
+ version, path = version.split(', ')
+ # We do this because the code below uses rsplit('-', 2)
+ version = version.replace('-', ' ')
+ kwargs.update({
+ 'path': path,
+ 'version': version,
+ })
+ yield PipPackage(**kwargs)
+# canonicalize_{regex,name} inherited from packaging/utils.py
+# Used under BSD license
_canonicalize_regex = re.compile(r"[-_.]+")
| 'conda env export' doesn't include pip-installed packages
New in conda 4.4. Seems to be a problem only if pip is older than version 9.
| 2017-12-22T16:11:10 |
||
conda/conda | 6,540 | conda__conda-6540 | [
"6538"
] | 6c5d2bab095f9a2a4f846515800dbcf38f2fac39 | diff --git a/conda/common/io.py b/conda/common/io.py
--- a/conda/common/io.py
+++ b/conda/common/io.py
@@ -5,6 +5,7 @@
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from enum import Enum
+from errno import EPIPE, ESHUTDOWN
from functools import wraps
from itertools import cycle
import json
@@ -326,11 +327,17 @@ def spinner(message=None, enabled=True, json=False):
if json:
pass
else:
- if exception_raised:
- sys.stdout.write("failed\n")
- else:
- sys.stdout.write("done\n")
- sys.stdout.flush()
+ try:
+ if exception_raised:
+ sys.stdout.write("failed\n")
+ else:
+ sys.stdout.write("done\n")
+ sys.stdout.flush()
+ except (IOError, OSError) as e:
+ # Ignore BrokenPipeError and errors related to stdout or stderr being
+ # closed by a downstream program.
+ if e.errno not in (EPIPE, ESHUTDOWN):
+ raise
class ProgressBar(object):
@@ -368,12 +375,18 @@ def finish(self):
self.update_to(1)
def close(self):
- if self.json:
- sys.stdout.write('{"fetch":"%s","finished":true,"maxval":1,"progress":1}\n\0'
- % self.description)
- sys.stdout.flush()
- elif self.enabled:
- self.pbar.close()
+ try:
+ if self.json:
+ sys.stdout.write('{"fetch":"%s","finished":true,"maxval":1,"progress":1}\n\0'
+ % self.description)
+ sys.stdout.flush()
+ elif self.enabled:
+ self.pbar.close()
+ except (IOError, OSError) as e:
+ # Ignore BrokenPipeError and errors related to stdout or stderr being
+ # closed by a downstream program.
+ if e.errno not in (EPIPE, ESHUTDOWN):
+ raise
self.enabled = False
| BrokenPipeError
"command": "conda create -p ./untitled -y python=3.6"
"user_agent": "conda/4.4.2 requests/2.18.4 CPython/3.6.3 Linux/4.10.0-28-generic ubuntu/16.04 glibc/2.23"
```
Traceback (most recent call last):
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/exceptions.py\", line 722, in __call__
return func(*args, **kwargs)
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/cli/main_create.py\", line 11, in execute
install(args, parser, 'create')
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/cli/install.py\", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/cli/install.py\", line 265, in handle_txn
progressive_fetch_extract.execute()
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py\", line 543, in execute
exc = self._execute_actions(prec_or_spec, prec_actions)
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py\", line 595, in _execute_actions
progress_bar.close()
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/common/io.py\", line 376, in close
self.pbar.close()
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/_vendor/tqdm/_tqdm.py\", line 1054, in close
self.bar_format, self.postfix, self.unit_divisor))
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/_vendor/tqdm/_tqdm.py\", line 201, in print_status
fp_write('\\r' + s + (' ' * max(last_len[0] - len_s, 0)))
File \"/home/jon/anaconda3/lib/python3.6/site-packages/conda/_vendor/tqdm/_tqdm.py\", line 195, in fp_write
fp_flush()
BrokenPipeError: [Errno 32] Broken pipe
```
| 2017-12-22T18:08:33 |
||
conda/conda | 6,542 | conda__conda-6542 | [
"6541"
] | 84d8f425252dafadcaeed5a834300e058456881f | diff --git a/conda/core/envs_manager.py b/conda/core/envs_manager.py
--- a/conda/core/envs_manager.py
+++ b/conda/core/envs_manager.py
@@ -7,7 +7,7 @@
from ..base.constants import ROOT_ENV_NAME
from ..base.context import context
-from ..common.compat import on_win
+from ..common.compat import ensure_text_type, on_win, open
from ..common.path import expand, paths_equal
from ..gateways.disk.read import yield_lines
from ..gateways.disk.test import is_conda_environment
@@ -30,7 +30,7 @@ def register_env(location):
return
with open(USER_ENVIRONMENTS_TXT_FILE, 'a') as fh:
- fh.write(location)
+ fh.write(ensure_text_type(location))
fh.write('\n')
diff --git a/conda/gateways/disk/read.py b/conda/gateways/disk/read.py
--- a/conda/gateways/disk/read.py
+++ b/conda/gateways/disk/read.py
@@ -19,7 +19,7 @@
from ..._vendor.auxlib.collection import first
from ..._vendor.auxlib.ish import dals
from ...base.constants import PREFIX_PLACEHOLDER
-from ...common.compat import ensure_text_type
+from ...common.compat import ensure_text_type, open
from ...exceptions import CondaUpgradeError, CondaVerificationError, PathNotFoundError
from ...models.channel import Channel
from ...models.enums import FileMode, PathType
| python 2 can't read unicode in environments.txt
on a conda install operation, during the transaction
```
Traceback (most recent call last):
File "/Users/kfranz/continuum/conda/conda/core/link.py", line 535, in _execute_actions
action.execute()
File "/Users/kfranz/continuum/conda/conda/core/path_actions.py", line 876, in execute
register_env(self.target_prefix)
File "/Users/kfranz/continuum/conda/conda/core/envs_manager.py", line 28, in register_env
if location in yield_lines(USER_ENVIRONMENTS_TXT_FILE):
File "/Users/kfranz/continuum/conda/conda/gateways/disk/read.py", line 49, in yield_lines
if not line or line.startswith('#'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 54: ordinal not in range(128)
```
| Part of my `~/.conda/environments.txt` file that's causing python 2 to choke:
```
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/envs/shapely=1.6.0
/var/folders/cp/7r2s_s593j7_cpdtxxsmct880000gp/T/26b3 çêôñáß
/var/folders/cp/7r2s_s593j7_cpdtxxsmct880000gp/T/8eba áçêßôñ
/Users/kfranz/miniconda/envs/py2
/conda3
/Users/kfranz/miniconda/envs/_test2
``` | 2017-12-22T18:45:25 |
|
conda/conda | 6,550 | conda__conda-6550 | [
"6548"
] | 2060458e0c546a3c70fa041e738cb73b41c4b0d3 | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -12,17 +12,21 @@
from . import common
from .common import check_non_admin
+from .. import CondaError
from .._vendor.auxlib.ish import dals
from ..base.constants import ROOT_ENV_NAME
from ..base.context import context, locate_prefix_by_name
from ..common.compat import on_win, text_type
from ..core.index import calculate_channel_urls, get_index
+from ..core.linked_data import PrefixData
from ..core.solve import Solver
from ..exceptions import (CondaExitZero, CondaImportError, CondaOSError, CondaSystemExit,
CondaValueError, DirectoryNotFoundError, DryRunExit,
- EnvironmentLocationNotFound, PackagesNotFoundError,
- TooManyArgumentsError, UnsatisfiableError)
+ EnvironmentLocationNotFound,
+ PackageNotInstalledError, PackagesNotFoundError, TooManyArgumentsError,
+ UnsatisfiableError)
from ..misc import clone_env, explicit, touch_nonadmin
+from ..models.match_spec import MatchSpec
from ..plan import (revert_actions)
from ..resolve import ResolvePackageNotFound
@@ -187,6 +191,18 @@ def install(args, parser, command='install'):
raise CondaValueError("too few arguments, "
"must supply command line package specs or --file")
+ # for 'conda update', make sure the requested specs actually exist in the prefix
+ # and that they are name-only specs
+ if isupdate and not args.all:
+ prefix_data = PrefixData(prefix)
+ for spec in specs:
+ spec = MatchSpec(spec)
+ if not spec.is_name_only_spec:
+ raise CondaError("Invalid spec for 'conda update': %s\n"
+ "Use 'conda install' instead." % spec)
+ if not prefix_data.get(spec.name, None):
+ raise PackageNotInstalledError(prefix, spec.name)
+
if newenv and args.clone:
if args.packages:
raise TooManyArgumentsError(0, len(args.packages), list(args.packages),
diff --git a/conda/models/match_spec.py b/conda/models/match_spec.py
--- a/conda/models/match_spec.py
+++ b/conda/models/match_spec.py
@@ -189,6 +189,12 @@ def get(self, field_name, default=None):
v = self.get_raw_value(field_name)
return default if v is None else v
+ @property
+ def is_name_only_spec(self):
+ return (len(self._match_components) == 1
+ and 'name' in self._match_components
+ and self.name != '*')
+
def dist_str(self):
return self.__str__()
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -42,7 +42,7 @@
from conda.core.package_cache import PackageCache
from conda.core.repodata import create_cache_dir
from conda.exceptions import CommandArgumentError, DryRunExit, OperationNotAllowed, \
- PackagesNotFoundError, RemoveError, conda_exception_handler
+ PackagesNotFoundError, RemoveError, conda_exception_handler, PackageNotInstalledError
from conda.gateways.anaconda_client import read_binstar_tokens
from conda.gateways.disk.create import mkdir_p
from conda.gateways.disk.delete import rm_rf
@@ -453,6 +453,15 @@ def assert_json_parsable(content):
finally:
rmtree(prefix, ignore_errors=True)
+ def test_conda_update_package_not_installed(self):
+ with make_temp_env() as prefix:
+ with pytest.raises(PackageNotInstalledError):
+ run_command(Commands.UPDATE, prefix, "sqlite openssl")
+
+ with pytest.raises(CondaError) as conda_error:
+ run_command(Commands.UPDATE, prefix, "conda-forge::*")
+ assert conda_error.value.message.startswith("Invalid spec for 'conda update'")
+
def test_noarch_python_package_with_entry_points(self):
with make_temp_env("-c conda-test flask") as prefix:
py_ver = get_python_version_for_prefix(prefix)
| conda 4.4 has no difference between 'conda install' and 'conda update'
That is, `conda update` installs packages, even if the package isn't already in the environment.
| 2017-12-23T04:11:05 |
|
conda/conda | 6,555 | conda__conda-6555 | [
"6554"
] | 2060458e0c546a3c70fa041e738cb73b41c4b0d3 | 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
@@ -304,7 +304,14 @@ def _make_single_record(self, package_filename):
# to do is remove it and try extracting.
rm_rf(extracted_package_dir)
extract_tarball(package_tarball_full_path, extracted_package_dir)
- index_json_record = read_index_json(extracted_package_dir)
+ try:
+ index_json_record = read_index_json(extracted_package_dir)
+ except (IOError, OSError, JSONDecodeError):
+ # At this point, we can assume the package tarball is bad.
+ # Remove everything and move on.
+ rm_rf(package_tarball_full_path)
+ rm_rf(extracted_package_dir)
+ return None
else:
index_json_record = read_index_json_from_tarball(package_tarball_full_path)
except (EOFError, ReadError) as e:
| Package Cache FileNotFoundError
"command": "/home/rodrigo/anaconda3/bin/conda install --yes --json --force-pscheck --prefix /home/rodrigo/anaconda3 glueviz==0.12.0 --dry-run"
"user_agent": "conda/4.4.3 requests/2.18.4 CPython/3.5.4 Linux/4.4.0-104-generic ubuntu/16.04 glibc/2.23"
```
Traceback (most recent call last):
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 268, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/gateways/disk/read.py\", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/common/compat.py\", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/rodrigo/anaconda3/pkgs/r-data.table-1.10.4_1-r342he5fc37b_0/info/repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 285, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/gateways/disk/read.py\", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/common/compat.py\", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/rodrigo/anaconda3/pkgs/r-data.table-1.10.4_1-r342he5fc37b_0/info/index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/exceptions.py\", line 722, in __call__
return func(*args, **kwargs)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/cli/main_install.py\", line 11, in execute
install(args, parser, 'install')
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/cli/install.py\", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/cli/install.py\", line 260, in handle_txn
actions = unlink_link_transaction.make_legacy_action_groups(progressive_fetch_extract)[0]
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/link.py\", line 689, in make_legacy_action_groups
pfe.prepare()
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/common/io.py\", line 415, in decorated
return f(*args, **kwds)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 525, in prepare
for prec in self.link_precs)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 525, in <genexpr>
for prec in self.link_precs)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 419, in make_actions_for_record
), None)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 416, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 417, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 209, in _package_cache_records
self.load()
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 88, in load
package_cache_record = self._make_single_record(base_name)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/core/package_cache.py\", line 307, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/gateways/disk/read.py\", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
File \"/home/rodrigo/anaconda3/lib/python3.5/site-packages/conda/common/compat.py\", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/rodrigo/anaconda3/pkgs/r-data.table-1.10.4_1-r342he5fc37b_0/info/index.json'
```
| 2017-12-23T06:28:03 |
||
conda/conda | 6,558 | conda__conda-6558 | [
"6557"
] | 2060458e0c546a3c70fa041e738cb73b41c4b0d3 | diff --git a/conda/egg_info.py b/conda/egg_info.py
--- a/conda/egg_info.py
+++ b/conda/egg_info.py
@@ -29,7 +29,7 @@ def get_site_packages_dir(installed_pkgs):
def get_egg_info_files(sp_dir):
- for fn in os.listdir(sp_dir):
+ for fn in (isdir(sp_dir) and os.listdir(sp_dir) or ()):
if fn.endswith('.egg-link'):
with open(join(sp_dir, fn), 'r') as reader:
for egg in get_egg_info_files(reader.readline().strip()):
| conda list FileNotFoundError
```
"command": "/Users/hideki/anaconda/bin/conda list"
"user_agent": "conda/4.4.3 requests/2.14.2 CPython/3.5.2 Darwin/16.7.0 OSX/10.12.6"
Traceback (most recent call last):
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/exceptions.py\", line 722, in __call__
return func(*args, **kwargs)
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/cli/main_list.py\", line 150, in execute
show_channel_urls=context.show_channel_urls)
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/cli/main_list.py\", line 85, in print_packages
other_python = get_egg_info(prefix)
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/egg_info.py\", line 86, in get_egg_info
for path in get_egg_info_files(join(prefix, sp_dir)):
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/egg_info.py\", line 35, in get_egg_info_files
for egg in get_egg_info_files(reader.readline().strip()):
File \"/Users/hideki/anaconda/lib/python3.5/site-packages/conda/egg_info.py\", line 32, in get_egg_info_files
for fn in os.listdir(sp_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/Users/hideki/darkflow'
```
| 2017-12-23T07:04:44 |
||
conda/conda | 6,560 | conda__conda-6560 | [
"6529"
] | 2060458e0c546a3c70fa041e738cb73b41c4b0d3 | diff --git a/conda/common/serialize.py b/conda/common/serialize.py
--- a/conda/common/serialize.py
+++ b/conda/common/serialize.py
@@ -64,6 +64,16 @@ def yaml_load_safe(string):
return yaml.load(string, Loader=yaml.SafeLoader, version="1.2")
+def yaml_load_standard(string):
+ """Uses the default (unsafe) loader.
+
+ Examples:
+ >>> yaml_load_standard("prefix: !!python/unicode '/Users/darwin/test'")
+ {'prefix': '/Users/darwin/test'}
+ """
+ return yaml.load(string, Loader=yaml.Loader, version="1.2")
+
+
def yaml_dump(object):
"""dump object to string"""
return yaml.dump(object, Dumper=yaml.RoundTripDumper,
diff --git a/conda_env/env.py b/conda_env/env.py
--- a/conda_env/env.py
+++ b/conda_env/env.py
@@ -7,7 +7,7 @@
from conda.base.context import context
from conda.cli import common # TODO: this should never have to import form conda.cli
-from conda.common.serialize import yaml_load
+from conda.common.serialize import yaml_load_standard
from conda.core.linked_data import linked
from conda.models.match_spec import MatchSpec
from conda_env.yaml import dump
@@ -69,7 +69,7 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False):
def from_yaml(yamlstr, **kwargs):
"""Load and return a ``Environment`` from a given ``yaml string``"""
- data = yaml_load(yamlstr)
+ data = yaml_load_standard(yamlstr)
if kwargs is not None:
for key, value in kwargs.items():
data[key] = value
| Conda 4.4.2 YAML parsing bug
When trying to build my environment with conda 4.4.2, I get the following error. This did not occur with previous versions.
If I force downgrade conda to 4.3.31 before trying to build my environment, it works fine.
```
Traceback (most recent call last):
File "[conda_dir]/lib/python2.7/site-packages/conda/exceptions.py", line 722, in __call__
return func(*args, **kwargs)
File "[conda_dir]/lib/python2.7/site-packages/conda_env/cli/main.py", line 74, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "[conda_dir]/lib/python2.7/site-packages/conda_env/cli/main_create.py", line 79, in execute
directory=os.getcwd())
File "[conda_dir]/lib/python2.7/site-packages/conda_env/specs/__init__.py", line 20, in detect
if spec.can_handle():
File "[conda_dir]/lib/python2.7/site-packages/conda_env/specs/yaml_file.py", line 14, in can_handle
self._environment = env.from_file(self.filename)
File "[conda_dir]/lib/python2.7/site-packages/conda_env/env.py", line 84, in from_file
return from_yaml(yamlstr, filename=filename)
File "[conda_dir]/lib/python2.7/site-packages/conda_env/env.py", line 72, in from_yaml
data = yaml_load(yamlstr)
File "[conda_dir]/lib/python2.7/site-packages/conda/common/serialize.py", line 54, in yaml_load
return yaml.load(string, Loader=yaml.RoundTripLoader, version="1.2")
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/main.py", line 75, in load
return loader.get_single_data()
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 62, in get_single_data
return self.construct_document(node)
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 71, in construct_document
for dummy in generator:
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 1049, in construct_yaml_map
self.construct_mapping(node, data)
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 978, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 120, in construct_object
data = next(generator)
File "[conda_dir]/lib/python2.7/site-packages/ruamel_yaml/constructor.py", line 1115, in construct_undefined
node.start_mark)
ConstructorError: could not determine a constructor for the tag '!!python/unicode'
in "<byte string>", line 191, column 9:
prefix: !!python/unicode '/home/pair/dev ...
^
environment variables:
CIO_TEST=<not set>
CONDA_ROOT=[conda_dir]
MODULEPATH=/etc/scl/modulefiles:/etc/scl/modulefiles:/etc/scl/modulefiles:/usr/sh
are/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/pair/.local/bi
n:/home/pair/bin:/home/pair/.local/bin:/home/pair/bin
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
TERMINATOR_DBUS_PATH=/net/tenshu/Terminator2
WINDOWPATH=2
active environment : None
user config file : /home/pair/.condarc
populated config files :
conda version : 4.4.2
conda-build version : not installed
python version : 2.7.14.final.0
base environment : [conda_dir] (writable)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/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
package cache : [conda_dir]/pkgs
/home/pair/.conda/pkgs
envs directories : [conda_dir]/envs
/home/pair/.conda/envs
platform : linux-64
user-agent : conda/4.4.2 requests/2.18.4 CPython/2.7.14 Linux/4.13.16-100.fc25.x86_64 fedora/25 glibc/2.24
UID:GID : 1000:1000
netrc file : None
offline mode : False
```
| I actually have to downgrade to 4.3.31 to get this working again, sorry - 4.4.1 was a typo.
I'm unsure exactly what you mean here by "build my environment". What is the command you're executing when getting the error?
Sorry. I'm running:
```conda env create --force --file <requirements yaml file>```
I see the problem, yes. Also was confused thinking about changes between 4.4.1 and 4.4.2. Having the diff be 4.3.1 and 4.4.x makes a lot more sense.
Could you give me an example of a requirements yaml file that reproduces this problem for you? It could be stripped down from what you're using now, or completely made up. The important part to reproduce this is probably having things related to `!!python/unicode` in the file. I just don't know exactly where those are ending up for you.
Also, output of `conda list yaml --show-channel-urls`
Sorry for closing; bad click. I'm not very good at this.
Requirements file:
[requirements.yml](https://github.com/conda/conda/files/1582905/requirements.yml.txt)
Output of ```conda list yaml```:
```
# packages in environment at <conda dir>:
#
pyyaml 3.12 py27h2d70dd7_1
ruamel_yaml 0.11.14 py27h672d447_2
yaml 0.1.6 0
```
thanks that's helpful
If you need an immediate fix, you can just remove all the `!!python/unicode` stuff from the yaml file. I'm working on a patch to the code though too.
Actually, I think the only thing you have to change is
prefix: !!python/unicode '<directory>'
to
prefix: '<directory>' | 2017-12-23T10:34:05 |
|
conda/conda | 6,564 | conda__conda-6564 | [
"6562"
] | 2060458e0c546a3c70fa041e738cb73b41c4b0d3 | 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
@@ -1,12 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from errno import EACCES, EPERM
from functools import reduce
from logging import getLogger
from os import listdir
from os.path import basename, dirname, join
from tarfile import ReadError
+from conda.exceptions import NotWritableError
from .path_actions import CacheUrlAction, ExtractPackageAction
from .. import CondaError, CondaMultiError, conda_signal_handler
from .._vendor.auxlib.collection import first
@@ -336,7 +338,13 @@ def _make_single_record(self, package_filename):
if self.is_writable:
repodata_record = PackageRecord.from_objects(package_cache_record)
repodata_record_path = join(extracted_package_dir, 'info', 'repodata_record.json')
- write_as_json_to_file(repodata_record_path, repodata_record)
+ try:
+ write_as_json_to_file(repodata_record_path, repodata_record)
+ except (IOError, OSError) as e:
+ if e.errno in (EACCES, EPERM) and isdir(dirname(repodata_record_path)):
+ raise NotWritableError(repodata_record_path, e.errno, caused_by=e)
+ else:
+ raise
return package_cache_record
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -614,6 +614,8 @@ def __init__(self, path, errno, **kwargs):
change them by executing
$ sudo chown %(uid)s:%(gid)s %(path)s
+
+ In general, it's not advisable to use 'sudo conda'.
""")
import os
kwargs.update({
| package cache PermissionsError with repodata_record.json
```
error: PermissionError(13, 'Permission denied')
command: /home/jing/anaconda3/bin/conda upgrade Requests
user_agent: conda/4.4.3 requests/2.18.4 CPython/3.6.1 Linux/4.13.0-21-generic ubuntu/17.10 glibc/2.26
_messageid: -9223372036845975622
_messagetime: 1513948198000 / 2017-12-22 07:09:58
_receipttime: 1513993708752 / 2017-12-22 19:48:28
Traceback (most recent call last):
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 268, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/common/compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/jing/anaconda3/pkgs/conda-4.3.31-py36_0/info/repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 722, in __call__
return func(*args, **kwargs)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/cli/main_update.py", line 14, in execute
install(args, parser, 'update')
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 256, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/link.py", line 706, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/common/io.py", line 415, in decorated
return f(*args, **kwds)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 525, in prepare
for prec in self.link_precs)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 525, in <genexpr>
for prec in self.link_precs)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 419, in make_actions_for_record
), None)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 416, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 417, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 209, in _package_cache_records
self.load()
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 88, in load
package_cache_record = self._make_single_record(base_name)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 339, in _make_single_record
write_as_json_to_file(repodata_record_path, repodata_record)
File "/home/jing/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 61, in write_as_json_to_file
with open(file_path, str('wb')) as fo:
PermissionError: [Errno 13] Permission denied: '/home/jing/anaconda3/pkgs/conda-4.3.31-py36_0/info/repodata_record.json'
```
| ```
error: PermissionError(13, 'Permission denied')
command: /anaconda/bin/conda install cmake
user_agent: conda/4.4.3 requests/2.18.4 CPython/3.6.1 Darwin/17.3.0 OSX/10.13.2
_messageid: -9223372036845975560
_messagetime: 1514034249000 / 2017-12-23 07:04:09
_receipttime: 1514022115225 / 2017-12-23 03:41:55
Traceback (most recent call last):
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 268, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File "/anaconda/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File "/anaconda/lib/python3.6/site-packages/conda/common/compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/anaconda/pkgs/astropy-2.0.2-py36hf79c81d_4/info/repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda/lib/python3.6/site-packages/conda/exceptions.py", line 722, in __call__
return func(*args, **kwargs)
File "/anaconda/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/anaconda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/anaconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/anaconda/lib/python3.6/site-packages/conda/cli/install.py", line 239, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "/anaconda/lib/python3.6/site-packages/conda/cli/install.py", line 256, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File "/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 706, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File "/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "/anaconda/lib/python3.6/site-packages/conda/common/io.py", line 415, in decorated
return f(*args, **kwds)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 525, in prepare
for prec in self.link_precs)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 525, in <genexpr>
for prec in self.link_precs)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 419, in make_actions_for_record
), None)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 416, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 417, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 116, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 209, in _package_cache_records
self.load()
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 88, in load
package_cache_record = self._make_single_record(base_name)
File "/anaconda/lib/python3.6/site-packages/conda/core/package_cache.py", line 339, in _make_single_record
write_as_json_to_file(repodata_record_path, repodata_record)
File "/anaconda/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 61, in write_as_json_to_file
with open(file_path, str('wb')) as fo:
PermissionError: [Errno 13] Permission denied: '/anaconda/pkgs/astropy-2.0.2-py36hf79c81d_4/info/repodata_record.json'
```
All observed errors are on unix platforms. Maybe people really are encountering this from using `sudo` when they shouldn't be. | 2017-12-23T21:09:02 |
|
conda/conda | 6,565 | conda__conda-6565 | [
"6546"
] | 7616b87ad87b80da16b8263011c9c708be98147c | diff --git a/conda/history.py b/conda/history.py
--- a/conda/history.py
+++ b/conda/history.py
@@ -163,7 +163,7 @@ def get_user_requests(self):
specs = literal_eval(specs)
elif '[' not in specs:
specs = specs.split(',')
- specs = [spec for spec in specs if not spec.endswith('@')]
+ specs = [spec for spec in specs if spec and not spec.endswith('@')]
if specs and action in ('update', 'install', 'create'):
item['update_specs'] = item['specs'] = specs
elif specs and action in ('remove', 'uninstall'):
| I got: Solving environment: failed
After my Conda environment activated, I issue this command:
`conda update conda`
And I received an error message:
> Solving environment: failed
matches_for_spec:
- defaults::certifi-2017.11.5-py36hb8ac631_0
- defaults::h5py-2.7.1-py36he54a1c3_0
- defaults::hdf5-1.10.1-h98b8871_1
- defaults::icc_rt-2017.0.4-h97af966_0
- defaults::intel-openmp-2018.0.0-hd92c6cd_8
- defaults::keras-2.0.8-py36h65e7a35_0
- defaults::libprotobuf-3.4.1-h3dba5dd_0
- defaults::mkl-2018.0.1-h2108138_4
- defaults::numpy-1.12.1-py36hf30b8aa_1
- defaults::pip-9.0.1-py36h226ae91_4
- defaults::protobuf-3.4.1-py36h07fa351_0
- defaults::python-3.6.3-h3b118a2_4
- defaults::pyyaml-3.12-py36h1d1928f_1
- defaults::scipy-1.0.0-py36h1260518_0
- defaults::setuptools-36.5.0-py36h65f9e6e_0
- defaults::six-1.11.0-py36h4db2310_1
- defaults::tensorflow-1.1.0-np112py36_0
- defaults::vc-14-h2379b0c_2
- defaults::vs2015_runtime-14.0.25420-0
- defaults::werkzeug-0.12.2-py36h866a736_0
- defaults::wheel-0.30.0-py36h6c3ec14_1
- defaults::wincertstore-0.2-py36h7fe50ca_0
- defaults::yaml-0.1.7-hc54c509_2
- defaults::zlib-1.2.11-h8395fce_2
=====
My `conda info` output:
active environment : tensorflow
active env location : D:\Anaconda3\envs\tensorflow
shell level : 2
user config file : C:\Users\liemld\.condarc
populated config files :
conda version : 4.4.3
conda-build version : 3.0.27
python version : 3.6.3.final.0
base environment : D:\Anaconda3 (writable)
channel URLs : https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
package cache : D:\Anaconda3\pkgs
C:\Users\liemld\AppData\Local\conda\conda\pkgs
envs directories : D:\Anaconda3\envs
C:\Users\liemld\AppData\Local\conda\conda\envs
C:\Users\liemld\.conda\envs
platform : win-64
user-agent : conda/4.4.3 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.14393
administrator : False
netrc file : None
offline mode : False
====
`conda list`
# packages in environment at D:\Anaconda3\envs\tensorflow:
#
certifi 2017.11.5 py36hb8ac631_0
h5py 2.7.1 py36he54a1c3_0
hdf5 1.10.1 h98b8871_1
icc_rt 2017.0.4 h97af966_0
intel-openmp 2018.0.0 hd92c6cd_8
keras 2.0.8 py36h65e7a35_0
libprotobuf 3.4.1 h3dba5dd_0
mkl 2018.0.1 h2108138_4
numpy 1.12.1 py36hf30b8aa_1
pip 9.0.1 py36h226ae91_4
protobuf 3.4.1 py36h07fa351_0
python 3.6.3 h3b118a2_4
pyyaml 3.12 py36h1d1928f_1
scipy 1.0.0 py36h1260518_0
setuptools 36.5.0 py36h65f9e6e_0
six 1.11.0 py36h4db2310_1
tensorflow 1.1.0 np112py36_0
vc 14 h2379b0c_2
vs2015_runtime 14.0.25420 0
werkzeug 0.12.2 py36h866a736_0
wheel 0.30.0 py36h6c3ec14_1
wincertstore 0.2 py36h7fe50ca_0
yaml 0.1.7 hc54c509_2
zlib 1.2.11 h8395fce_2
Pls help!
With many thanks,
| Thanks for filing this issue. I added that special error message to help us get to the bottom of something confusing we were seeing in automatically-uploaded error reports.
I think I'm getting close to understanding this, but could use one more piece of information...
Do you mind posting here an additional file (probably just drag and drop into the text box area). The file I need to see is the history file located at
D:\Anaconda3\envs\tensorflow\conda-meta\history
[history.zip](https://github.com/conda/conda/files/1583963/history.zip)
Thanks for quick response.
I attached herewith the zipped "history" file. | 2017-12-23T21:28:09 |
|
conda/conda | 6,568 | conda__conda-6568 | [
"6546"
] | 5e3915b8d06618206cd29f2654dfc2be698dc332 | diff --git a/conda/history.py b/conda/history.py
--- a/conda/history.py
+++ b/conda/history.py
@@ -163,7 +163,7 @@ def get_user_requests(self):
specs = literal_eval(specs)
elif '[' not in specs:
specs = specs.split(',')
- specs = [spec for spec in specs if not spec.endswith('@')]
+ specs = [spec for spec in specs if spec and not spec.endswith('@')]
if specs and action in ('update', 'install', 'create'):
item['update_specs'] = item['specs'] = specs
elif specs and action in ('remove', 'uninstall'):
| I got: Solving environment: failed
After my Conda environment activated, I issue this command:
`conda update conda`
And I received an error message:
> Solving environment: failed
matches_for_spec:
- defaults::certifi-2017.11.5-py36hb8ac631_0
- defaults::h5py-2.7.1-py36he54a1c3_0
- defaults::hdf5-1.10.1-h98b8871_1
- defaults::icc_rt-2017.0.4-h97af966_0
- defaults::intel-openmp-2018.0.0-hd92c6cd_8
- defaults::keras-2.0.8-py36h65e7a35_0
- defaults::libprotobuf-3.4.1-h3dba5dd_0
- defaults::mkl-2018.0.1-h2108138_4
- defaults::numpy-1.12.1-py36hf30b8aa_1
- defaults::pip-9.0.1-py36h226ae91_4
- defaults::protobuf-3.4.1-py36h07fa351_0
- defaults::python-3.6.3-h3b118a2_4
- defaults::pyyaml-3.12-py36h1d1928f_1
- defaults::scipy-1.0.0-py36h1260518_0
- defaults::setuptools-36.5.0-py36h65f9e6e_0
- defaults::six-1.11.0-py36h4db2310_1
- defaults::tensorflow-1.1.0-np112py36_0
- defaults::vc-14-h2379b0c_2
- defaults::vs2015_runtime-14.0.25420-0
- defaults::werkzeug-0.12.2-py36h866a736_0
- defaults::wheel-0.30.0-py36h6c3ec14_1
- defaults::wincertstore-0.2-py36h7fe50ca_0
- defaults::yaml-0.1.7-hc54c509_2
- defaults::zlib-1.2.11-h8395fce_2
=====
My `conda info` output:
active environment : tensorflow
active env location : D:\Anaconda3\envs\tensorflow
shell level : 2
user config file : C:\Users\liemld\.condarc
populated config files :
conda version : 4.4.3
conda-build version : 3.0.27
python version : 3.6.3.final.0
base environment : D:\Anaconda3 (writable)
channel URLs : https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/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
package cache : D:\Anaconda3\pkgs
C:\Users\liemld\AppData\Local\conda\conda\pkgs
envs directories : D:\Anaconda3\envs
C:\Users\liemld\AppData\Local\conda\conda\envs
C:\Users\liemld\.conda\envs
platform : win-64
user-agent : conda/4.4.3 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.14393
administrator : False
netrc file : None
offline mode : False
====
`conda list`
# packages in environment at D:\Anaconda3\envs\tensorflow:
#
certifi 2017.11.5 py36hb8ac631_0
h5py 2.7.1 py36he54a1c3_0
hdf5 1.10.1 h98b8871_1
icc_rt 2017.0.4 h97af966_0
intel-openmp 2018.0.0 hd92c6cd_8
keras 2.0.8 py36h65e7a35_0
libprotobuf 3.4.1 h3dba5dd_0
mkl 2018.0.1 h2108138_4
numpy 1.12.1 py36hf30b8aa_1
pip 9.0.1 py36h226ae91_4
protobuf 3.4.1 py36h07fa351_0
python 3.6.3 h3b118a2_4
pyyaml 3.12 py36h1d1928f_1
scipy 1.0.0 py36h1260518_0
setuptools 36.5.0 py36h65f9e6e_0
six 1.11.0 py36h4db2310_1
tensorflow 1.1.0 np112py36_0
vc 14 h2379b0c_2
vs2015_runtime 14.0.25420 0
werkzeug 0.12.2 py36h866a736_0
wheel 0.30.0 py36h6c3ec14_1
wincertstore 0.2 py36h7fe50ca_0
yaml 0.1.7 hc54c509_2
zlib 1.2.11 h8395fce_2
Pls help!
With many thanks,
| Thanks for filing this issue. I added that special error message to help us get to the bottom of something confusing we were seeing in automatically-uploaded error reports.
I think I'm getting close to understanding this, but could use one more piece of information...
Do you mind posting here an additional file (probably just drag and drop into the text box area). The file I need to see is the history file located at
D:\Anaconda3\envs\tensorflow\conda-meta\history
[history.zip](https://github.com/conda/conda/files/1583963/history.zip)
Thanks for quick response.
I attached herewith the zipped "history" file. | 2017-12-24T02:39:13 |
|
conda/conda | 6,573 | conda__conda-6573 | [
"6572"
] | fbf3c0dac0667293d8926031119fb0798344d848 | diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -4,7 +4,7 @@
import bz2
from collections import defaultdict
from contextlib import closing
-from errno import ENODEV
+from errno import EACCES, ENODEV, EPERM
from genericpath import getmtime, isfile
import hashlib
import json
@@ -26,7 +26,7 @@
with_metaclass)
from ..common.url import join_url, maybe_unquote
from ..core.package_cache import PackageCache
-from ..exceptions import CondaDependencyError, CondaHTTPError, CondaIndexError
+from ..exceptions import CondaDependencyError, CondaHTTPError, CondaIndexError, NotWritableError
from ..gateways.connection import (ConnectionError, HTTPError, InsecureRequestWarning,
InvalidSchema, SSLError)
from ..gateways.connection.session import CondaSession
@@ -219,8 +219,14 @@ def _load(self):
else:
if not isdir(dirname(self.cache_path_json)):
mkdir_p(dirname(self.cache_path_json))
- with open(self.cache_path_json, 'w') as fh:
- fh.write(raw_repodata_str or '{}')
+ try:
+ with open(self.cache_path_json, 'w') as fh:
+ fh.write(raw_repodata_str or '{}')
+ except (IOError, OSError) as e:
+ if e.errno in (EACCES, EPERM):
+ raise NotWritableError(self.cache_path_json, e.errno, caused_by=e)
+ else:
+ raise
_internal_state = self._process_raw_repodata_str(raw_repodata_str)
self._internal_state = _internal_state
self._pickle_me()
| cached repodata.json PermissionsError
```
error: PermissionError(13, 'Permission denied')
command: /Users/apple/.conda/envs/cafe/bin/conda uninstall protobuf
user_agent: conda/4.4.3 requests/2.18.4 CPython/3.6.1 Darwin/16.1.0 OSX/10.12.1
_messageid: -9223372036845375609
_messagetime: 1514148478933 / 2017-12-24 14:47:58
_receipttime: 1514148478933 / 2017-12-24 14:47:58
Traceback (most recent call last):
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 722, in __call__
return func(*args, **kwargs)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/cli/main_remove.py", line 82, in execute
txn = solver.solve_for_transaction(force_remove=args.force)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 501, in solve_for_transaction
force_remove, force_reinstall)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 434, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 178, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 557, in _prepare
self.subdirs, prepared_specs)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 214, in get_reduced_index
new_records = query_all(spec)
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 187, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 99, in query
self.load()
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 143, in load
_internal_state = self._load()
File "/Users/apple/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 222, in _load
with open(self.cache_path_json, 'w') as fh:
PermissionError: [Errno 13] Permission denied: '/Users/apple/miniconda3/pkgs/cache/809318c1.json'
```
| 2017-12-24T23:17:48 |
||
conda/conda | 6,585 | conda__conda-6585 | [
"6577"
] | fbf3c0dac0667293d8926031119fb0798344d848 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -426,6 +426,10 @@ def _update_prompt(self, set_vars, conda_prompt_modifier):
current_prompt_modifier = os.environ.get('CONDA_PROMPT_MODIFIER')
if current_prompt_modifier:
ps1 = re.sub(re.escape(current_prompt_modifier), r'', ps1)
+ # Because we're using single-quotes to set shell variables, we need to handle the
+ # proper escaping of single quotes that are already part of the string.
+ # Best solution appears to be https://stackoverflow.com/a/1250279
+ ps1 = ps1.replace("'", "'\"'\"'")
set_vars.update({
'PS1': conda_prompt_modifier + ps1,
})
| Updated to conda 4.4.4, can't activate any environment
I just updated to 4.4.4, and now activation fails on a bash syntax error at the PS1 configuration, even for a freshly created env:
```bash
conda create -n foo -y -q python
````
then:
```bash
alpamayo[junk]> conda activate foo
bash: syntax error near unexpected token `('
alpamayo[junk]> source activate foo
bash: eval: line 58: syntax error near unexpected token `('
bash: eval: line 58: `PS1='(foo) \[\033[0;32m\]$(__git_ps1 '(%s)')\[\033[1;31m\]\[\033[1;34m\]\h[\[\033[1;36m\]\W\[\033[1;34m\]]\[\033[1;32m\]> \[\033[0m\]''
````
Some conda info:
```bash
alpamayo[junk]> conda --version
conda 4.4.4
alpamayo[junk]> conda info -a
active environment : None
shell level : 0
user config file : /Users/fperez/.condarc
populated config files : /Users/fperez/.condarc
conda version : 4.4.4
conda-build version : not installed
python version : 3.6.4.final.0
base environment : /Users/fperez/usr/conda (writable)
channel URLs : https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
package cache : /Users/fperez/usr/conda/pkgs
/Users/fperez/.conda/pkgs
envs directories : /Users/fperez/usr/conda/envs
/Users/fperez/.conda/envs
platform : osx-64
user-agent : conda/4.4.4 requests/2.18.4 CPython/3.6.4 Darwin/16.7.0 OSX/10.12.6
UID:GID : 33212:20665
netrc file : None
offline mode : False
```
Any tips? thanks!
| Can you give me the output of
echo "$PS1"
in a new terminal window?
```
alpamayo[~]> echo "$PS1"
\[\033[0;32m\]$(__git_ps1 '(%s)')\[\033[1;31m\]\[\033[1;34m\]\h[\[\033[1;36m\]\W\[\033[1;34m\]]\[\033[1;32m\]> \[\033[0m\]
```
ps - for now I'm back to being able to work by reverting to 4.3.31, so no biggie (I tried all in the 4.4.x series with similar problems). Thanks for the quick response!
Ok I’ll work with your ps1 in a little while to see if I can come up with a solution. Thanks for the report.
No worries, thanks much!
I wasn't expecting a reply on xmas, btw. Please take a break :)
| 2017-12-27T17:12:27 |
|
conda/conda | 6,588 | conda__conda-6588 | [
"6579"
] | fbf3c0dac0667293d8926031119fb0798344d848 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -266,6 +266,12 @@ def build_activate(self, env_name_or_prefix):
self._update_prompt(set_vars, conda_prompt_modifier)
+ if on_win and self.shell == 'cmd.exe':
+ import ctypes
+ export_vars.update({
+ "PYTHONIOENCODING": ctypes.cdll.kernel32.GetACP(),
+ })
+
return {
'unset_vars': (),
'set_vars': set_vars,
| diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -33,6 +33,13 @@
log = getLogger(__name__)
+if on_win:
+ import ctypes
+ PYTHONIOENCODING = ctypes.cdll.kernel32.GetACP()
+else:
+ PYTHONIOENCODING = None
+
+
class ActivatorUnitTests(TestCase):
def test_activate_environment_not_found(self):
@@ -274,7 +281,6 @@ def test_activate_same_environment(self):
'CONDA_PROMPT_MODIFIER': "(%s) " % td,
'CONDA_SHLVL': 1,
}
-
assert builder['unset_vars'] == ()
assert builder['set_vars'] == {}
assert builder['export_vars'] == export_vars
@@ -478,6 +484,7 @@ def test_posix_basic(self):
'ps1': os.environ.get('PS1', ''),
}
+ @pytest.mark.skipif(not on_win, reason="cmd.exe only on Windows")
def test_cmd_exe_basic(self):
activator = Activator('cmd.exe')
self.make_dot_d_files(activator.script_extension)
@@ -500,6 +507,7 @@ def test_cmd_exe_basic(self):
@SET "CONDA_PYTHON_EXE=%(sys_executable)s"
@SET "CONDA_SHLVL=1"
@SET "PATH=%(new_path)s"
+ @SET "PYTHONIOENCODING=%(PYTHONIOENCODING)s"
@CALL "%(activate1)s"
""") % {
'converted_prefix': activator.path_conversion(self.prefix),
@@ -507,6 +515,7 @@ def test_cmd_exe_basic(self):
'new_path': activator.pathsep_join(new_path_parts),
'sys_executable': activator.path_conversion(sys.executable),
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.bat')),
+ 'PYTHONIOENCODING': PYTHONIOENCODING,
}
with env_vars({
| Win 10: Update to conda 4.4.4 breaks python path
I updated to conda 4.4.4 recently, and now when I open a new "Anaconda Prompt" the first thing that is displayed is:
`'python' is not recognized as an internal or external command,
operable program or batch file.`
At this point, I can start Python just fine. However, if I activate and then deactivate another environment, I can't use Python from the command prompt anymore. I get the same error message as above. I've tried rolling back the conda update with revisions, but that broke my installation. (The package pycosat does not get uninstalled properly, which seemed to break my conda install.)
Not sure if this matters, but the text in parentheses before the path has changed. Before the update, It would read as the path to my Anaconda installation. In conda 4.4.4, it reads as `(base)`. This may be intended for this update, but I just thought I would share.
| Do you know what version of conda you had before you updated?
I started with a fresh Anacoda distribution. (Py3.6, Win64) | 2017-12-27T19:43:34 |
conda/conda | 6,589 | conda__conda-6589 | [
"6584"
] | fbf3c0dac0667293d8926031119fb0798344d848 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from errno import ENOENT
from logging import getLogger
import os
from os.path import (abspath, basename, dirname, expanduser, isdir, isfile, join, normpath,
@@ -30,6 +31,16 @@
except ImportError: # pragma: no cover
from .._vendor.toolz.itertoolz import concat, concatv, unique
+try:
+ os.getcwd()
+except (IOError, OSError) as e:
+ if e.errno == ENOENT:
+ # FileNotFoundError can occur when cwd has been deleted out from underneath the process.
+ # To resolve #6584, let's go with setting cwd to sys.prefix, and see how far we get.
+ os.chdir(sys.prefix)
+ else:
+ raise
+
log = getLogger(__name__)
_platform_map = {
| os.getcwd() FileNotFoundError
```
error: FileNotFoundError(2, 'No such file or directory')
command: /root/anaconda3/bin/conda shell.posix deactivate
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.3 Linux/4.13.0-kali1-amd64 kali/2017.3 glibc/2.25
_messageid: -9223372036844975611
_messagetime: 1514233339489 / 2017-12-25 14:22:19
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 110, in main
from ..activate import main as activator_main
File "/root/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 12, in <module>
context.__init__() # oOn import, context does not include SEARCH_PATH. This line fixes that.
File "/root/anaconda3/lib/python3.6/site-packages/conda/base/context.py", line 214, in __init__
argparse_args=argparse_args)
File "/root/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 723, in __init__
self._set_search_path(search_path)
File "/root/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 729, in _set_search_path
self._set_raw_data(load_file_configs(search_path))
File "/root/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in load_file_configs
expanded_paths = tuple(expand(path) for path in search_path)
File "/root/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in <genexpr>
expanded_paths = tuple(expand(path) for path in search_path)
File "/root/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 49, in expand
return abspath(expanduser(expandvars(path)))
File "/root/anaconda3/lib/python3.6/posixpath.py", line 374, in abspath
cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
```
| ```
error: FileNotFoundError(2, 'No such file or directory')
command: /Users/limxing/anaconda3/bin/conda install iris
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.4 Darwin/17.3.0 OSX/10.13.2
_messageid: -9223372036844475580
_messagetime: 1514289512434 / 2017-12-26 05:58:32
Traceback (most recent call last):
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 74, in _main
context.__init__(argparse_args=args)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/base/context.py", line 214, in __init__
argparse_args=argparse_args)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 723, in __init__
self._set_search_path(search_path)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 729, in _set_search_path
self._set_raw_data(load_file_configs(search_path))
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in load_file_configs
expanded_paths = tuple(expand(path) for path in search_path)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in <genexpr>
expanded_paths = tuple(expand(path) for path in search_path)
File "/Users/limxing/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 49, in expand
return abspath(expanduser(expandvars(path)))
File "/Users/limxing/anaconda3/lib/python3.6/posixpath.py", line 374, in abspath
cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
```
```
error: FileNotFoundError(2, 'No such file or directory')
command: /home/anti/miniconda3/bin/conda update --all
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.4 Linux/3.10.0-693.11.1.el7.x86_64 centos/7 glibc/2.17
_messageid: -9223372036844375596
_messagetime: 1514305043219 / 2017-12-26 10:17:23
Traceback (most recent call last):
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 74, in _main
context.__init__(argparse_args=args)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/base/context.py", line 214, in __init__
argparse_args=argparse_args)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 723, in __init__
self._set_search_path(search_path)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 729, in _set_search_path
self._set_raw_data(load_file_configs(search_path))
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in load_file_configs
expanded_paths = tuple(expand(path) for path in search_path)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 366, in <genexpr>
expanded_paths = tuple(expand(path) for path in search_path)
File "/home/anti/miniconda3/lib/python3.6/site-packages/conda/common/path.py", line 49, in expand
return abspath(expanduser(expandvars(path)))
File "/home/anti/miniconda3/lib/python3.6/posixpath.py", line 374, in abspath
cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
```
https://stackoverflow.com/questions/23889636/error-while-executing-os-getcwd | 2017-12-27T20:26:53 |
|
conda/conda | 6,602 | conda__conda-6602 | [
"6592"
] | fbf3c0dac0667293d8926031119fb0798344d848 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -187,6 +187,9 @@ class Help(CondaError): # NOQA
self.command = command
def _yield_commands(self, cmds_dict):
+ for script in cmds_dict.get('deactivate_scripts', ()):
+ yield self.run_script_tmpl % script
+
for key in sorted(cmds_dict.get('unset_vars', ())):
yield self.unset_var_tmpl % key
@@ -196,9 +199,6 @@ def _yield_commands(self, cmds_dict):
for key, value in sorted(iteritems(cmds_dict.get('export_vars', {}))):
yield self.export_var_tmpl % (key, value)
- for script in cmds_dict.get('deactivate_scripts', ()):
- yield self.run_script_tmpl % script
-
for script in cmds_dict.get('activate_scripts', ()):
yield self.run_script_tmpl % script
| diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -446,9 +446,9 @@ def test_posix_basic(self):
reactivate_data = c.stdout
assert reactivate_data == dals("""
+ . "%(deactivate1)s"
export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
export CONDA_SHLVL='1'
- . "%(deactivate1)s"
. "%(activate1)s"
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.sh')),
@@ -464,6 +464,7 @@ def test_posix_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ . "%(deactivate1)s"
unset CONDA_DEFAULT_ENV
unset CONDA_PREFIX
unset CONDA_PROMPT_MODIFIER
@@ -471,7 +472,6 @@ def test_posix_basic(self):
PS1='%(ps1)s'
export CONDA_SHLVL='0'
export PATH='%(new_path)s'
- . "%(deactivate1)s"
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.sh')),
@@ -524,9 +524,9 @@ def test_cmd_exe_basic(self):
rm_rf(reactivate_result)
assert reactivate_data == dals("""
+ @CALL "%(deactivate1)s"
@SET "CONDA_PROMPT_MODIFIER=(%(native_prefix)s) "
@SET "CONDA_SHLVL=1"
- @CALL "%(deactivate1)s"
@CALL "%(activate1)s"
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.bat')),
@@ -545,13 +545,13 @@ def test_cmd_exe_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ @CALL "%(deactivate1)s"
@SET CONDA_DEFAULT_ENV=
@SET CONDA_PREFIX=
@SET CONDA_PROMPT_MODIFIER=
@SET CONDA_PYTHON_EXE=
@SET "CONDA_SHLVL=0"
@SET "PATH=%(new_path)s"
- @CALL "%(deactivate1)s"
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.bat')),
@@ -598,9 +598,9 @@ def test_csh_basic(self):
reactivate_data = c.stdout
assert reactivate_data == dals("""
+ source "%(deactivate1)s";
setenv CONDA_PROMPT_MODIFIER "(%(native_prefix)s) ";
setenv CONDA_SHLVL "1";
- source "%(deactivate1)s";
source "%(activate1)s";
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.csh')),
@@ -616,6 +616,7 @@ def test_csh_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ source "%(deactivate1)s";
unset CONDA_DEFAULT_ENV;
unset CONDA_PREFIX;
unset CONDA_PROMPT_MODIFIER;
@@ -623,7 +624,6 @@ def test_csh_basic(self):
set prompt='%(prompt)s';
setenv CONDA_SHLVL "0";
setenv PATH "%(new_path)s";
- source "%(deactivate1)s";
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.csh')),
@@ -676,9 +676,9 @@ def test_xonsh_basic(self):
rm_rf(reactivate_result)
assert reactivate_data == dals("""
+ source "%(deactivate1)s"
$CONDA_PROMPT_MODIFIER = '(%(native_prefix)s) '
$CONDA_SHLVL = '1'
- source "%(deactivate1)s"
source "%(activate1)s"
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.xsh')),
@@ -697,13 +697,13 @@ def test_xonsh_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ source "%(deactivate1)s"
del $CONDA_DEFAULT_ENV
del $CONDA_PREFIX
del $CONDA_PROMPT_MODIFIER
del $CONDA_PYTHON_EXE
$CONDA_SHLVL = '0'
$PATH = '%(new_path)s'
- source "%(deactivate1)s"
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.xsh')),
@@ -748,9 +748,9 @@ def test_fish_basic(self):
reactivate_data = c.stdout
assert reactivate_data == dals("""
+ source "%(deactivate1)s";
set -gx CONDA_PROMPT_MODIFIER "(%(native_prefix)s) ";
set -gx CONDA_SHLVL "1";
- source "%(deactivate1)s";
source "%(activate1)s";
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.fish')),
@@ -766,13 +766,13 @@ def test_fish_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ source "%(deactivate1)s";
set -e CONDA_DEFAULT_ENV;
set -e CONDA_PREFIX;
set -e CONDA_PROMPT_MODIFIER;
set -e CONDA_PYTHON_EXE;
set -gx CONDA_SHLVL "0";
set -gx PATH "%(new_path)s";
- source "%(deactivate1)s";
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.fish')),
@@ -817,9 +817,9 @@ def test_powershell_basic(self):
reactivate_data = c.stdout
assert reactivate_data == dals("""
+ . "%(deactivate1)s"
$env:CONDA_PROMPT_MODIFIER = "(%(prefix)s) "
$env:CONDA_SHLVL = "1"
- . "%(deactivate1)s"
. "%(activate1)s"
""") % {
'activate1': join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.ps1'),
@@ -835,13 +835,13 @@ def test_powershell_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
+ . "%(deactivate1)s"
Remove-Variable CONDA_DEFAULT_ENV
Remove-Variable CONDA_PREFIX
Remove-Variable CONDA_PROMPT_MODIFIER
Remove-Variable CONDA_PYTHON_EXE
$env:CONDA_SHLVL = "0"
$env:PATH = "%(new_path)s"
- . "%(deactivate1)s"
""") % {
'new_path': new_path,
'deactivate1': join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.ps1'),
| deactivate sets `CONDA_PREFIX` to the wrong value.
Deactivating an env. into which the new compilers have been installed leads to:
```
ERROR: This cross-compiler package contains no program /opt/conda/bin/x86_64-conda_cos6-linux-gnu-cc
```
This comes from [here](https://github.com/AnacondaRecipes/aggregate/blob/master/ctng-compilers-activation-feedstock/recipe/deactivate-gcc.sh#L58)
It seems that `CONDA_PREFIX` has been set to the prefix of the new environment instead of that of the old environment.
It doesn't seem to matter whether the legacy activate scripts or the conda shell function are used here, both exhibit the same problem.
| > It seems that `CONDA_PREFIX` has been set to the prefix of the new environment instead of that of the old environment.
It's my understanding that `CONDA_PREFIX` has always been the path to the current active prefix. At least back to the #1727 days or so. Then again, I could be completely mis-remembering, and I've added pieces of code over time that made that assumption, because I can't find any reference to `CONDA_PREFIX` in the 4.3.x code concerning activate.
Oh, right. I was only looking in the code, not the shell wrappers.
https://github.com/conda/conda/blob/4.3.31/shell/activate#L88-L92 | 2017-12-28T17:57:46 |
conda/conda | 6,609 | conda__conda-6609 | [
"6607"
] | 03df284ace72bf77601513aaabf91120f5fe9b0c | diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -6,6 +6,7 @@
from logging import getLogger
import os
from os.path import abspath, expanduser, join
+from subprocess import Popen
import sys
from textwrap import dedent
@@ -133,8 +134,13 @@ def error(self, message):
from ..exceptions import CommandNotFoundError
raise CommandNotFoundError(cmd)
args = [find_executable('conda-' + cmd)]
- args.extend(sys.argv[2:])
- os.execv(args[0], args)
+ p = Popen(args)
+ try:
+ p.communicate()
+ except KeyboardInterrupt:
+ p.wait()
+ finally:
+ sys.exit(p.returncode)
super(ArgumentParser, self).error(message)
| conda env giving strange non-blocking behavior on Windows
Using conda 4.4.4, this is happening in both the Anaconda prompt and Git Bash. To reproduce, simply run `conda env -h`. The prompt will return and it seems like conda is run in the background, producing output a few seconds later. Strangely enough, this doesn't happen when running `conda-env -h`.
| I noticed that too. Is it new in 4.4, and not that way in 4.3? I guess it's coming from using `os.execv()`, which apparently behaves differently on Windows than I'm used to on unix systems?
To clarify, I noticed it yesterday with `conda build`.
I never noticed this sort of thing with any older versions.
Oh, and I was working in `cmd.exe`, not git bash. So it's I guess a problem universal to Windows. | 2017-12-29T14:57:11 |
|
conda/conda | 6,615 | conda__conda-6615 | [
"6612"
] | 0f3a83b1fd068c75e530ddece96e98cc5b5e6d8e | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -368,8 +368,20 @@ def build_reactivate(self):
def _get_starting_path_list(self):
path = os.environ['PATH']
if on_win:
- # on Windows, the python interpreter prepends sys.prefix\Library\bin on startup WTF
- return path.split(os.pathsep)[1:]
+ # On Windows, the Anaconda Python interpreter prepends sys.prefix\Library\bin on
+ # startup. It's a hack that allows users to avoid using the correct activation
+ # procedure; a hack that needs to go away because it doesn't add all the paths.
+ # See: https://github.com/AnacondaRecipes/python-feedstock/blob/master/recipe/0005-Win32-Ensure-Library-bin-is-in-os.environ-PATH.patch # NOQA
+ # But, we now detect if that has happened because:
+ # 1. In future we would like to remove this hack and require real activation.
+ # 2. We should not assume that the Anaconda Python interpreter is being used.
+ path_split = path.split(os.pathsep)
+ library_bin = r"%s\Library\bin" % (sys.prefix)
+ # ^^^ deliberately the same as: https://github.com/AnacondaRecipes/python-feedstock/blob/8e8aee4e2f4141ecfab082776a00b374c62bb6d6/recipe/0005-Win32-Ensure-Library-bin-is-in-os.environ-PATH.patch#L20 # NOQA
+ if normpath(path_split[0]) == normpath(library_bin):
+ return path_split[1:]
+ else:
+ return path_split
else:
return path.split(os.pathsep)
| diff --git a/tests/cli/test_activate.py b/tests/cli/test_activate.py
--- a/tests/cli/test_activate.py
+++ b/tests/cli/test_activate.py
@@ -246,7 +246,6 @@ def test_activate_bad_env_keeps_existing_good_env(shell):
@pytest.mark.installed
[email protected](on_win and datetime.now() < datetime(2018, 11, 21), reason="need to get 4.4.x merge-up finished", strict=True)
def test_activate_deactivate(shell):
if shell == 'bash.exe':
pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
@@ -284,7 +283,6 @@ def test_activate_deactivate(shell):
@pytest.mark.installed
[email protected](on_win and datetime.now() < datetime(2018, 11, 21), reason="need to get 4.4.x merge-up finished", strict=True)
def test_activate_root_simple(shell):
if shell == 'bash.exe':
pytest.skip("usage of cygpath in win_path_to_unix messes this test up")
| PATH manipulation problems with conda.bat activate on Windows
With conda 4.4.5:
```
C:\Users\builder>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\PuTTY\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Users\builder\AppData\Local\Microsoft\WindowsApps;
c:/Users/builder/m64/Library/bin/conda.bat activate
'chcp' is not recognized as an internal or external command,
operable program or batch file.
(base) C:\Users\builder>(base) C:\Users\builder>echo %PATH%
c:\Users\builder\m64;c:\Users\builder\m64\Library\mingw-w64\bin;c:\Users\builder\m64\Library\usr\bin;c:\Users\builder\m64\Library\bin;c:\Users\builder\m64\Scripts;c:\Users\builder\m64\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\PuTTY\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Users\builder\AppData\Local\Microsoft\WindowsApps;
```
Notice that `C:\WINDOWS\system32` got dropped which is why `chcp` isn't found (this folder contains lots of important programs too).
| Is this with 4.4.5 in canary?
Sent from my iPhone
> On Dec 29, 2017, at 8:19 PM, Ray Donnelly <[email protected]> wrote:
>
> C:\Users\builder>echo %PATH%
> C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\PuTTY\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Users\builder\AppData\Local\Microsoft\WindowsApps;
>
> c:/Users/builder/m64/Library/bin/conda.bat activate
> 'chcp' is not recognized as an internal or external command,
> operable program or batch file.
>
> c:\Users\builder\m64;c:\Users\builder\m64\Library\mingw-w64\bin;c:\Users\builder\m64\Library\usr\bin;c:\Users\builder\m64\Library\bin;c:\Users\builder\m64\Scripts;c:\Users\builder\m64\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\PuTTY\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Users\builder\AppData\Local\Microsoft\WindowsApps;
> Notice that C:\WINDOWS\system32 got dropped which is why chcp isn't found (this folder contains lots of important programs too).
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
Yes and 4.4.4 too
OK, I know what's going on and it's kind of my fault (but I want to make a PR to conda to avoid this anyway).
While investigating https://github.com/ContinuumIO/anaconda/issues/1158 to check whether [this horrible hack](https://github.com/AnacondaRecipes/python-feedstock/blob/master/recipe/0005-Win32-Ensure-Library-bin-is-in-os.environ-PATH.patch) was to blame I removed it.
That then tripped up [this code](https://github.com/conda/conda/blob/master/conda/activate.py#L368-L374):
```
def _get_starting_path_list(self):
path = os.environ['PATH']
if on_win:
# on Windows, the python interpreter prepends sys.prefix\Library\bin on startup WTF
return path.split(os.pathsep)[1:]
else:
return path.split(os.pathsep)
```
I will make a PR that will only elide the first element when the interpreter has actually done this (by testing it to see if the value of the first entry is indeed `sys.prefix\Library\bin`) and will add a link back to this unfortunate patch in our python recipe for reference (hopefully one day that link will point to nothing).
This will remove a dependency between future conda releasses and this hack in our Python interpreter and will also allow conda to work correctly on other builds of Python on Windows.
| 2017-12-30T23:17:42 |
conda/conda | 6,619 | conda__conda-6619 | [
"6618"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | 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
@@ -11,11 +11,12 @@
from .. import CondaError
from .._vendor.auxlib.entity import EntityEncoder
+from ..base.constants import PathConflict, SafetyChecks
from ..base.context import context, sys_rc_path, user_rc_path
from ..common.compat import isiterable, iteritems, itervalues, string_types, text_type
from ..common.configuration import pretty_list, pretty_map
from ..common.io import timeout
-from ..common.serialize import yaml_dump, yaml_load
+from ..common.serialize import yaml, yaml_dump, yaml_load
try:
from cytoolz.itertoolz import concat, groupby
@@ -309,6 +310,17 @@ def execute_config(args, parser):
# config.rc_keys
if not args.get:
+
+ # Add representers for enums.
+ # Because a representer cannot be added for the base Enum class (it must be added for
+ # each specific Enum subclass), and because of import rules), I don't know of a better
+ # location to do this.
+ def enum_representer(dumper, data):
+ return dumper.represent_str(str(data))
+
+ yaml.representer.RoundTripRepresenter.add_representer(SafetyChecks, enum_representer)
+ yaml.representer.RoundTripRepresenter.add_representer(PathConflict, enum_representer)
+
try:
with open(rc_path, 'w') as rc:
rc.write(yaml_dump(rc_config))
| RepresenterError('cannot represent an object: prevent',)
```
error: RepresenterError('cannot represent an object: prevent',)
command: C:\tools\Anaconda3\Scripts\conda config --set path_conflict prevent
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.16299
_messageid: -9223372036843225525
_messagetime: 1514570427640 / 2017-12-29 12:00:27
Traceback (most recent call last):
File "C:\tools\Anaconda3\lib\site-packages\conda\exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "C:\tools\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
exit_code = do_call(args, p)
File "C:\tools\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "C:\tools\Anaconda3\lib\site-packages\conda\cli\main_config.py", line 29, in execute
execute_config(args, parser)
File "C:\tools\Anaconda3\lib\site-packages\conda\cli\main_config.py", line 312, in execute_config
rc.write(yaml_dump(rc_config))
File "C:\tools\Anaconda3\lib\site-packages\conda\common\serialize.py", line 81, in yaml_dump
indent=2)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\main.py", line 254, in dump
version=version, tags=tags, block_seq_indent=block_seq_indent)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\main.py", line 224, in dump_all
dumper.represent(data)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 49, in represent
node = self.represent_data(data)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 83, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 852, in represent_dict
return self.represent_mapping(tag, data)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 698, in represent_mapping
node_value = self.represent_data(item_value)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 93, in represent_data
node = self.yaml_representers[None](self, data)
File "C:\tools\Anaconda3\lib\site-packages\ruamel_yaml\representer.py", line 324, in represent_undefined
raise RepresenterError("cannot represent an object: %s" % data)
ruamel_yaml.representer.RepresenterError: cannot represent an object: prevent
```
| 2018-01-01T00:01:33 |
||
conda/conda | 6,647 | conda__conda-6647 | [
"6643"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/models/version.py b/conda/models/version.py
--- a/conda/models/version.py
+++ b/conda/models/version.py
@@ -463,12 +463,17 @@ def __new__(cls, spec):
self.op = VersionOrder.startswith
self.cmp = VersionOrder(spec.rstrip('*').rstrip('.'))
self.match = self.veval_match_
+ elif '@' not in spec:
+ self.op = opdict["=="]
+ self.cmp = VersionOrder(spec)
+ self.match = self.veval_match_
else:
self.match = self.exact_match_
return self
def is_exact(self):
- return self.match == self.exact_match_
+ return (self.match == self.exact_match_
+ or self.match == self.veval_match_ and self.op == op.__eq__)
def __eq__(self, other):
try:
| diff --git a/tests/models/test_match_spec.py b/tests/models/test_match_spec.py
--- a/tests/models/test_match_spec.py
+++ b/tests/models/test_match_spec.py
@@ -50,6 +50,7 @@ def test_match_1(self):
('numpy >1.8,<2|==1.7', False),('numpy >1.8,<2|>=1.7.1', True),
('numpy >=1.8|1.7*', True), ('numpy ==1.7', False),
('numpy >=1.5,>1.6', True), ('numpy ==1.7.1', True),
+ ('numpy ==1.7.1.0', True), ('numpy==1.7.1.0.0', True),
('numpy >=1,*.7.*', True), ('numpy *.7.*,>=1', True),
('numpy >=1,*.8.*', False), ('numpy >=2,*.7.*', False),
('numpy 1.6*|1.7*', True), ('numpy 1.6*|1.8*', False),
@@ -560,6 +561,14 @@ def test_parse_equal_equal(self):
"name": "numpy",
"version": "1.7",
}
+ assert _parse_spec_str("numpy=1.7") == {
+ "name": "numpy",
+ "version": "1.7*",
+ }
+ assert _parse_spec_str("numpy =1.7") == {
+ "name": "numpy",
+ "version": "1.7*",
+ }
def test_parse_hard(self):
assert _parse_spec_str("numpy>1.8,<2|==1.7") == {
| version '==' interpreted differently in 4.3 and 4.4
| 2018-01-04T18:03:41 |
|
conda/conda | 6,651 | conda__conda-6651 | [
"6650"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -13,7 +13,7 @@
from ._vendor.auxlib.ish import dals
from ._vendor.auxlib.type_coercion import boolify
from .base.constants import PathConflict, SafetyChecks
-from .common.compat import ensure_text_type, input, iteritems, iterkeys, on_win, string_types
+from .common.compat import ensure_text_type, input, iteritems, iterkeys, on_win, string_types, PY2
from .common.io import timeout
from .common.signals import get_signal_name
from .common.url import maybe_unquote
@@ -656,6 +656,25 @@ def __init__(self, invalid_spec):
super(InvalidVersionSpecError, self).__init__(message, invalid_spec=invalid_spec)
+class EncodingError(CondaError):
+
+ def __init__(self, caused_by, **kwargs):
+ message = dals("""
+ A unicode encoding or decoding error has occurred.
+ Python 2 is the interpreter under which conda is running in your base environment.
+ Replacing your base environment with one having Python 3 may help resolve this issue.
+ If you still have a need for Python 2 environments, consider using 'conda create'
+ and 'conda activate'. For example:
+
+ $ conda create -n py2 python=2
+ $ conda activate py2
+
+ Error details: %r
+
+ """) % caused_by
+ super(EncodingError, self).__init__(message, caused_by=caused_by, **kwargs)
+
+
def maybe_raise(error, context):
if isinstance(error, CondaMultiError):
groups = groupby(lambda e: isinstance(e, ClobberError), error.errors)
@@ -752,6 +771,8 @@ def handle_exception(self, exc_val, exc_tb):
return 0
elif isinstance(exc_val, CondaError):
return self.handle_application_exception(exc_val, exc_tb)
+ elif isinstance(exc_val, UnicodeError) and PY2:
+ return self.handle_application_exception(EncodingError(exc_val), exc_tb)
elif isinstance(exc_val, KeyboardInterrupt):
self._print_conda_exception(CondaError("KeyboardInterrupt"), _format_exc())
return 1
| Suppress full stack trace for UnicodeEncodeError and UnicodeDecodeError in python 2
Decline to handle UnicodeEncodeError and UnicodeDecodeError when python2 is the interpreter under which conda is running.
If you encounter this problem, consider downloading Miniconda3 or Anaconda3.
| 2018-01-04T20:21:36 |
||
conda/conda | 6,652 | conda__conda-6652 | [
"6620"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -283,7 +283,8 @@ def build_activate(self, env_name_or_prefix):
def build_deactivate(self):
# query environment
old_conda_shlvl = int(os.getenv('CONDA_SHLVL', 0))
- if old_conda_shlvl <= 0:
+ old_conda_prefix = os.getenv('CONDA_PREFIX', None)
+ if old_conda_shlvl <= 0 or old_conda_prefix is None:
return {
'unset_vars': (),
'set_vars': {},
@@ -291,7 +292,6 @@ def build_deactivate(self):
'deactivate_scripts': (),
'activate_scripts': (),
}
- old_conda_prefix = os.environ['CONDA_PREFIX']
deactivate_scripts = self._get_deactivate_scripts(old_conda_prefix)
new_conda_shlvl = old_conda_shlvl - 1
@@ -548,12 +548,12 @@ def main(argv=None):
activator_args = argv[2:]
activator = Activator(shell, activator_args)
try:
- sys.stdout.write(activator.execute())
+ print(activator.execute(), end='')
return 0
except Exception as e:
from . import CondaError
if isinstance(e, CondaError):
- sys.stderr.write(text_type(e))
+ print(text_type(e), file=sys.stderr)
return e.return_code
else:
raise
| KeyError(u'CONDA_PREFIX',)
```
error: KeyError(u'CONDA_PREFIX',)
command: D:\Anaconda2\Scripts\conda shell.cmd.exe deactivate deactivate
user_agent: conda/4.4.4 requests/2.18.4 CPython/2.7.14 Windows/10 Windows/10.0.16299
_messageid: -9223372036842425555
_messagetime: 1514685063692 / 2017-12-30 19:51:03
Traceback (most recent call last):
File "D:\Anaconda2\lib\site-packages\conda\cli\main.py", line 111, in main
return activator_main()
File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 529, in main
sys.stdout.write(activator.execute())
File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 149, in execute
return getattr(self, self.command)()
File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 139, in deactivate
return self._finalize(self._yield_commands(self.build_deactivate()),
File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 288, in build_deactivate
old_conda_prefix = os.environ['CONDA_PREFIX']
File "D:\Anaconda2\lib\os.py", line 425, in __getitem__
return self.data[key.upper()]
KeyError: u'CONDA_PREFIX'
```
| 2018-01-04T20:35:44 |
||
conda/conda | 6,653 | conda__conda-6653 | [
"6624"
] | 4d963e1da043f3eb8b0430263a6185db134f33df | diff --git a/conda/common/io.py b/conda/common/io.py
--- a/conda/common/io.py
+++ b/conda/common/io.py
@@ -2,7 +2,8 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict
-from concurrent.futures import ThreadPoolExecutor
+from concurrent.futures import ThreadPoolExecutor, _base, as_completed
+from concurrent.futures.thread import _WorkItem
from contextlib import contextmanager
from enum import Enum
from errno import EPIPE, ESHUTDOWN
@@ -11,7 +12,6 @@
import json
import logging
from logging import CRITICAL, Formatter, NOTSET, StreamHandler, WARN, getLogger
-from math import floor
import os
from os.path import dirname, isdir, isfile, join
import signal
@@ -35,7 +35,7 @@
class CaptureTarget(Enum):
"""Constants used for contextmanager captured.
- Used similarily like the constants PIPE, STDOUT for stdlib's subprocess.Popen.
+ Used similarly like the constants PIPE, STDOUT for stdlib's subprocess.Popen.
"""
STRING = -1
STDOUT = -2
@@ -303,7 +303,6 @@ def spinner(message=None, enabled=True, json=False):
If False, usage is a no-op.
json (bool):
If True, will not output non-json to stdout.
-
"""
sp = Spinner(enabled)
exception_raised = False
@@ -390,21 +389,48 @@ def close(self):
self.enabled = False
-@contextmanager
-def backdown_thread_pool(max_workers=10):
- """Tries to create an executor with max_workers, but will back down ultimately to a single
- thread of the OS decides you can't have more than one.
- """
- try:
- yield ThreadPoolExecutor(max_workers)
- except RuntimeError as e: # pragma: no cover
- # RuntimeError is thrown if number of threads are limited by OS
- log.debug(repr(e))
- try:
- yield ThreadPoolExecutor(floor(max_workers / 2))
- except RuntimeError as e:
- log.debug(repr(e))
- yield ThreadPoolExecutor(1)
+class ThreadLimitedThreadPoolExecutor(ThreadPoolExecutor):
+
+ def __init__(self, max_workers=10):
+ super(ThreadLimitedThreadPoolExecutor, self).__init__(max_workers)
+
+ def submit(self, fn, *args, **kwargs):
+ """
+ This is an exact reimplementation of the `submit()` method on the parent class, except
+ with an added `try/except` around `self._adjust_thread_count()`. So long as there is at
+ least one living thread, this thread pool will not throw an exception if threads cannot
+ be expanded to `max_workers`.
+
+ In the implementation, we use "protected" attributes from concurrent.futures (`_base`
+ and `_WorkItem`). Consider vendoring the whole concurrent.futures library
+ as an alternative to these protected imports.
+
+ https://github.com/agronholm/pythonfutures/blob/3.2.0/concurrent/futures/thread.py#L121-L131 # NOQA
+ https://github.com/python/cpython/blob/v3.6.4/Lib/concurrent/futures/thread.py#L114-L124
+ """
+ with self._shutdown_lock:
+ if self._shutdown:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._work_queue.put(w)
+ try:
+ self._adjust_thread_count()
+ except RuntimeError:
+ # RuntimeError: can't start new thread
+ # See https://github.com/conda/conda/issues/6624
+ if len(self._threads) > 0:
+ # It's ok to not be able to start new threads if we already have at least
+ # one thread alive.
+ pass
+ else:
+ raise
+ return f
+
+
+as_completed = as_completed # anchored here for import by other modules
class ContextDecorator(object):
@@ -427,6 +453,7 @@ def __enter__(self):
enabled = os.environ.get('CONDA_INSTRUMENTATION_ENABLED')
if enabled and boolify(enabled):
self.start_time = time()
+ return self
def __exit__(self, exc_type, exc_val, exc_tb):
if self.start_time:
diff --git a/conda/core/index.py b/conda/core/index.py
--- a/conda/core/index.py
+++ b/conda/core/index.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
-from concurrent.futures import as_completed
from itertools import chain
from logging import getLogger
@@ -11,7 +10,7 @@
from .._vendor.boltons.setutils import IndexedSet
from ..base.context import context
from ..common.compat import iteritems, itervalues
-from ..common.io import backdown_thread_pool, time_recorder
+from ..common.io import ThreadLimitedThreadPoolExecutor, as_completed, time_recorder
from ..exceptions import OperationNotAllowed
from ..models.channel import Channel, all_channel_urls
from ..models.dist import Dist
@@ -162,7 +161,7 @@ def get_reduced_index(prefix, channels, subdirs, specs):
# keep_specs.append(spec)
# consolidated_specs.update(keep_specs)
- with backdown_thread_pool() as executor:
+ with ThreadLimitedThreadPoolExecutor() as executor:
channel_urls = all_channel_urls(channels, subdirs=subdirs)
check_whitelist(channel_urls)
diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -23,6 +23,7 @@
from ..base.context import context
from ..common.compat import (ensure_binary, ensure_text_type, ensure_unicode, text_type,
with_metaclass)
+from ..common.io import ThreadLimitedThreadPoolExecutor, as_completed
from ..common.url import join_url, maybe_unquote
from ..core.package_cache import PackageCache
from ..exceptions import CondaDependencyError, CondaHTTPError, CondaIndexError, NotWritableError
@@ -75,23 +76,14 @@ class SubdirData(object):
@staticmethod
def query_all(channels, subdirs, package_ref_or_match_spec):
+ from .index import check_whitelist # TODO: fix in-line import
channel_urls = all_channel_urls(channels, subdirs=subdirs)
-
- executor = None
- try:
- from concurrent.futures import ThreadPoolExecutor, as_completed
- executor = ThreadPoolExecutor(10)
+ check_whitelist(channel_urls)
+ with ThreadLimitedThreadPoolExecutor() as executor:
futures = (executor.submit(
SubdirData(Channel(url)).query, package_ref_or_match_spec
) for url in channel_urls)
return tuple(concat(future.result() for future in as_completed(futures)))
- except RuntimeError as e: # pragma: no cover
- # concurrent.futures is only available in Python >= 3.2 or if futures is installed
- # RuntimeError is thrown if number of threads are limited by OS
- raise
- finally:
- if executor:
- executor.shutdown(wait=True)
def query(self, package_ref_or_match_spec):
if not self._loaded:
| RuntimeError: can't start new thread
```
error: RuntimeError("generator didn't stop after throw()",)
command: /home/mholekev/miniconda3/bin/conda install --yes numpy scipy matplotlib jupyter git pandas
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.3 Linux/2.6.32-696.10.3.el6.x86_64 centos/6.7 glibc/2.12
_messageid: -9223372036842075552
_messagetime: 1514766990662 / 2017-12-31 18:36:30
Traceback (most recent call last):
File "/home/mholekev/miniconda3/lib/python3.6/site-packages/conda/common/io.py", line 399, in backdown_thread_pool
yield ThreadPoolExecutor(max_workers)
File "/home/mholekev/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 214, in get_reduced_index
new_records = query_all(spec)
File "/home/mholekev/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 187, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/home/mholekev/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 187, in <genexpr>
return tuple(concat(future.result() for future in as_completed(futures)))
File "/home/mholekev/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 217, in as_completed
fs = set(fs)
File "/home/mholekev/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 186, in <genexpr>
futures = (executor.submit(sd.query, spec) for sd in subdir_datas)
File "/home/mholekev/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/mholekev/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/mholekev/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
```
| ```
error: RuntimeError("can't start new thread",)
command: /ahg/regevdata/users/subraman/software/miniconda3/bin/conda create -n test
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.3 Linux/2.6.32-696.16.1.el6.x86_64 rhel/6.9 glibc/2.12
_messageid: -9223372036842425559
_messagetime: 1514681157023 / 2017-12-30 18:45:57
Traceback (most recent call last):
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/cli/main_create.py", line 11, in execute
install(args, parser, 'create')
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
force_reinstall=context.force,
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 514, in solve_for_transaction
SubdirData.query_all(self.channels, self.subdirs, conda_newer_spec),
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 88, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 88, in <genexpr>
return tuple(concat(future.result() for future in as_completed(futures)))
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 217, in as_completed
fs = set(fs)
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", line 87, in <genexpr>
) for url in channel_urls)
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/ahg/regevdata/users/subraman/software/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
``` | 2018-01-04T21:02:35 |
|
conda/conda | 6,655 | conda__conda-6655 | [
"6627"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -413,24 +413,30 @@ def _replace_prefix_in_path(self, old_prefix, new_prefix, starting_path_dirs=Non
else:
path_list = list(starting_path_dirs)
if on_win: # pragma: unix no cover
- # windows has a nasty habit of adding extra Library\bin directories
- prefix_dirs = tuple(self._get_path_dirs(old_prefix))
- try:
- first_idx = path_list.index(prefix_dirs[0])
- except ValueError:
- first_idx = 0
+ if old_prefix is not None:
+ # windows has a nasty habit of adding extra Library\bin directories
+ prefix_dirs = tuple(self._get_path_dirs(old_prefix))
+ try:
+ first_idx = path_list.index(prefix_dirs[0])
+ except ValueError:
+ first_idx = 0
+ else:
+ last_idx = path_list.index(prefix_dirs[-1])
+ del path_list[first_idx:last_idx+1]
else:
- last_idx = path_list.index(prefix_dirs[-1])
- del path_list[first_idx:last_idx+1]
+ first_idx = 0
if new_prefix is not None:
path_list[first_idx:first_idx] = list(self._get_path_dirs(new_prefix))
else:
- try:
- idx = path_list.index(join(old_prefix, 'bin'))
- except ValueError:
- idx = 0
+ if old_prefix is not None:
+ try:
+ idx = path_list.index(join(old_prefix, 'bin'))
+ except ValueError:
+ idx = 0
+ else:
+ del path_list[idx]
else:
- del path_list[idx]
+ idx = 0
if new_prefix is not None:
path_list.insert(idx, join(new_prefix, 'bin'))
return self.path_conversion(path_list)
| AttributeError: 'NoneType' object has no attribute 'endswith'
```
error: AttributeError("'NoneType' object has no attribute 'endswith'",)
command: /home/wang/anaconda2/bin/conda shell.posix activate py2
user_agent: conda/4.4.4 requests/2.18.4 CPython/2.7.13 Linux/3.19.0-42-generic ubuntu/14.04 glibc/2.19
_messageid: -9223372036842325539
_messagetime: 1514696872936 / 2017-12-30 23:07:52
Traceback (most recent call last):
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 111, in main
return activator_main()
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/activate.py", line 529, in main
sys.stdout.write(activator.execute())
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/activate.py", line 149, in execute
return getattr(self, self.command)()
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/activate.py", line 135, in activate
return self._finalize(self._yield_commands(self.build_activate(self.env_name_or_prefix)),
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/activate.py", line 247, in build_activate
new_path = self.pathsep_join(self._replace_prefix_in_path(old_conda_prefix, prefix))
File "/home/wang/anaconda2/lib/python2.7/site-packages/conda/activate.py", line 411, in _replace_prefix_in_path
idx = path_list.index(join(old_prefix, 'bin'))
File "/home/wang/anaconda2/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
```
| 2018-01-04T21:22:38 |
||
conda/conda | 6,656 | conda__conda-6656 | [
"6629"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -968,6 +968,14 @@ def determine_target_prefix(ctx, args=None):
except AttributeError:
prefix_path = None
+ if prefix_name is not None and not prefix_name.strip(): # pragma: no cover
+ from ..exceptions import ArgumentError
+ raise ArgumentError("Argument --name requires a value.")
+
+ if prefix_path is not None and not prefix_path.strip(): # pragma: no cover
+ from ..exceptions import ArgumentError
+ raise ArgumentError("Argument --prefix requires a value.")
+
if prefix_name is None and prefix_path is None:
return ctx.default_prefix
elif prefix_path is not None:
| conda update --name AssertionError
```
error: AssertionError()
command: /Users/cpthgli/.anyenv/envs/pyenv/versions/default/bin/conda update --name --all --yes
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.4 Darwin/17.3.0 OSX/10.13.2
_messageid: -9223372036843525540
_messagetime: 1514462637935 / 2017-12-28 06:03:57
Traceback (most recent call last):
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/main_update.py", line 14, in execute
install(args, parser, 'update')
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/install.py", line 140, in install
prefix = context.target_prefix
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 454, in target_prefix
return determine_target_prefix(self)
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 974, in determine_target_prefix
return locate_prefix_by_name(prefix_name)
File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 923, in locate_prefix_by_name
assert name
AssertionError
```
| 2018-01-04T21:31:32 |
||
conda/conda | 6,657 | conda__conda-6657 | [
"6630"
] | 114e4b3cfb0fae3d566fd08a0c0c1d7e24c19891 | diff --git a/conda/core/repodata.py b/conda/core/repodata.py
--- a/conda/core/repodata.py
+++ b/conda/core/repodata.py
@@ -10,7 +10,6 @@
import json
from logging import DEBUG, getLogger
from mmap import ACCESS_READ, mmap
-from os import makedirs
from os.path import dirname, isdir, join, splitext
import re
from textwrap import dedent
@@ -30,7 +29,7 @@
from ..gateways.connection import (ConnectionError, HTTPError, InsecureRequestWarning,
InvalidSchema, SSLError)
from ..gateways.connection.session import CondaSession
-from ..gateways.disk import mkdir_p
+from ..gateways.disk import mkdir_p, mkdir_p_sudo_safe
from ..gateways.disk.delete import rm_rf
from ..gateways.disk.update import touch
from ..models.channel import Channel, all_channel_urls
@@ -640,8 +639,5 @@ def add_http_value_to_dict(resp, http_key, d, dict_key):
def create_cache_dir():
cache_dir = join(PackageCache.first_writable(context.pkgs_dirs).pkgs_dir, 'cache')
- try:
- makedirs(cache_dir)
- except OSError:
- pass
+ mkdir_p_sudo_safe(cache_dir)
return cache_dir
| repodata AssertionError
```
error: AssertionError()
command: /opt/intel/intelpython3/bin/conda update --all -y
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.3 Linux/4.9.49-moby debian/9 glibc/2.24
_messageid: -9223372036843625573
_messagetime: 1514424955743 / 2017-12-27 19:35:55
Traceback (most recent call last):
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/repodata.py", line 211, in _load
mod_etag_headers.get('_mod'))
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/repodata.py", line 411, in fetch_repodata_remote_request
raise Response304ContentUnchanged()
conda.core.repodata.Response304ContentUnchanged
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/cli/main_update.py", line 14, in execute
install(args, parser, 'update')
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
force_reinstall=context.force,
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
force_remove, force_reinstall)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/solve.py", line 178, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/solve.py", line 560, in _prepare
self.subdirs, prepared_specs)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/index.py", line 214, in get_reduced_index
new_records = query_all(spec)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/index.py", line 187, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/repodata.py", line 99, in query
self.load()
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/repodata.py", line 143, in load
_internal_state = self._load()
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/core/repodata.py", line 215, in _load
touch(self.cache_path_json)
File "/opt/intel/intelpython3/lib/python3.6/site-packages/conda/gateways/disk/update.py", line 80, in touch
assert isdir(dirname(path))
AssertionError
```
| 2018-01-04T21:37:05 |
||
conda/conda | 6,662 | conda__conda-6662 | [
"6661"
] | 5b60e3d0acdbd7900c6965f74ba0620c370adda9 | 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
@@ -11,6 +11,7 @@
from .install import handle_txn
from ..base.context import context
from ..common.compat import iteritems, iterkeys
+from ..core.envs_manager import unregister_env
from ..core.linked_data import linked_data
from ..core.solve import Solver
from ..exceptions import CondaEnvironmentError, CondaValueError
@@ -63,6 +64,7 @@ def execute(args, parser):
if not context.json:
confirm_yn()
rm_rf(prefix)
+ unregister_env(prefix)
if context.json:
stdout_json({
| Conda remove doesn't update environments.txt
conda 4.4.6
I'm using `conda remove -p (envPath) --all -y`. The folder gets deleted but the environments.txt file is not updated.
| 2018-01-05T01:49:39 |
||
conda/conda | 6,668 | conda__conda-6668 | [
"6665"
] | 83ef15f512e483e2186912271d18ce84b3a61932 | diff --git a/conda/models/dist.py b/conda/models/dist.py
--- a/conda/models/dist.py
+++ b/conda/models/dist.py
@@ -147,7 +147,7 @@ def from_string(cls, string, channel_override=NULL):
if channel_override != NULL:
channel = channel_override
- elif channel is None:
+ if channel is None:
channel = UNKNOWN_CHANNEL
# enforce dist format
| Installation of local packages breaks conda 4.4.6
Not sure whether this is a duplicate of https://github.com/conda/conda/issues/6621
Apparently, installing local packages (such as `conda install <path-to-pkg.tar.bz2>`) breaks the conda environment with conda 4.4.6. Consider the following script that
1. installs dask from the remote servers,
2. uninstalls it and
3. installs it again from the local, downloaded package.
```bash
# install and activate miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate root
conda update conda -y
# install dask from remote servers
conda install dask -y
# now we uninstall dask and install it again from the file
conda uninstall dask --force -y
conda install ~/miniconda/pkgs/dask-0.*.tar.bz2
# now install any other package, e.g. anaconda-client
conda install anaconda-client # fails!
```
The output of the last command is
```
Solving environment: failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
force_reinstall=context.force,
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
force_remove, force_reinstall)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 407, in solve_final_state
return IndexedSet(index[d] for d in solution)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/_vendor/boltons/setutils.py", line 90, in __init__
self.update(other)
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/_vendor/boltons/setutils.py", line 304, in update
for o in other:
File "/mnt/data/home/psommer/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 407, in <genexpr>
return IndexedSet(index[d] for d in solution)
KeyError: Dist(channel='<unknown>', dist_name='dask-0.16.0-py36h73d177f_0', name='dask', version='0.16.0', build_string='py36h73d177f_0', build_number=0, base_url=None, platform=None)
`$ /mnt/data/home/psommer/miniconda/bin/conda install anaconda-client`
environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=root
CONDA_PATH_BACKUP=/mnt/data/home/psommer/bin:/mnt/data/home/psommer/.local/bin:/usr/loca
l/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lo
cal/games:/snap/bin
CONDA_PREFIX=/mnt/data/home/psommer/miniconda
CONDA_PS1_BACKUP=
CONDA_ROOT=/mnt/data/home/psommer/miniconda
PATH=/mnt/data/home/psommer/miniconda/bin:/mnt/data/home/psommer/bin:/mnt/d
ata/home/psommer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/
usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
active environment : base
active env location : /mnt/data/home/psommer/miniconda
user config file : /mnt/data/home/psommer/.condarc
populated config files :
conda version : 4.4.6
conda-build version : not installed
python version : 3.6.3.final.0
base environment : /mnt/data/home/psommer/miniconda (writable)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/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
package cache : /mnt/data/home/psommer/miniconda/pkgs
/mnt/data/home/psommer/.conda/pkgs
envs directories : /mnt/data/home/psommer/miniconda/envs
/mnt/data/home/psommer/.conda/envs
platform : linux-64
user-agent : conda/4.4.6 requests/2.18.4 CPython/3.6.3 Linux/4.4.0-104-generic ubuntu/16.04 glibc/2.23
UID:GID : 1042:1025
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
```
I also tried it with other packages independent of dask. Additionally it is unimportant which package I used for the last install command (here `conda install anaconda-client`). It always fails.
| Thank you for the report! I didn't understand how #6621 was coming about. The extra detail is exactly what I needed. Very much appreciate it.
You're welcome! Thanks a lot for your work here!! | 2018-01-05T20:35:17 |
|
conda/conda | 6,669 | conda__conda-6669 | [
"6667",
"6667"
] | 31a52a8a8771aafb0582822dd2e00b3274e1ffba | diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -57,10 +57,10 @@ def __init__(self, shell, arguments=None):
self.shift_args = 0
self.command_join = '\n'
- self.unset_var_tmpl = 'unset %s'
- self.export_var_tmpl = "export %s='%s'"
+ self.unset_var_tmpl = '\\unset %s'
+ self.export_var_tmpl = "\\export %s='%s'"
self.set_var_tmpl = "%s='%s'"
- self.run_script_tmpl = '. "%s"'
+ self.run_script_tmpl = '\\. "%s"'
elif shell == 'csh':
self.pathsep_join = ':'.join
| diff --git a/tests/cli/test_activate.py b/tests/cli/test_activate.py
--- a/tests/cli/test_activate.py
+++ b/tests/cli/test_activate.py
@@ -137,12 +137,18 @@ def _format_vars(shell):
{set} CONDARC=
{set} CONDA_PATH_BACKUP=
{set} PATH="{new_path}"
+{set} _CONDA_ROOT="{shellpath}"
"""
if 'bash' in shell:
_command_setup += "set -u\n"
- command_setup = _command_setup.format(here=dirname(__file__), PYTHONPATH=shelldict['path_to'](PYTHONPATH),
- set=shelldict["set_var"], new_path=base_path)
+ command_setup = _command_setup.format(
+ here=dirname(__file__),
+ PYTHONPATH=shelldict['path_to'](PYTHONPATH),
+ set=shelldict["set_var"],
+ new_path=base_path,
+ shellpath=join(dirname(CONDA_PACKAGE_ROOT), 'conda', 'shell')
+ )
if shelldict["shell_suffix"] == '.bat':
command_setup = "@echo off\n" + command_setup
@@ -342,51 +348,6 @@ def test_wrong_args(shell):
assert_equals(stdout, shell_vars['base_path'], stderr)
[email protected]
-def test_activate_help(shell):
- shell_vars = _format_vars(shell)
- with TemporaryDirectory(prefix=ENVS_PREFIX, dir=dirname(__file__)) as envs:
- if shell not in ['powershell.exe', 'cmd.exe']:
- commands = (shell_vars['command_setup'] + """
- "{syspath}{binpath}activate" Zanzibar
- """).format(envs=envs, **shell_vars)
- stdout, stderr = run_in(commands, shell)
- assert_equals(stdout, '')
- assert_in("activate must be sourced", stderr)
- # assert_in("Usage: source activate ENV", stderr)
-
- commands = (shell_vars['command_setup'] + """
- {source} "{syspath}{binpath}activate" --help
- """).format(envs=envs, **shell_vars)
-
- stdout, stderr = run_in(commands, shell)
- assert_equals(stdout, '')
-
- if shell in ["cmd.exe", "powershell"]:
- # assert_in("Usage: activate ENV", stderr)
- pass
- else:
- # assert_in("Usage: source activate ENV", stderr)
-
- commands = (shell_vars['command_setup'] + """
- {syspath}{binpath}deactivate
- """).format(envs=envs, **shell_vars)
- stdout, stderr = run_in(commands, shell)
- assert_equals(stdout, '')
- assert_in("deactivate must be sourced", stderr)
- # assert_in("Usage: source deactivate", stderr)
-
- commands = (shell_vars['command_setup'] + """
- {source} {syspath}{binpath}deactivate --help
- """).format(envs=envs, **shell_vars)
- stdout, stderr = run_in(commands, shell)
- assert_equals(stdout, '')
- # if shell in ["cmd.exe", "powershell"]:
- # assert_in("Usage: deactivate", stderr)
- # else:
- # assert_in("Usage: source deactivate", stderr)
-
-
@pytest.mark.installed
def test_PS1_changeps1(shell): # , bash_profile
shell_vars = _format_vars(shell)
diff --git a/tests/test_activate.py b/tests/test_activate.py
--- a/tests/test_activate.py
+++ b/tests/test_activate.py
@@ -459,13 +459,13 @@ def test_posix_basic(self):
new_path_parts = activator._add_prefix_to_path(self.prefix)
assert activate_data == dals("""
PS1='%(ps1)s'
- export CONDA_DEFAULT_ENV='%(native_prefix)s'
- export CONDA_PREFIX='%(native_prefix)s'
- export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
- export CONDA_PYTHON_EXE='%(sys_executable)s'
- export CONDA_SHLVL='1'
- export PATH='%(new_path)s'
- . "%(activate1)s"
+ \\export CONDA_DEFAULT_ENV='%(native_prefix)s'
+ \\export CONDA_PREFIX='%(native_prefix)s'
+ \\export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
+ \\export CONDA_PYTHON_EXE='%(sys_executable)s'
+ \\export CONDA_SHLVL='1'
+ \\export PATH='%(new_path)s'
+ \\. "%(activate1)s"
""") % {
'converted_prefix': activator.path_conversion(self.prefix),
'native_prefix': self.prefix,
@@ -489,12 +489,12 @@ def test_posix_basic(self):
new_path_parts = activator._replace_prefix_in_path(self.prefix, self.prefix)
assert reactivate_data == dals("""
- . "%(deactivate1)s"
+ \\. "%(deactivate1)s"
PS1='%(ps1)s'
- export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
- export CONDA_SHLVL='1'
- export PATH='%(new_path)s'
- . "%(activate1)s"
+ \\export CONDA_PROMPT_MODIFIER='(%(native_prefix)s) '
+ \\export CONDA_SHLVL='1'
+ \\export PATH='%(new_path)s'
+ \\. "%(activate1)s"
""") % {
'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.sh')),
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.sh')),
@@ -511,14 +511,14 @@ def test_posix_basic(self):
new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix))
assert deactivate_data == dals("""
- . "%(deactivate1)s"
- unset CONDA_DEFAULT_ENV
- unset CONDA_PREFIX
- unset CONDA_PROMPT_MODIFIER
- unset CONDA_PYTHON_EXE
+ \\. "%(deactivate1)s"
+ \\unset CONDA_DEFAULT_ENV
+ \\unset CONDA_PREFIX
+ \\unset CONDA_PROMPT_MODIFIER
+ \\unset CONDA_PYTHON_EXE
PS1='%(ps1)s'
- export CONDA_SHLVL='0'
- export PATH='%(new_path)s'
+ \\export CONDA_SHLVL='0'
+ \\export PATH='%(new_path)s'
""") % {
'new_path': new_path,
'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.sh')),
| Source activation for anaconda python environments no longer working (Mac)
The source activate command in conda is suddenly no longer working for me. When I type `source activate py3` in my Mac terminal, I get this error `-bash: _conda_activate: command not found`.
I recently created a new conda environment for TabPy (Tableau python server); I'm not sure if that changed anything. I have checked that the conda environments I'm trying to activate exist by using `conda info --envs`, here is that output:
```
# conda environments:
#
base * /Users/applemacbook/anaconda
Tableau-Python-Server /Users/applemacbook/anaconda/envs/Tableau-Python
Server
py3 /Users/applemacbook/anaconda/envs/py3
```
I already have the following in my bash profile from my initial installation of anaconda awhile ago `export PATH="/Users/applemacbook/anaconda/bin:$PATH"`.
Here is some additional information: The output of `which conda` is `/Users/applemacbook/anaconda/bin/conda`. The output of `type source` is `source is a shell builtin`. The output of `which activate` is `/Users/applemacbook/anaconda/bin/activate`. My conda version is conda 4.4.6
Source activation for anaconda python environments no longer working (Mac)
The source activate command in conda is suddenly no longer working for me. When I type `source activate py3` in my Mac terminal, I get this error `-bash: _conda_activate: command not found`.
I recently created a new conda environment for TabPy (Tableau python server); I'm not sure if that changed anything. I have checked that the conda environments I'm trying to activate exist by using `conda info --envs`, here is that output:
```
# conda environments:
#
base * /Users/applemacbook/anaconda
Tableau-Python-Server /Users/applemacbook/anaconda/envs/Tableau-Python
Server
py3 /Users/applemacbook/anaconda/envs/py3
```
I already have the following in my bash profile from my initial installation of anaconda awhile ago `export PATH="/Users/applemacbook/anaconda/bin:$PATH"`.
Here is some additional information: The output of `which conda` is `/Users/applemacbook/anaconda/bin/conda`. The output of `type source` is `source is a shell builtin`. The output of `which activate` is `/Users/applemacbook/anaconda/bin/activate`. My conda version is conda 4.4.6
| Guessing this is a duplicate of https://github.com/conda/conda/issues/6639?
Maybe not. Could you open a new terminal, and then give me the output of
env | sort
set -x
source activate py3
You'll want to close the terminal down after you do the above. Or
set +x
to get things back to normal.
Also, can you give me the output of
cat /Users/applemacbook/anaconda/bin/activate
Edited by moderator. Output given fixed-width below.
Alright, I think I've got all the outputs you asked for below:
```
$ env | sort
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.XLbN3qRfIV/Render
CDPATH=.:/Users/applemacbook:/Users/applemacbook/Documents/Galvanize:/Users/applemacbook/Documents/Galvanize/immersive:/Users/applemacbook/Documents:
COLORFGBG=7;0
COLORTERM=truecolor
EDITOR=emacs
HADOOP_HOME=/usr/local/hadoop
HOME=/Users/applemacbook
ITERM_PROFILE=Default
ITERM_SESSION_ID=w0t3p0:1061674E-3BF3-4203-A297-44BAC655F9A4
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
LANG=en_US.UTF-8
LOGNAME=applemacbook
PATH=/usr/local/spark/bin:/Users/applemacbook/anaconda/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PS1=$
PWD=/Users/applemacbook
PYTHONPATH=/usr/local/spark/python:
SHELL=/bin/bash
SHLVL=1
SPARK_HOME=/usr/local/spark
SPARK_LOCAL_IP=localhost
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.FwpsT72RUz/Listeners
TERM=xterm-256color
TERM_PROGRAM=iTerm.app
TERM_PROGRAM_VERSION=3.1.5
TERM_SESSION_ID=w0t3p0:1061674E-3BF3-4203-A297-44BAC655F9A4
TMPDIR=/var/folders/yp/3f96txfd1rj8m8k28xxbvpkh0000gn/T/
USER=applemacbook
VISUAL=emacs
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x0:0:0
$ set -x
+ set -x
$ source activate py3
+ source activate py3
++ _CONDA_ROOT=/Users/applemacbook/anaconda
++ _conda_script_is_sourced
++ sourced=0
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n x ']'
++ '[' /Users/applemacbook/anaconda/bin/activate = -bash ']'
++ return 0
++ _conda_set_vars
++ '[' -n x ']'
++ _CONDA_SHELL_FLAVOR=bash
++ local script_dir
++ case "$_CONDA_SHELL_FLAVOR" in
+++ dirname /Users/applemacbook/anaconda/bin/activate
++ script_dir=/Users/applemacbook/anaconda/bin
++ '[' -z x ']'
++ cd .. /Users/applemacbook/anaconda/etc/profile.d/conda.sh
++ _conda_activate py3
-bash: _conda_activate: command not found
$ cat /Users/applemacbook/anaconda/bin/activate
+ cat /Users/applemacbook/anaconda/bin/activate
#!/bin/sh
_CONDA_ROOT="/Users/applemacbook/anaconda"
#!/bin/sh
_conda_set_vars() {
# set _CONDA_SHELL_FLAVOR
if [ -n "${BASH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=bash
elif [ -n "${ZSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=zsh
elif [ -n "${KSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=ksh
elif [ -n "${POSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=posh
else
# https://unix.stackexchange.com/a/120138/92065
local _q="$(ps -p$$ -o cmd="",comm="",fname="" 2>/dev/null | sed
's/^-//' | grep -oE '\w+' | head -n1)"
if [ "$_q" = dash ]; then
_CONDA_SHELL_FLAVOR=dash
else
(>&2 echo "Unrecognized shell.")
return 1
fi
fi
#
https://unix.stackexchange.com/questions/4650/determining-path-to-sourced-shell-script/
local script_dir
case "$_CONDA_SHELL_FLAVOR" in
bash) script_dir="$(dirname "${BASH_SOURCE[0]}")";;
zsh) script_dir="$(dirname "${(%):-%x}")";; #
http://stackoverflow.com/a/28336473/2127762
dash) x=$(lsof -p $$ -Fn0 | tail -1); script_dir="$(dirname
"${x#n}")";;
*) script_dir="$(cd "$(dirname "$_")" && echo "$PWD")";;
esac
if [ -z "${_CONDA_ROOT+x}" ]; then
_CONDA_ROOT="$(dirname "$script_dir")"
fi
}
_conda_script_is_sourced() {
# http://stackoverflow.com/a/28776166/2127762
sourced=0
if [ -n "${ZSH_EVAL_CONTEXT:+x}" ]; then
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac
elif [ -n "${KSH_VERSION:+x}" ]; then
[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd
$(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ] &&
sourced=1
elif [ -n "${BASH_VERSION:+x}" ]; then
[ "${BASH_SOURCE[0]}" = "$0" ] && sourced=1
else # All other shells: examine $0 for known shell binary filenames
# Detects `sh` and `dash`; add additional shell filenames as needed.
case ${0##*/} in sh|dash) sourced=0;; *) sourced=1;; esac
fi
return $sourced
}
if ! _conda_script_is_sourced; then
(
>&2 echo "Error: activate must be sourced. Run 'source activate
envname'"
>&2 echo "instead of 'activate envname'."
)
exit 1
fi
_conda_set_vars
. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
_conda_activate "$@"
```
Comparing from above
```
++ script_dir=/Users/applemacbook/anaconda/bin
++ '[' -z x ']'
++ cd .. /Users/applemacbook/anaconda/etc/profile.d/conda.sh
++ _conda_activate py3
-bash: _conda_activate: command not found
```
to what I get myself
```
++ script_dir=/Users/kfranz/miniconda/bin
++ '[' -z x ']'
++ . /Users/kfranz/miniconda/etc/profile.d/conda.sh
+++ _CONDA_EXE=/Users/kfranz/miniconda/bin/conda
+++ _CONDA_ROOT=/Users/kfranz/miniconda
```
Guessing this is a duplicate of https://github.com/conda/conda/issues/6639?
Maybe not. Could you open a new terminal, and then give me the output of
env | sort
set -x
source activate py3
You'll want to close the terminal down after you do the above. Or
set +x
to get things back to normal.
Also, can you give me the output of
cat /Users/applemacbook/anaconda/bin/activate
Edited by moderator. Output given fixed-width below.
Alright, I think I've got all the outputs you asked for below:
```
$ env | sort
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.XLbN3qRfIV/Render
CDPATH=.:/Users/applemacbook:/Users/applemacbook/Documents/Galvanize:/Users/applemacbook/Documents/Galvanize/immersive:/Users/applemacbook/Documents:
COLORFGBG=7;0
COLORTERM=truecolor
EDITOR=emacs
HADOOP_HOME=/usr/local/hadoop
HOME=/Users/applemacbook
ITERM_PROFILE=Default
ITERM_SESSION_ID=w0t3p0:1061674E-3BF3-4203-A297-44BAC655F9A4
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
LANG=en_US.UTF-8
LOGNAME=applemacbook
PATH=/usr/local/spark/bin:/Users/applemacbook/anaconda/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PS1=$
PWD=/Users/applemacbook
PYTHONPATH=/usr/local/spark/python:
SHELL=/bin/bash
SHLVL=1
SPARK_HOME=/usr/local/spark
SPARK_LOCAL_IP=localhost
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.FwpsT72RUz/Listeners
TERM=xterm-256color
TERM_PROGRAM=iTerm.app
TERM_PROGRAM_VERSION=3.1.5
TERM_SESSION_ID=w0t3p0:1061674E-3BF3-4203-A297-44BAC655F9A4
TMPDIR=/var/folders/yp/3f96txfd1rj8m8k28xxbvpkh0000gn/T/
USER=applemacbook
VISUAL=emacs
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x0:0:0
$ set -x
+ set -x
$ source activate py3
+ source activate py3
++ _CONDA_ROOT=/Users/applemacbook/anaconda
++ _conda_script_is_sourced
++ sourced=0
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n x ']'
++ '[' /Users/applemacbook/anaconda/bin/activate = -bash ']'
++ return 0
++ _conda_set_vars
++ '[' -n x ']'
++ _CONDA_SHELL_FLAVOR=bash
++ local script_dir
++ case "$_CONDA_SHELL_FLAVOR" in
+++ dirname /Users/applemacbook/anaconda/bin/activate
++ script_dir=/Users/applemacbook/anaconda/bin
++ '[' -z x ']'
++ cd .. /Users/applemacbook/anaconda/etc/profile.d/conda.sh
++ _conda_activate py3
-bash: _conda_activate: command not found
$ cat /Users/applemacbook/anaconda/bin/activate
+ cat /Users/applemacbook/anaconda/bin/activate
#!/bin/sh
_CONDA_ROOT="/Users/applemacbook/anaconda"
#!/bin/sh
_conda_set_vars() {
# set _CONDA_SHELL_FLAVOR
if [ -n "${BASH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=bash
elif [ -n "${ZSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=zsh
elif [ -n "${KSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=ksh
elif [ -n "${POSH_VERSION:+x}" ]; then
_CONDA_SHELL_FLAVOR=posh
else
# https://unix.stackexchange.com/a/120138/92065
local _q="$(ps -p$$ -o cmd="",comm="",fname="" 2>/dev/null | sed
's/^-//' | grep -oE '\w+' | head -n1)"
if [ "$_q" = dash ]; then
_CONDA_SHELL_FLAVOR=dash
else
(>&2 echo "Unrecognized shell.")
return 1
fi
fi
#
https://unix.stackexchange.com/questions/4650/determining-path-to-sourced-shell-script/
local script_dir
case "$_CONDA_SHELL_FLAVOR" in
bash) script_dir="$(dirname "${BASH_SOURCE[0]}")";;
zsh) script_dir="$(dirname "${(%):-%x}")";; #
http://stackoverflow.com/a/28336473/2127762
dash) x=$(lsof -p $$ -Fn0 | tail -1); script_dir="$(dirname
"${x#n}")";;
*) script_dir="$(cd "$(dirname "$_")" && echo "$PWD")";;
esac
if [ -z "${_CONDA_ROOT+x}" ]; then
_CONDA_ROOT="$(dirname "$script_dir")"
fi
}
_conda_script_is_sourced() {
# http://stackoverflow.com/a/28776166/2127762
sourced=0
if [ -n "${ZSH_EVAL_CONTEXT:+x}" ]; then
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac
elif [ -n "${KSH_VERSION:+x}" ]; then
[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd
$(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ] &&
sourced=1
elif [ -n "${BASH_VERSION:+x}" ]; then
[ "${BASH_SOURCE[0]}" = "$0" ] && sourced=1
else # All other shells: examine $0 for known shell binary filenames
# Detects `sh` and `dash`; add additional shell filenames as needed.
case ${0##*/} in sh|dash) sourced=0;; *) sourced=1;; esac
fi
return $sourced
}
if ! _conda_script_is_sourced; then
(
>&2 echo "Error: activate must be sourced. Run 'source activate
envname'"
>&2 echo "instead of 'activate envname'."
)
exit 1
fi
_conda_set_vars
. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
_conda_activate "$@"
```
Comparing from above
```
++ script_dir=/Users/applemacbook/anaconda/bin
++ '[' -z x ']'
++ cd .. /Users/applemacbook/anaconda/etc/profile.d/conda.sh
++ _conda_activate py3
-bash: _conda_activate: command not found
```
to what I get myself
```
++ script_dir=/Users/kfranz/miniconda/bin
++ '[' -z x ']'
++ . /Users/kfranz/miniconda/etc/profile.d/conda.sh
+++ _CONDA_EXE=/Users/kfranz/miniconda/bin/conda
+++ _CONDA_ROOT=/Users/kfranz/miniconda
``` | 2018-01-05T20:59:02 |
conda/conda | 6,671 | conda__conda-6671 | [
"6659"
] | 0ea3086ca52deacb09c6e45c79165e32e751be27 | 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
@@ -11,7 +11,7 @@
from ..base.constants import DEFAULTS_CHANNEL_NAME, UNKNOWN_CHANNEL
from ..base.context import context
from ..common.compat import text_type
-from ..core.linked_data import is_linked, linked, linked_data
+from ..core.linked_data import PrefixData, is_linked, linked
from ..egg_info import get_egg_info
from ..gateways.disk.test import is_conda_environment
from ..history import History
@@ -101,12 +101,12 @@ def print_explicit(prefix, add_md5=False):
raise EnvironmentLocationNotFound(prefix)
print_export_header(context.subdir)
print("@EXPLICIT")
- for meta in sorted(linked_data(prefix).values(), key=lambda x: x['name']):
- url = meta.get('url')
+ for prefix_record in PrefixData(prefix).iter_records_sorted():
+ url = prefix_record.get('url')
if not url or url.startswith(UNKNOWN_CHANNEL):
- print('# no URL for: %s' % meta['fn'])
+ print('# no URL for: %s' % prefix_record['fn'])
continue
- md5 = meta.get('md5')
+ md5 = prefix_record.get('md5')
print(url + ('#%s' % md5 if add_md5 and md5 else ''))
diff --git a/conda/core/linked_data.py b/conda/core/linked_data.py
--- a/conda/core/linked_data.py
+++ b/conda/core/linked_data.py
@@ -89,6 +89,13 @@ def get(self, package_name, default=NULL):
def iter_records(self):
return itervalues(self._prefix_records)
+ def iter_records_sorted(self):
+ from ..resolve import Resolve
+ index = {Dist(rec): rec for rec in self.iter_records()}
+ r = Resolve(index)
+ sorted_dists = r.dependency_sort({d.name: d for d in index})
+ return (index[d] for d in sorted_dists)
+
def all_subdir_urls(self):
subdir_urls = set()
for prefix_record in itervalues(self._prefix_records):
| Python missing when installing a noarch package from explicit environment file
Hello!
We're running into a really strange issue with `conda 4.4.6` (and previously with `conda 4.4.0`).
We usually provide installation instructions for our software using `conda install --file` which works really well for our users. But for one particular package, `html5lib` on `conda-forge`, It appears that the `.pyc` compile step of installing a noarch package is happening before python is actually installed in the environment causing the entire transaction to fail.
Here's a bit more info from my debugging:
This happens in Python 3.5 and 3.6
This does not occur with `conda 4.3.31`.
This happens on both linux and osx as far as we can tell.
Our usual environment files are really large, but I was able to reproduce the problem with the following:
```
§ conda create -n html5 -c conda-forge html5lib
```
<details>
<summary>output</summary>
```
Solving environment: done
## Package Plan ##
environment location: /home/evan/.conda/envs/html5
added / updated specs:
- html5lib
The following NEW packages will be INSTALLED:
ca-certificates: 2017.11.5-0 conda-forge
certifi: 2017.11.5-py36_0 conda-forge
html5lib: 1.0.1-py_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2n-0 conda-forge
pip: 9.0.1-py36_1 conda-forge
python: 3.6.4-0 conda-forge
readline: 7.0-0 conda-forge
setuptools: 38.2.4-py36_0 conda-forge
six: 1.11.0-py36_1 conda-forge
sqlite: 3.20.1-2 conda-forge
tk: 8.6.7-0 conda-forge
webencodings: 0.5-py36_0 conda-forge
wheel: 0.30.0-py_1 conda-forge
xz: 5.2.3-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)?
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate html5
#
# To deactivate an active environment, use:
# > source deactivate
#
```
</details>
```
§ source activate html5
§ conda list --explicit --export > env.txt
§ source deactivate
```
<details>
<summary> env.txt </summary>
```
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2017.11.5-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/certifi-2017.11.5-py36_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/html5lib-1.0.1-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ncurses-5.9-10.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/openssl-1.0.2n-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/pip-9.0.1-py36_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/python-3.6.4-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/readline-7.0-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/setuptools-38.2.4-py36_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/six-1.11.0-py36_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/sqlite-3.20.1-2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.7-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/webencodings-0.5-py36_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/wheel-0.30.0-py_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.3-0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/zlib-1.2.11-0.tar.bz2
```
</details>
```
§ conda create -n html5-copy --file env.txt -vv
```
<details>
<summary>verbose output</summary>
```
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 2
DEBUG conda.base.context:root_writable(358): [Errno 13] Permission denied: '/opt/Miniconda3/conda-meta/history'
DEBUG conda.base.context:root_writable(358): [Errno 13] Permission denied: '/opt/Miniconda3/conda-meta/history'
DEBUG conda.core.package_cache:_check_writable(226): package cache directory '/home/evan/.conda/pkgs' writable: True
DEBUG conda.core.package_cache:__init__(528): instantiating ProgressiveFetchExtract with
conda-forge/linux-64::ca-certificates==2017.11.5=0
conda-forge/linux-64::certifi==2017.11.5=py36_0
conda-forge/noarch::html5lib==1.0.1=py_0
conda-forge/linux-64::ncurses==5.9=10
conda-forge/linux-64::openssl==1.0.2n=0
conda-forge/linux-64::pip==9.0.1=py36_1
conda-forge/linux-64::python==3.6.4=0
conda-forge/linux-64::readline==7.0=0
conda-forge/linux-64::setuptools==38.2.4=py36_0
conda-forge/linux-64::six==1.11.0=py36_1
conda-forge/linux-64::sqlite==3.20.1=2
conda-forge/linux-64::tk==8.6.7=0
conda-forge/linux-64::webencodings==0.5=py36_0
conda-forge/noarch::wheel==0.30.0=py_1
conda-forge/linux-64::xz==5.2.3=0
conda-forge/linux-64::zlib==1.2.11=0
DEBUG conda.gateways.disk.test:file_path_is_writable(29): [Errno 13] Permission denied: '/opt/Miniconda3/pkgs/urls.txt'
DEBUG conda.core.package_cache:_check_writable(226): package cache directory '/opt/Miniconda3/pkgs' writable: False
DEBUG conda.core.package_cache:_check_writable(226): package cache directory '/home/evan/.conda/pkgs' writable: True
DEBUG conda.core.link:__init__(157): instantiating UnlinkLinkTransaction with
target_prefix: /home/evan/.conda/envs/html5-copy
unlink_precs:
link_precs:
conda-forge::ca-certificates-2017.11.5-0
conda-forge::certifi-2017.11.5-py36_0
conda-forge::html5lib-1.0.1-py_0
conda-forge::ncurses-5.9-10
conda-forge::openssl-1.0.2n-0
conda-forge::pip-9.0.1-py36_1
conda-forge::python-3.6.4-0
conda-forge::readline-7.0-0
conda-forge::setuptools-38.2.4-py36_0
conda-forge::six-1.11.0-py36_1
conda-forge::sqlite-3.20.1-2
conda-forge::tk-8.6.7-0
conda-forge::webencodings-0.5-py36_0
conda-forge::wheel-0.30.0-py_1
conda-forge::xz-5.2.3-0
conda-forge::zlib-1.2.11-0
Preparing transaction: ...working... DEBUG conda.core.link:get_python_version(598): found in current transaction python version 3.6.4
done
Verifying transaction: ...working... done
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGABRT
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGINT
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGTERM
DEBUG conda.common.signals:signal_handler(43): registering handler for SIGQUIT
Executing transaction: ...working... INFO conda.core.link:_execute_actions(527): ===> LINKING PACKAGE: conda-forge::ca-certificates-2017.11.5-0 <===
prefix=/home/evan/.conda/envs/html5-copy
source=/home/evan/.conda/pkgs/ca-certificates-2017.11.5-0
INFO conda.core.link:_execute_actions(527): ===> LINKING PACKAGE: conda-forge::certifi-2017.11.5-py36_0 <===
prefix=/home/evan/.conda/envs/html5-copy
source=/home/evan/.conda/pkgs/certifi-2017.11.5-py36_0
INFO conda.core.link:_execute_actions(527): ===> LINKING PACKAGE: conda-forge::html5lib-1.0.1-py_0 <===
prefix=/home/evan/.conda/envs/html5-copy
source=/home/evan/.conda/pkgs/html5lib-1.0.1-py_0
DEBUG conda.gateways.subprocess:subprocess_call(46): executing>> "/home/evan/.conda/envs/html5-copy/bin/python3.6" -Wi -m py_compile "/home/evan/.conda/envs/html5-copy/lib/python3.6/site-packages/html5lib/__init__.py"
DEBUG conda.core.link:_execute_actions(541): Error in action #48 for pkg_idx #2 CompilePycAction(target_prefix='/home/evan/.conda/envs/html5-copy', target_short_path='lib/python3.6/site-packages/html5lib/__pycache__/__init__.cpython-36.pyc', source_prefix='/home/evan/.conda/envs/html5-copy', source_short_path='lib/python3.6/site-packages/html5lib/__init__.py', prefix_path_data=PathDataV1(_path='lib/python3.6/site-packages/html5lib/__pycache__/__init__.cpython-36.pyc', path_type='pyc_file'), _execute_successful=False, _verified=True)
Traceback (most recent call last):
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 535, in _execute_actions
action.execute()
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/path_actions.py", line 523, in execute
compile_pyc(python_full_path, self.source_full_path, self.target_full_path)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 309, in compile_pyc
result = subprocess_call(command, raise_on_error=False)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/gateways/subprocess.py", line 47, in subprocess_call
p = Popen(command_arg, cwd=path, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env)
File "/opt/Miniconda3/lib/python3.6/subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "/opt/Miniconda3/lib/python3.6/subprocess.py", line 1326, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/evan/.conda/envs/html5-copy/bin/python3.6'
INFO conda.core.link:_reverse_actions(569): ===> REVERSING PACKAGE LINK: conda-forge::html5lib-1.0.1-py_0 <===
prefix=/home/evan/.conda/envs/html5-copy
DEBUG conda.core.link:_reverse_actions(571): reversing pkg_idx #2 from axn_idx #48
failed
ERROR conda.core.link:_execute(481): An error occurred while installing package 'conda-forge::html5lib-1.0.1-py_0'.
FileNotFoundError(2, "No such file or directory: '/home/evan/.conda/envs/html5-copy/bin/python3.6'")
Attempting to roll back.
Rolling back transaction: ...working... INFO conda.core.link:_reverse_actions(569): ===> REVERSING PACKAGE LINK: conda-forge::certifi-2017.11.5-py36_0 <===
prefix=/home/evan/.conda/envs/html5-copy
DEBUG conda.core.link:_reverse_actions(571): reversing pkg_idx #1 from axn_idx #-1
INFO conda.core.link:_reverse_actions(569): ===> REVERSING PACKAGE LINK: conda-forge::ca-certificates-2017.11.5-0 <===
prefix=/home/evan/.conda/envs/html5-copy
DEBUG conda.core.link:_reverse_actions(571): reversing pkg_idx #0 from axn_idx #-1
done
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGABRT
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGINT
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGTERM
DEBUG conda.common.signals:signal_handler(56): de-registering handler for Signals.SIGQUIT
Traceback (most recent call last):
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 535, in _execute_actions
action.execute()
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/path_actions.py", line 523, in execute
compile_pyc(python_full_path, self.source_full_path, self.target_full_path)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 309, in compile_pyc
result = subprocess_call(command, raise_on_error=False)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/gateways/subprocess.py", line 47, in subprocess_call
p = Popen(command_arg, cwd=path, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env)
File "/opt/Miniconda3/lib/python3.6/subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "/opt/Miniconda3/lib/python3.6/subprocess.py", line 1326, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/evan/.conda/envs/html5-copy/bin/python3.6'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 472, in _execute
cls._execute_actions(pkg_idx, axngroup)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 553, in _execute_actions
reverse_excs,
conda.CondaMultiError: [Errno 2] No such file or directory: '/home/evan/.conda/envs/html5-copy/bin/python3.6'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
return func(*args, **kwargs)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/cli/main_create.py", line 11, in execute
install(args, parser, 'create')
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 184, in install
explicit(specs, prefix, verbose=not context.quiet, index_args=index_args)
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/misc.py", line 90, in explicit
txn.execute()
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 225, in execute
self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
File "/opt/Miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 500, in _execute
rollback_excs,
conda.CondaMultiError: [Errno 2] No such file or directory: '/home/evan/.conda/envs/html5-copy/bin/python3.6'
```
</details>
It kind of seems like `html5lib` is just broken on conda-forge, but the way `conda` is failing seems so bizarre I wanted to post this here in case there's something fundamentally wrong happening.
And here's the usual conda info:
<details><summary>conda info</summary>
```
§ conda info
active environment : None
user config file : /home/evan/.condarc
populated config files :
conda version : 4.4.6
conda-build version : 3.0.28
python version : 3.6.1.final.0
base environment : /opt/Miniconda3 (read only)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/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
package cache : /opt/Miniconda3/pkgs
/home/evan/.conda/pkgs
envs directories : /home/evan/.conda/envs
/opt/Miniconda3/envs
platform : linux-64
user-agent : conda/4.4.6 requests/2.14.2 CPython/3.6.1 Linux/4.14.5-1-ARCH arch/ glibc/2.26
UID:GID : 1000:100
netrc file : None
offline mode : False
```
</details>
Let me know if I can provide further details! Thanks!
| Thanks for the report. I think `@EXPLICIT` files have always been installed in-order. I don't think there's anything different here between 4.3 and 4.4.
I'm guessing it's more likely that conda 4.4 is giving the wrong order for `conda list --explicit --export`. Could you do me a favor and verify the order you want is correct in 4.3 and not correct in 4.4? That is, that html5lib is after python in the 4.3 case and before python in the 4.4 case?
Ok, got back to a computer now. Actually both 4.3 and 4.4 list them in alphabetical order. Definitely wrong. I can fix that. Especially in 4.4. | 2018-01-05T22:13:37 |
|
conda/conda | 6,694 | conda__conda-6694 | [
"6693"
] | 4d963e1da043f3eb8b0430263a6185db134f33df | diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -380,9 +380,9 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
if ascendant_name not in specs_to_add_names:
update_names.add(ascendant_name)
grouped_specs = groupby(lambda s: s.name in update_names, final_environment_specs)
- new_final_environment_specs = set(grouped_specs[False])
+ new_final_environment_specs = set(grouped_specs.get(False, ()))
update_specs = set(MatchSpec(spec.name, optional=spec.optional)
- for spec in grouped_specs[True])
+ for spec in grouped_specs.get(True, ()))
final_environment_specs = new_final_environment_specs | update_specs
solution = r.solve(final_environment_specs)
| KeyError with '--update-deps'
```
error: KeyError(True,)
command: /home/jgrnt/miniconda/bin/conda install --update-deps python= numpy nose scipy matplotlib pandas pytest h5py mkl mkl-service
user_agent: conda/4.4.7 requests/2.18.4 CPython/3.6.3 Linux/4.14.4-gentoo gentoo/2.4.1 glibc/2.25
_messageid: -9223372036837525416
_messagetime: 1515513689937 / 2018-01-09 10:01:29
Traceback (most recent call last):
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
return func(*args, **kwargs)
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
force_reinstall=context.force,
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
force_remove, force_reinstall)
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 385, in solve_final_state
for spec in grouped_specs[True])
KeyError: True
```
| 2018-01-09T17:28:03 |
||
conda/conda | 6,708 | conda__conda-6708 | [
"6707"
] | 4d963e1da043f3eb8b0430263a6185db134f33df | 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
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
-from errno import EACCES, EPERM
+from errno import EACCES, ENOENT, EPERM
from functools import reduce
from logging import getLogger
from os import listdir
@@ -305,7 +305,16 @@ def _make_single_record(self, package_filename):
# We have a partially unpacked conda package directory. Best thing
# to do is remove it and try extracting.
rm_rf(extracted_package_dir)
- extract_tarball(package_tarball_full_path, extracted_package_dir)
+ try:
+ extract_tarball(package_tarball_full_path, extracted_package_dir)
+ except EnvironmentError as e:
+ if e.errno == ENOENT:
+ # FileNotFoundError(2, 'No such file or directory')
+ # At this point, we can assume the package tarball is bad.
+ # Remove everything and move on.
+ # see https://github.com/conda/conda/issues/6707
+ rm_rf(package_tarball_full_path)
+ rm_rf(extracted_package_dir)
try:
index_json_record = read_index_json(extracted_package_dir)
except (IOError, OSError, JSONDecodeError):
| FileNotFoundError when extracting tarball
```
error: FileNotFoundError(2, 'No such file or directory')
command: C:\Users\Anurag\Anaconda3\Scripts\conda install spyder
user_agent: conda/4.4.7 requests/2.13.0 CPython/3.6.2 Windows/10 Windows/10.0.16299
_messageid: -9223372036837325447
_messagetime: 1515540414747 / 2018-01-09 17:26:54
Traceback (most recent call last):
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 270, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\common\compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Anurag\\Anaconda3\\pkgs\\pip-9.0.1-py36_1\\info\\repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 287, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\common\compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Anurag\\Anaconda3\\pkgs\\pip-9.0.1-py36_1\\info\\index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\exceptions.py", line 743, in __call__
return func(*args, **kwargs)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
exit_code = do_call(args, p)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 11, in execute
install(args, parser, 'install')
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\cli\install.py", line 255, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\cli\install.py", line 272, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\link.py", line 706, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\common\io.py", line 415, in decorated
return f(*args, **kwds)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 540, in prepare
for prec in self.link_precs)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 540, in <genexpr>
for prec in self.link_precs)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 434, in make_actions_for_record
), None)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 431, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 432, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 118, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 211, in _package_cache_records
self.load()
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 90, in load
package_cache_record = self._make_single_record(base_name)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 308, in _make_single_record
extract_tarball(package_tarball_full_path, extracted_package_dir)
File "C:\Users\Anurag\Anaconda3\lib\site-packages\conda\gateways\disk\create.py", line 145, in extract_tarball
t.extractall(path=destination_directory, members=members_with_progress())
File "C:\Users\Anurag\Anaconda3\lib\tarfile.py", line 2007, in extractall
numeric_owner=numeric_owner)
File "C:\Users\Anurag\Anaconda3\lib\tarfile.py", line 2049, in extract
numeric_owner=numeric_owner)
File "C:\Users\Anurag\Anaconda3\lib\tarfile.py", line 2119, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Users\Anurag\Anaconda3\lib\tarfile.py", line 2160, in makefile
with bltn_open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Anurag\\Anaconda3\\pkgs\\pip-9.0.1-py36_1\\Lib\\site-packages\\pip\\_vendor\\cachecontrol\\__pycache__\\filewrapper.cpython-36.pyc'
```
| ```
error: FileNotFoundError(2, 'No such file or directory')
command: C:\Anaconda3\Scripts\conda install --yes --json --force-pscheck --prefix C:\Anaconda3 jupyterlab==0.30.6 --dry-run
user_agent: conda/4.4.7 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.16299
_messageid: -9223372036837325446
_messagetime: 1515541455356 / 2018-01-09 17:44:15
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 270, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File "C:\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File "C:\Anaconda3\lib\site-packages\conda\common\compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Anaconda3\\pkgs\\nbformat-4.3.0-py36_0\\info\\repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 287, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File "C:\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
File "C:\Anaconda3\lib\site-packages\conda\common\compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Anaconda3\\pkgs\\nbformat-4.3.0-py36_0\\info\\index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\conda\exceptions.py", line 743, in __call__
return func(*args, **kwargs)
File "C:\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
exit_code = do_call(args, p)
File "C:\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "C:\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 11, in execute
install(args, parser, 'install')
File "C:\Anaconda3\lib\site-packages\conda\cli\install.py", line 255, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "C:\Anaconda3\lib\site-packages\conda\cli\install.py", line 276, in handle_txn
actions = unlink_link_transaction.make_legacy_action_groups(progressive_fetch_extract)[0]
File "C:\Anaconda3\lib\site-packages\conda\core\link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "C:\Anaconda3\lib\site-packages\conda\common\io.py", line 415, in decorated
return f(*args, **kwds)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 540, in prepare
for prec in self.link_precs)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 540, in <genexpr>
for prec in self.link_precs)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 434, in make_actions_for_record
), None)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 431, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 432, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 118, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 211, in _package_cache_records
self.load()
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 90, in load
package_cache_record = self._make_single_record(base_name)
File "C:\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 308, in _make_single_record
extract_tarball(package_tarball_full_path, extracted_package_dir)
File "C:\Anaconda3\lib\site-packages\conda\gateways\disk\create.py", line 145, in extract_tarball
t.extractall(path=destination_directory, members=members_with_progress())
File "C:\Anaconda3\lib\tarfile.py", line 2007, in extractall
numeric_owner=numeric_owner)
File "C:\Anaconda3\lib\tarfile.py", line 2049, in extract
numeric_owner=numeric_owner)
File "C:\Anaconda3\lib\tarfile.py", line 2119, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Anaconda3\lib\tarfile.py", line 2160, in makefile
with bltn_open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Anaconda3\\pkgs\\nbformat-4.3.0-py36_0\\Lib\\site-packages\\nbformat-4.3.0-py3.6.egg-info'
``` | 2018-01-10T19:38:21 |
|
conda/conda | 6,709 | conda__conda-6709 | [
"6700"
] | 4d963e1da043f3eb8b0430263a6185db134f33df | diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -2,6 +2,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from datetime import timedelta
+from errno import ENOSPC
import json
from logging import getLogger
import os
@@ -675,6 +676,13 @@ def __init__(self, caused_by, **kwargs):
super(EncodingError, self).__init__(message, caused_by=caused_by, **kwargs)
+class NoSpaceLeftError(CondaError):
+
+ def __init__(self, caused_by, **kwargs):
+ message = "No space left on devices."
+ super(NoSpaceLeftError, self).__init__(message, caused_by=caused_by, **kwargs)
+
+
def maybe_raise(error, context):
if isinstance(error, CondaMultiError):
groups = groupby(lambda e: isinstance(e, ClobberError), error.errors)
@@ -769,17 +777,19 @@ def handle_exception(self, exc_val, exc_tb):
return_code = getattr(exc_val, 'return_code', None)
if return_code == 0:
return 0
- elif isinstance(exc_val, CondaError):
+ if isinstance(exc_val, CondaError):
return self.handle_application_exception(exc_val, exc_tb)
- elif isinstance(exc_val, UnicodeError) and PY2:
+ if isinstance(exc_val, UnicodeError) and PY2:
return self.handle_application_exception(EncodingError(exc_val), exc_tb)
- elif isinstance(exc_val, KeyboardInterrupt):
+ if isinstance(exc_val, EnvironmentError):
+ if getattr(exc_val, 'errno', None) == ENOSPC:
+ return self.handle_application_exception(NoSpaceLeftError(exc_val), exc_tb)
+ if isinstance(exc_val, KeyboardInterrupt):
self._print_conda_exception(CondaError("KeyboardInterrupt"), _format_exc())
return 1
- elif isinstance(exc_val, SystemExit):
+ if isinstance(exc_val, SystemExit):
return exc_val.code
- else:
- return self.handle_unexpected_exception(exc_val, exc_tb)
+ return self.handle_unexpected_exception(exc_val, exc_tb)
def handle_application_exception(self, exc_val, exc_tb):
self._print_conda_exception(exc_val, exc_tb)
| OSError: [Errno 28] No space left on device
```
error: OSError(28, 'No space left on device')
command: /home/ddbrothe/anaconda3/envs/tensorflow/bin/conda install keras
user_agent: conda/4.4.7 requests/2.14.2 CPython/3.6.1 Linux/4.10.0-35-generic ubuntu/16.04 glibc/2.23
_messageid: -9223372036837225447
_messagetime: 1515550319497 / 2018-01-09 20:11:59
Traceback (most recent call last):
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 270, in _make_single_record
repodata_record = read_repodata_json(extracted_package_dir)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 123, in read_repodata_json
with open(join(extracted_package_directory, 'info', 'repodata_record.json')) as fi:
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/common/compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ddbrothe/anaconda3/pkgs/mkl-2018.0.1-h19d6760_4/info/repodata_record.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 287, in _make_single_record
index_json_record = read_index_json(extracted_package_dir)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 111, in read_index_json
with open(join(extracted_package_directory, 'info', 'index.json')) as fi:
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/common/compat.py", line 120, in open
closefd=closefd)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ddbrothe/anaconda3/pkgs/mkl-2018.0.1-h19d6760_4/info/index.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
return func(*args, **kwargs)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 255, in install
handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 272, in handle_txn
unlink_link_transaction.display_actions(progressive_fetch_extract)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/link.py", line 706, in display_actions
legacy_action_groups = self.make_legacy_action_groups(pfe)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/link.py", line 689, in make_legacy_action_groups
pfe.prepare()
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/common/io.py", line 415, in decorated
return f(*args, **kwds)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 540, in prepare
for prec in self.link_precs)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 540, in <genexpr>
for prec in self.link_precs)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 434, in make_actions_for_record
), None)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 431, in <genexpr>
pcrec for pcrec in concat(PackageCache(pkgs_dir).query(pref_or_spec)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 432, in <genexpr>
for pkgs_dir in context.pkgs_dirs)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 118, in query
return (pcrec for pcrec in itervalues(self._package_cache_records) if pcrec == param)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 211, in _package_cache_records
self.load()
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 90, in load
package_cache_record = self._make_single_record(base_name)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/core/package_cache.py", line 308, in _make_single_record
extract_tarball(package_tarball_full_path, extracted_package_dir)
File "/home/ddbrothe/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 145, in extract_tarball
t.extractall(path=destination_directory, members=members_with_progress())
File "/home/ddbrothe/anaconda3/lib/python3.6/tarfile.py", line 2007, in extractall
numeric_owner=numeric_owner)
File "/home/ddbrothe/anaconda3/lib/python3.6/tarfile.py", line 2049, in extract
numeric_owner=numeric_owner)
File "/home/ddbrothe/anaconda3/lib/python3.6/tarfile.py", line 2119, in _extract_member
self.makefile(tarinfo, targetpath)
File "/home/ddbrothe/anaconda3/lib/python3.6/tarfile.py", line 2168, in makefile
copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
File "/home/ddbrothe/anaconda3/lib/python3.6/tarfile.py", line 251, in copyfileobj
dst.write(buf)
OSError: [Errno 28] No space left on device
```
| 2018-01-10T19:51:04 |
||
conda/conda | 6,712 | conda__conda-6712 | [
"6711"
] | 67dedcf32aff9fcd96fd227fdd4cb19bfdaba64b | diff --git a/conda/gateways/disk/update.py b/conda/gateways/disk/update.py
--- a/conda/gateways/disk/update.py
+++ b/conda/gateways/disk/update.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
+from errno import EINVAL, EXDEV
from logging import getLogger
from os import rename as os_rename, utime
from os.path import dirname, isdir, lexists
@@ -8,6 +9,7 @@
from . import exp_backoff_fn
from .delete import rm_rf
+from .link import islink
from ...common.path import expand
log = getLogger(__name__)
@@ -39,12 +41,30 @@ def update_file_in_place_as_binary(file_full_path, callback):
fh.close()
+def _copy_then_remove(source_path, destination_path):
+ from .create import copy, create_hard_link_or_copy
+ if islink(source_path):
+ copy(source_path, destination_path)
+ else:
+ create_hard_link_or_copy(source_path, destination_path)
+ rm_rf(source_path)
+
+
def rename(source_path, destination_path, force=False):
if lexists(destination_path) and force:
rm_rf(destination_path)
if lexists(source_path):
log.trace("renaming %s => %s", source_path, destination_path)
- os_rename(source_path, destination_path)
+ try:
+ os_rename(source_path, destination_path)
+ except EnvironmentError as e:
+ if e.errno in (EINVAL, EXDEV):
+ # see https://github.com/conda/conda/issues/6711
+ log.trace("Could not rename do to errno [%s]. Falling back to copy/remove.",
+ e.errno)
+ _copy_then_remove(source_path, destination_path)
+ else:
+ raise
else:
log.trace("cannot rename; source path does not exist '%s'", source_path)
| os.rename throws exception when renaming directories on lower overlayfs layers
OS: CentOS Linux release 7.2.1511 (Core)
docker version: 1.12.6
docker storage driver: overlayfs
Docker Image has existing conda environment baked into layer
```
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/main.py", line 140, in _main
exit_code = args.func(args, p)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/install.py", line 326, in install
execute_actions(actions, index, verbose=not context.quiet)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 297, in execute
rollback_excs,
conda.CondaMultiError: [Errno 22] Invalid argument: '/opt/continuum/anaconda/envs/anaconda44_py35/lib/python3.5/version.txt' -> '/opt/continuum/anaconda/envs/anaconda44_py35/lib/python3.5/version.txt.c~'
```
cc @msarahan @kalefranz @mmarchetti @dsludwig
| Can you give me the full stack trace? That just looks like part of it...
> `During handling of the above exception, another exception occurred:`
```
$ /opt/continuum/anaconda/envs/anaconda44_py35/bin/conda install --yes --prefix /opt/continuum/anaconda/envs/anaconda44_py35 --channel anaconda-enterprise anaconda-enterprise jupyter_kernel_gateway anaconda-enterprise-web-publisher --debug`
Traceback (most recent call last):
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 326, in _execute_actions
action.execute()
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/path_actions.py", line 620, in execute
backoff_rename(self.target_full_path, self.holding_full_path, force=True)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/gateways/disk/update.py", line 53, in backoff_rename
exp_backoff_fn(rename, source_path, destination_path, force)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/gateways/disk/__init__.py", line 21, in exp_backoff_fn
return fn(*args, **kwargs)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/gateways/disk/update.py", line 47, in rename
os_rename(source_path, destination_path)
OSError: [Errno 22] Invalid argument: '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project' -> '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project.c~'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 281, in execute
pkg_data, actions)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 344, in _execute_actions
reverse_excs,
conda.CondaMultiError: [Errno 22] Invalid argument: '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project' -> '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project.c~'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/main.py", line 140, in _main
exit_code = args.func(args, p)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/cli/install.py", line 326, in install
execute_actions(actions, index, verbose=not context.quiet)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "/opt/continuum/anaconda/lib/python3.6/site-packages/conda/core/link.py", line 297, in execute
rollback_excs,
conda.CondaMultiError: [Errno 22] Invalid argument: '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project' -> '/opt/continuum/anaconda/envs/anaconda44_py35/bin/anaconda-project.c~'
```
Related reference: https://github.com/moby/moby/issues/25409
errno 22 is `EINVAL`
#define EINVAL 22 /* Invalid argument */
NPM discussion: https://github.com/npm/npm/issues/9863
Might no just be errno 22. moby/moby#25409 has
OSError: [Errno 18] Invalid cross-device link: '/foo' -> '/foo2'
which is `EXDEV`.
> rename(2): OverlayFS does not fully support the rename(2) system call. Your application needs to detect its failure and fall back to a “copy and unlink” strategy.
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#limitations-on-overlayfs-compatibility | 2018-01-10T22:02:43 |
|
conda/conda | 6,719 | conda__conda-6719 | [
"6718",
"6230"
] | ad07eba8949e998728c8041af4fc76c34f6bb9ee | diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -287,7 +287,7 @@ def install(args, parser, command='install'):
spec_regex = r'^(%s)$' % '|'.join(re.escape(s.split()[0]) for s in ospecs)
print('\n# All requested packages already installed.')
for action in action_set:
- print_packages(action["PREFIX"], spec_regex)
+ print_packages(action.get("PREFIX", prefix), spec_regex)
else:
common.stdout_json_success(
message='All requested packages already installed.')
diff --git a/conda/plan.py b/conda/plan.py
--- a/conda/plan.py
+++ b/conda/plan.py
@@ -806,7 +806,7 @@ def revert_actions(prefix, revision=-1, index=None):
if state == curr:
return {}
- dists = (Dist(s) for s in state)
+ dists = tuple(Dist(s) for s in state)
actions = ensure_linked_actions(dists, prefix)
for dist in curr - state:
add_unlink(actions, Dist(dist))
@@ -819,7 +819,6 @@ def revert_actions(prefix, revision=-1, index=None):
if dist not in index:
msg = "Cannot revert to {}, since {} is not in repodata".format(revision, dist)
raise CondaRevisionError(msg)
-
return actions
| diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -28,7 +28,7 @@
import pytest
import requests
-from conda import CondaError, CondaMultiError, plan
+from conda import CondaError, CondaMultiError, plan, __version__ as CONDA_VERSION
from conda._vendor.auxlib.entity import EntityEncoder
from conda.base.context import context, reset_context
from conda.cli.common import get_index_trap
@@ -58,6 +58,7 @@
from conda.gateways.disk.delete import rm_rf
from conda.gateways.disk.update import touch
from conda.gateways.logging import TRACE
+from conda.gateways.subprocess import subprocess_call
from conda.models.index_record import IndexRecord
from conda.utils import on_win
@@ -157,7 +158,8 @@ def run_command(command, prefix, *arguments, **kwargs):
@contextmanager
def make_temp_env(*packages, **kwargs):
- prefix = kwargs.pop('prefix', None) or make_temp_prefix()
+ name = kwargs.pop('name', None)
+ prefix = kwargs.pop('prefix', None) or make_temp_prefix(name)
assert isdir(prefix), prefix
with disable_logger('fetch'), disable_logger('dotupdate'):
try:
@@ -1202,6 +1204,53 @@ def test_transactional_rollback_upgrade_downgrade(self):
run_command(Commands.INSTALL, prefix, 'flask=0.11.1')
assert_package_is_installed(prefix, 'flask-0.10.1')
+ def test_conda_downgrade(self):
+ # Create an environment with the current conda under test, but include an earlier
+ # version of conda and other packages in that environment.
+ # Make sure we can flip back and forth.
+ conda_exe = join('Scripts', 'conda.exe') if on_win else join('bin', 'conda')
+ with env_var("CONDA_AUTO_UPDATE_CONDA", "false", reset_context):
+ with make_temp_env("conda=4.3.27 python=%s" % sys.version_info[0],
+ name='_' + str(uuid4())[:8]) as prefix: # rev 0
+ assert package_is_installed(prefix, "conda")
+
+ run_command(Commands.INSTALL, prefix, "mccabe") # rev 1
+ assert package_is_installed(prefix, "mccabe")
+
+ subprocess_call("%s install -p %s -y itsdangerous" % (join(prefix, conda_exe), prefix)) # rev 2
+ linked_data_.clear()
+ assert package_is_installed(prefix, "itsdangerous")
+
+ run_command(Commands.INSTALL, prefix, "lockfile") # rev 3
+ assert package_is_installed(prefix, "lockfile")
+
+ subprocess_call("%s install -p %s -y conda=4.3" % (join(prefix, conda_exe), prefix)) # rev 4
+ linked_data_.clear()
+ assert not package_is_installed(prefix, "conda-4.3.27")
+
+ subprocess_call("%s install -p %s -y colorama" % (join(prefix, conda_exe), prefix)) # rev 5
+ linked_data_.clear()
+ assert package_is_installed(prefix, "colorama")
+
+ stdout, stderr = run_command(Commands.LIST, prefix, "--revisions")
+ print(stdout)
+
+ run_command(Commands.INSTALL, prefix, "--rev 3")
+ linked_data_.clear()
+ assert package_is_installed(prefix, "conda-4.3.27")
+ assert not package_is_installed(prefix, "colorama")
+
+ subprocess_call("%s install -y -p %s --rev 1" % (join(prefix, conda_exe), prefix))
+ linked_data_.clear()
+ assert not package_is_installed(prefix, "itsdangerous")
+ linked_data_.clear()
+ assert package_is_installed(prefix, "conda-4.3.27")
+ assert package_is_installed(prefix, "python-%s" % sys.version_info[0])
+
+ result = subprocess_call("%s info --json" % join(prefix, conda_exe))
+ conda_info = json.loads(result.stdout)
+ assert conda_info["conda_version"] == "4.3.27"
+
@pytest.mark.skipif(on_win, reason="openssl only has a postlink script on unix")
def test_run_script_called(self):
import conda.core.link
| conda install --rev is broken in 4.3
per https://github.com/ContinuumIO/anaconda-issues/issues/7855#issuecomment-357036226
Write downgrade integration tests
In an integration test:
1. Create an environment with the current conda under test, but include an earlier version of conda in that environment. Probably something like
conda create -n _test-env python=2.7 itsdangers conda=X.X
2. Subprocess to that conda, and make sure that conda can operate on that environment.
CONDA_ROOT/envs/_test-env/bin/conda install -p CONDA_ROOT/envs/_test-env/bin/conda flask
| 2018-01-11T23:28:25 |