Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR An error occurred while installing package 'defaults::qt-5.6.2-vc9_3' #4567

joelkim opened this issue Feb 8, 2017 · 9 comments


Copy link

@joelkim joelkim commented Feb 8, 2017

Current conda install:

               platform : win-64
          conda version : 4.3.9
       conda is private : False
      conda-env version : 4.3.9
    conda-build version : 2.1.3
         python version :
       requests version : 2.12.4
       root environment : C:\Users\joelkim\Anaconda2  (writable)
    default environment : C:\Users\joelkim\Anaconda2
       envs directories : C:\Users\joelkim\Anaconda2\envs
          package cache : C:\Users\joelkim\Anaconda2\pkgs
           channel URLs :
            config file : None
           offline mode : False
             user-agent : conda/4.3.9 requests/2.12.4 CPython/2.7.13 Windows/10 Windows/10.0.14393

I got this error when I tried to install qt:

> conda create -n test qt
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment C:\Users\joelkim\Anaconda2\envs\test:

The following NEW packages will be INSTALLED:

    icu:            57.1-vc9_0        [vc9]
    jpeg:           9b-vc9_0          [vc9]
    libpng:         1.6.27-vc9_0      [vc9]
    openssl:        1.0.2k-vc9_0      [vc9]
    pip:            9.0.1-py27_1
    python:         2.7.13-0
    qt:             5.6.2-vc9_3       [vc9]
    setuptools:     27.2.0-py27_1
    vs2008_runtime: 9.00.30729.5054-0
    wheel:          0.29.0-py27_0
    zlib:           1.2.8-vc9_3       [vc9]

Proceed ([y]/n)?

ERROR An error occurred while installing package 'defaults::qt-5.6.2-vc9_3'.
Copy link

@kalefranz kalefranz commented Feb 8, 2017

If this problem is reproducible for you, can you give me the output of

conda create -n test qt -vvv

It'll be a lot of output. Feel free to email it to me if you want.

Copy link

@LiamLiuhit LiamLiuhit commented Feb 9, 2017

I have the similar error too.

Copy link
Contributor Author

@joelkim joelkim commented Feb 9, 2017

I found the reason. It is because OS message is not encoded in utf-8 (in my case, CP949)

On installation, subprocess_call function is called:

return Response(ensure_text_type(stdout), ensure_text_type(stderr), int(rc))

Inside, this function calls ensure_text_type to validate standard output:

def ensure_text_type(value):

ensure_text_type raises a Unicode error because subprocess' standard output includes not-encoded-in-utf-8 string.

But, I have no idea why there was no problem when I installed qt in root environment.

Copy link
Contributor Author

@joelkim joelkim commented Feb 9, 2017

Temporarily, I fixed this problem by modifying ensure_text_type like this:

import chardet

def ensure_text_type(value):
    if isinstance(value, text_type):
        encoding = 'utf-8'
        encoding = chardet.detect(value).get('encoding') or 'utf-8'
    return value.decode(encoding) if hasattr(value, 'decode') else value
Copy link

@LiamLiuhit LiamLiuhit commented Feb 9, 2017

Thank you very much! However, I'm a newcomer here, could you tell me what should I do to solve this problem, by the way? Should I just activate the user environment and run your program or download your program file into some specific directory?

Copy link
Contributor Author

@joelkim joelkim commented Feb 9, 2017

Open the file ~\Anaconda2\Lib\site-packages\conda\common\
and edit like

kalefranz added a commit to kalefranz/conda that referenced this issue Feb 9, 2017
Copy link

@LiamLiuhit LiamLiuhit commented Feb 10, 2017

It works! Thank you!

Copy link

@kalefranz kalefranz commented Feb 15, 2017

Conda 4.3.12 that includes a patch for this issue has been released to conda canary. Feel free to test.

conda config --add channels conda-canary
conda update conda
Copy link

@vijju7447 vijju7447 commented Jul 15, 2020

conda create -n test qt -vvv

(opencv-env) C:\Users\Vijju>conda create -n test qt -vvvc
usage: create [-h] [--clone ENV] [-n ENVIRONMENT | -p PATH]
[-c CHANNEL] [--use-local] [--override-channels]
[--repodata-fn REPODATA_FNS]
[--no-deps | --only-deps] [--no-pin] [--copy]
[--no-shortcuts] [-C] [-k] [--offline] [-d]
[--json] [-q] [-v] [-y] [--download-only]
[--show-channel-urls] [--file FILE]
[--no-default-packages] [--dev]
[package_spec [package_spec ...]] create: error: argument -c/--channel: expected one argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.