xyiong
xyiong

Reputation: 373

pip Installation error for dash in Python 2.7

I wish to install Dash on Python 2.7.

I believe that Dash is supported on Python 2.7 as seen here

I run the following command because I have 2 versions of python (2.7 and 3.8):

py -2 -m pip install dash==1.19.0

However, I receive the following error:

    ERROR: Command errored out with exit status 1:
     command: 'C:\Python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\windowsuser\\appdata\\local\\temp\\pip-install-nfgoxk\\brotli\\setup.py'"'"'; __file__='"'"'c:\\users\\windowsuser\\appdata\\local\\temp\\pip-install-nfgoxk\\brotli\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'c:\users\windowsuser\appdata\local\temp\pip-record-dssb81\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python27\Include\brotli'
         cwd: c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\
    Complete output (93 lines):
    running install
    running build
    running build_py
    creating bin
    creating bin\lib.win-amd64-2.7
    copying python\brotli.py -> bin\lib.win-amd64-2.7
    running build_ext
    building '_brotli' extension
    creating bin\temp.win-amd64-2.7
    creating bin\temp.win-amd64-2.7\Release
    creating bin\temp.win-amd64-2.7\Release\c
    creating bin\temp.win-amd64-2.7\Release\c\common
    creating bin\temp.win-amd64-2.7\Release\c\dec
    creating bin\temp.win-amd64-2.7\Release\c\enc
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/common/constants.c /Fobin\temp.win-amd64-2.7\Release\c/common/constants.obj
    constants.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/common/context.c /Fobin\temp.win-amd64-2.7\Release\c/common/context.obj
    context.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/common/dictionary.c /Fobin\temp.win-amd64-2.7\Release\c/common/dictionary.obj
    dictionary.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/common/platform.c /Fobin\temp.win-amd64-2.7\Release\c/common/platform.obj
    platform.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/common/transform.c /Fobin\temp.win-amd64-2.7\Release\c/common/transform.obj
    transform.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/dec/bit_reader.c /Fobin\temp.win-amd64-2.7\Release\c/dec/bit_reader.obj
    bit_reader.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/dec/decode.c /Fobin\temp.win-amd64-2.7\Release\c/dec/decode.obj
    decode.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/dec/huffman.c /Fobin\temp.win-amd64-2.7\Release\c/dec/huffman.obj
    huffman.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/dec/state.c /Fobin\temp.win-amd64-2.7\Release\c/dec/state.obj
    state.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/backward_references.c /Fobin\temp.win-amd64-2.7\Release\c/enc/backward_references.obj
    backward_references.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/backward_references_hq.c /Fobin\temp.win-amd64-2.7\Release\c/enc/backward_references_hq.obj
    backward_references_hq.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/bit_cost.c /Fobin\temp.win-amd64-2.7\Release\c/enc/bit_cost.obj
    bit_cost.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/block_splitter.c /Fobin\temp.win-amd64-2.7\Release\c/enc/block_splitter.obj
    block_splitter.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/brotli_bit_stream.c /Fobin\temp.win-amd64-2.7\Release\c/enc/brotli_bit_stream.obj
    brotli_bit_stream.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/cluster.c /Fobin\temp.win-amd64-2.7\Release\c/enc/cluster.obj
    cluster.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/command.c /Fobin\temp.win-amd64-2.7\Release\c/enc/command.obj
    command.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/compress_fragment.c /Fobin\temp.win-amd64-2.7\Release\c/enc/compress_fragment.obj
    compress_fragment.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/compress_fragment_two_pass.c /Fobin\temp.win-amd64-2.7\Release\c/enc/compress_fragment_two_pass.obj
    compress_fragment_two_pass.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/dictionary_hash.c /Fobin\temp.win-amd64-2.7\Release\c/enc/dictionary_hash.obj
    dictionary_hash.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/encode.c /Fobin\temp.win-amd64-2.7\Release\c/enc/encode.obj
    encode.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/encoder_dict.c /Fobin\temp.win-amd64-2.7\Release\c/enc/encoder_dict.obj
    encoder_dict.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/entropy_encode.c /Fobin\temp.win-amd64-2.7\Release\c/enc/entropy_encode.obj
    entropy_encode.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/fast_log.c /Fobin\temp.win-amd64-2.7\Release\c/enc/fast_log.obj
    fast_log.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/histogram.c /Fobin\temp.win-amd64-2.7\Release\c/enc/histogram.obj
    histogram.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/literal_cost.c /Fobin\temp.win-amd64-2.7\Release\c/enc/literal_cost.obj
    literal_cost.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/memory.c /Fobin\temp.win-amd64-2.7\Release\c/enc/memory.obj
    memory.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/metablock.c /Fobin\temp.win-amd64-2.7\Release\c/enc/metablock.obj
    metablock.c
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/static_dict.c /Fobin\temp.win-amd64-2.7\Release\c/enc/static_dict.obj
    static_dict.c
    c:\users\windowsuser\appdata\local\temp\pip-install-nfgoxk\brotli\c\enc\./find_match_length.h(34) : warning C4013: '_tzcnt_u64' undefined; assuming extern returning int
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tcc/enc/utf8_util.c /Fobin\temp.win-amd64-2.7\Release\c/enc/utf8_util.obj
    utf8_util.c
    creating bin\temp.win-amd64-2.7\Release\python
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic/include -IC:\Python27\include -IC:\Python27\PC /Tppython/_brotli.cc /Fobin\temp.win-amd64-2.7\Release\python/_brotli.obj /EHsc
    _brotli.cc
    C:\Users\windowsuser\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /EXPORT:init_brotli bin\temp.win-amd64-2.7\Release\c/common/constants.obj bin\temp.win-amd64-2.7\Release\c/common/context.obj bin\temp.win-amd64-2.7\Release\c/common/dictionary.obj bin\temp.win-amd64-2.7\Release\c/common/platform.obj bin\temp.win-amd64-2.7\Release\c/common/transform.obj bin\temp.win-amd64-2.7\Release\c/dec/bit_reader.obj bin\temp.win-amd64-2.7\Release\c/dec/decode.obj bin\temp.win-amd64-2.7\Release\c/dec/huffman.obj bin\temp.win-amd64-2.7\Release\c/dec/state.obj bin\temp.win-amd64-2.7\Release\c/enc/backward_references.obj bin\temp.win-amd64-2.7\Release\c/enc/backward_references_hq.obj bin\temp.win-amd64-2.7\Release\c/enc/bit_cost.obj bin\temp.win-amd64-2.7\Release\c/enc/block_splitter.obj bin\temp.win-amd64-2.7\Release\c/enc/brotli_bit_stream.obj bin\temp.win-amd64-2.7\Release\c/enc/cluster.obj bin\temp.win-amd64-2.7\Release\c/enc/command.obj bin\temp.win-amd64-2.7\Release\c/enc/compress_fragment.obj bin\temp.win-amd64-2.7\Release\c/enc/compress_fragment_two_pass.obj bin\temp.win-amd64-2.7\Release\c/enc/dictionary_hash.obj bin\temp.win-amd64-2.7\Release\c/enc/encode.obj bin\temp.win-amd64-2.7\Release\c/enc/encoder_dict.obj bin\temp.win-amd64-2.7\Release\c/enc/entropy_encode.obj bin\temp.win-amd64-2.7\Release\c/enc/fast_log.obj bin\temp.win-amd64-2.7\Release\c/enc/histogram.obj bin\temp.win-amd64-2.7\Release\c/enc/literal_cost.obj bin\temp.win-amd64-2.7\Release\c/enc/memory.obj bin\temp.win-amd64-2.7\Release\c/enc/metablock.obj bin\temp.win-amd64-2.7\Release\c/enc/static_dict.obj bin\temp.win-amd64-2.7\Release\c/enc/utf8_util.obj bin\temp.win-amd64-2.7\Release\python/_brotli.obj /OUT:bin\lib.win-amd64-2.7\_brotli.pyd /IMPLIB:bin\temp.win-amd64-2.7\Release\c/common\_brotli.lib /MANIFESTFILE:bin\temp.win-amd64-2.7\Release\c/common\_brotli.pyd.manifest
    _brotli.obj : warning LNK4197: export 'init_brotli' specified multiple times; using first specification
       Creating library bin\temp.win-amd64-2.7\Release\c/common\_brotli.lib and object bin\temp.win-amd64-2.7\Release\c/common\_brotli.exp
    encode.obj : error LNK2001: unresolved external symbol _tzcnt_u64
    static_dict.obj : error LNK2001: unresolved external symbol _tzcnt_u64
    backward_references.obj : error LNK2019: unresolved external symbol _tzcnt_u64 referenced in function FindMatchLengthWithLimit
    backward_references_hq.obj : error LNK2001: unresolved external symbol _tzcnt_u64
    compress_fragment.obj : error LNK2001: unresolved external symbol _tzcnt_u64
    compress_fragment_two_pass.obj : error LNK2001: unresolved external symbol _tzcnt_u64
    bin\lib.win-amd64-2.7\_brotli.pyd : fatal error LNK1120: 1 unresolved externals
    error: command 'C:\\Users\\windowsuser\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\link.exe' failed with exit status 1120
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\windowsuser\\appdata\\local\\temp\\pip-install-nfgoxk\\brotli\\setup.py'"'"'; __file__='"'"'c:\\users\\windowsuser\\appdata\\local\\temp\\pip-install-nfgoxk\\brotli\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'c:\users\windowsuser\appdata\local\temp\pip-record-dssb81\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python27\Include\brotli' Check the logs for full command output.

Any solutions or ideas why this may be happening?

*Note : No errors when installing Dash on Python 3.8 before/after attempting to install Dash on Python 2.7.

Upvotes: 0

Views: 1053

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20472

The error comes when brotli 1.0.9 is being installed. For brotli, the issue is also open on their github. It comes down to a missing whl file for python 2, whcih results in an attempt by pip to build from source, which it fails to do (probably because it is not that simple).

I just tried it in a fresh environment. You can simply install an older version of brotli:

pip install brotli==1.0.7

And then install dash afterwards

Upvotes: 2

Related Questions