Cannot create environments without internet connection #4267

Open
ARF1 opened this Issue Jan 11, 2017 · 1 comment

Projects

None yet

2 participants

@ARF1
Contributor
ARF1 commented Jan 11, 2017

It appears to be impossible to create environments without internet connection, even if all required packages are already downloaded:

Neither conda create --use-local nor conda create --offline work:

C:\Windows\system32>conda update conda
Fetching package metadata .........
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at C:\Anaconda:
#
conda                     4.2.13                   py27_0

C:\Windows\system32>conda update --all
Fetching package metadata .........
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at C:\Anaconda:
#
anaconda-client           1.6.0                    py27_0
clyent                    1.2.2                    py27_0
conda                     4.2.13                   py27_0
conda-env                 2.6.0                         0
enum34                    1.1.6                    py27_0
menuinst                  1.4.2                    py27_1
pip                       9.0.1                    py27_1
psutil                    5.0.1                    py27_0
pycosat                   0.6.1                    py27_1
python                    2.7.13                        0
python-dateutil           2.6.0                    py27_0
pytz                      2016.10                  py27_0
pywin32                   220                      py27_1
pyyaml                    3.12                     py27_0
requests                  2.12.4                   py27_0
ruamel_yaml               0.11.14                  py27_1
setuptools                27.2.0                   py27_1
six                       1.10.0                   py27_0
vs2008_runtime            9.00.30729.1                  2
wheel                     0.29.0                   py27_0

C:\Windows\system32>conda create -n test python=3.5 pip
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment C:\Anaconda\envs\test:

The following NEW packages will be INSTALLED:

    pip:            9.0.1-py35_1
    python:         3.5.2-0
    setuptools:     27.2.0-py35_1
    vs2015_runtime: 14.0.25123-0
    wheel:          0.29.0-py35_0

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# > activate test
#
# To deactivate this environment, use:
# > deactivate test
#
# * for power-users using bash, you must source
#


C:\Windows\system32>REM Internet connection disabled


C:\Windows\system32>conda create -n test2 --offline python=3.5 pip
Fetching package metadata ...
Solving package specifications: .


PackageNotFoundError: Package not found: '' Packages missing in current win-32 channels:
  - python 3.5*
  - pip

You can search for packages on anaconda.org with

    anaconda search -t conda python

(and similarly for the other packages)



C:\Windows\system32>conda create -n test2 --use-local python=3.5 pip
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-32
          conda version : 4.2.13
       conda is private : False
      conda-env version : 4.2.13
    conda-build version : not installed
         python version : 2.7.13.final.0
       requests version : 2.12.4
       root environment : C:\Anaconda  (writable)
    default environment : C:\Anaconda
       envs directories : C:\Anaconda\envs
          package cache : C:\Anaconda\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-32
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/pro/win-32
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-32
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
           offline mode : False



`$ C:\Anaconda\Scripts\conda-script.py create -n test2 --use-local python=3.5 pip`




    Traceback (most recent call last):
      File "C:\Anaconda\lib\site-packages\conda\exceptions.py", line 479, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Anaconda\lib\site-packages\conda\cli\main.py", line 145, in _main
        exit_code = args.func(args, p)
      File "C:\Anaconda\lib\site-packages\conda\cli\main_create.py", line 68, in execute
        install(args, parser, 'create')
      File "C:\Anaconda\lib\site-packages\conda\cli\install.py", line 176, in install
        common.ensure_use_local(args)
      File "C:\Anaconda\lib\site-packages\conda\cli\common.py", line 391, in ensure_use_local
        " to use the --use-local option." % e)
    CondaRuntimeError: Runtime error: No module named conda_build.config: you need to have 'conda-build >= 1.7.1' installed to use the --use-local option.


C:\Windows\system32>REM Internet connection enabled


C:\Windows\system32>conda install conda-build
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment C:\Anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    contextlib2-0.5.4          |           py27_0          13 KB
    filelock-2.0.7             |           py27_0           9 KB
    futures-3.0.5              |           py27_0          18 KB
    markupsafe-0.23            |           py27_2          26 KB
    pkginfo-1.4.1              |           py27_0          70 KB
    pycrypto-2.6.1             |           py27_4         457 KB
    conda-verify-2.0.0         |           py27_0          55 KB
    jinja2-2.8.1               |           py27_0         272 KB
    conda-build-2.1.0          |           py27_0         370 KB
    ------------------------------------------------------------
                                           Total:         1.3 MB

The following NEW packages will be INSTALLED:

    conda-build:  2.1.0-py27_0
    conda-verify: 2.0.0-py27_0
    contextlib2:  0.5.4-py27_0
    filelock:     2.0.7-py27_0
    futures:      3.0.5-py27_0
    jinja2:       2.8.1-py27_0
    markupsafe:   0.23-py27_2
    pkginfo:      1.4.1-py27_0
    pycrypto:     2.6.1-py27_4

Proceed ([y]/n)? y

Fetching packages ...
contextlib2-0. 100% |###############################| Time: 0:00:00 207.94 kB/s
filelock-2.0.7 100% |###############################| Time: 0:00:00 187.49 kB/s
futures-3.0.5- 100% |###############################| Time: 0:00:00 238.33 kB/s
markupsafe-0.2 100% |###############################| Time: 0:00:00 239.91 kB/s
pkginfo-1.4.1- 100% |###############################| Time: 0:00:00 229.91 kB/s
pycrypto-2.6.1 100% |###############################| Time: 0:00:02 228.60 kB/s
conda-verify-2 100% |###############################| Time: 0:00:00 224.72 kB/s
jinja2-2.8.1-p 100% |###############################| Time: 0:00:01 202.22 kB/s
conda-build-2. 100% |###############################| Time: 0:00:01 229.10 kB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%

C:\Windows\system32>REM Internet connection disabled


C:\Windows\system32>conda create -n test2 --use-local python=3.5 pip
Fetching package metadata ...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-32
          conda version : 4.2.13
       conda is private : False
      conda-env version : 4.2.13
    conda-build version : 2.1.0
         python version : 2.7.13.final.0
       requests version : 2.12.4
       root environment : C:\Anaconda  (writable)
    default environment : C:\Anaconda
       envs directories : C:\Anaconda\envs
          package cache : C:\Anaconda\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-32
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/pro/win-32
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-32
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
           offline mode : False



`$ C:\Anaconda\Scripts\conda-script.py create -n test2 --use-local python=3.5 pip`




    Traceback (most recent call last):
      File "C:\Anaconda\lib\site-packages\conda\exceptions.py", line 479, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Anaconda\lib\site-packages\conda\cli\main.py", line 145, in _main
        exit_code = args.func(args, p)
      File "C:\Anaconda\lib\site-packages\conda\cli\main_create.py", line 68, in execute
        install(args, parser, 'create')
      File "C:\Anaconda\lib\site-packages\conda\cli\install.py", line 238, in install
        prefix=prefix)
      File "C:\Anaconda\lib\site-packages\conda\api.py", line 24, in get_index
        index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
      File "C:\Anaconda\lib\site-packages\conda\fetch.py", line 300, in fetch_index
        repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
      File "C:\Anaconda\lib\site-packages\concurrent\futures\_base.py", line 405, in result
        return self.__get_result()
      File "C:\Anaconda\lib\site-packages\concurrent\futures\thread.py", line 55, in run
        result = self.fn(*self.args, **self.kwargs)
      File "C:\Anaconda\lib\site-packages\conda\fetch.py", line 75, in func
        res = f(*args, **kwargs)
      File "C:\Anaconda\lib\site-packages\conda\fetch.py", line 117, in fetch_repodata
        timeout=(6.1, 60))
      File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 501, in get
        return self.request('GET', url, **kwargs)
      File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 488, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 641, in send
        r.content
      File "C:\Anaconda\lib\site-packages\requests\models.py", line 781, in content
        self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
      File "C:\Anaconda\lib\site-packages\requests\models.py", line 714, in generate
        chunk = self.raw.read(chunk_size)
    AttributeError: 'exceptions.WindowsError' object has no attribute 'read'


C:\Windows\system32>
@jonsedar

I seem to have the same issue

platform  :  win-64
conda version. :  4.2.9
conda is private  :  False
conda-env version  :  4.2.9
conda-build version. :  2.0.2
python version. :  3.5.2.final.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment