Skip to content

error C2143 failed with exit status 2 when using pip install from Anaconda #57

@ktnr

Description

@ktnr

I tried to pip install the repo in a conda environment and VS19. I got the following error. (I do have installed the "Microsoft Visual C++ 2015-2019 Redistributable - 14.25.28508" for x86 and x64.)

(pybindenv) C:\Users\Leo\Source\Repos\pybind>pip install .
Processing c:\users\leo\source\repos\pybind
Building wheels for collected packages: python-example
  Building wheel for python-example (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Leo\Anaconda3\envs\pybindenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\setup.py'"'"'; __file__='"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Leo\AppData\Local\Temp\pip-wheel-b07wghh7'
       cwd: C:\Users\Leo\AppData\Local\Temp\pip-req-build-kagahwum\
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'python_example' extension
  creating build
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  creating build\temp.win-amd64-3.8\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVERSION_INFO="0.0.1" -Ic:\users\leo\appdata\local\temp\pip-req-build-kagahwum\.eggs\pybind11-2.5.0-py3.8.egg\pybind11\include -IC:\Users\Leo\Anaconda3\envs\pybindenv\include -IC:\Users\Leo\Anaconda3\envs\pybindenv\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/main.cpp /Fobuild\temp.win-amd64-3.8\Release\src/main.obj /EHsc
  main.cpp
  src/main.cpp(36): error C2143: Syntaxfehler: Es fehlt ";" vor "Konstante"
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for python-example
  Running setup.py clean for python-example
Failed to build python-example
Installing collected packages: python-example
    Running setup.py install for python-example ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Leo\Anaconda3\envs\pybindenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\setup.py'"'"'; __file__='"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\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\Leo\AppData\Local\Temp\pip-record-uxtepnq8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Leo\Anaconda3\envs\pybindenv\Include\python-example'
         cwd: C:\Users\Leo\AppData\Local\Temp\pip-req-build-kagahwum\
    Complete output (12 lines):
    running install
    running build
    running build_ext
    building 'python_example' extension
    creating build
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVERSION_INFO="0.0.1" -Ic:\users\leo\appdata\local\temp\pip-req-build-kagahwum\.eggs\pybind11-2.5.0-py3.8.egg\pybind11\include -IC:\Users\Leo\Anaconda3\envs\pybindenv\include -IC:\Users\Leo\Anaconda3\envs\pybindenv\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/main.cpp /Fobuild\temp.win-amd64-3.8\Release\src/main.obj /EHsc
    main.cpp
    src/main.cpp(36): error C2143: Syntaxfehler: Es fehlt ";" vor "Konstante"
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Leo\Anaconda3\envs\pybindenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\setup.py'"'"'; __file__='"'"'C:\\Users\\Leo\\AppData\\Local\\Temp\\pip-req-build-kagahwum\\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\Leo\AppData\Local\Temp\pip-record-uxtepnq8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Leo\Anaconda3\envs\pybindenv\Include\python-example' Check the logs for full command output.

(pybindenv) C:\Users\Leo\Source\Repos\pybind>

Any idea what the issue is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions