facing issue with setup.py
error: Microsoft Visual C++ 14.0 or greater is required, installed visual c++14.0 still getting this error
Hi. Thank you for posting an issue. Could you elaborate the environment and the command that you used to get the error?
using python 3.8.8 used pip install pdf-struct
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\setup.py'"'"'; file='"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\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\siddh\AppData\Local\Temp\pip-wheel-bnmlav3s'
cwd: C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148
Complete output (12 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\editdistance
copying editdistance_init_.py -> build\lib.win-amd64-3.8\editdistance
copying editdistance_editdistance.h -> build\lib.win-amd64-3.8\editdistance
copying editdistance\def.h -> build\lib.win-amd64-3.8\editdistance
running build_ext
building 'editdistance.bycython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
ERROR: Failed building wheel for editdistance
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\setup.py'"'"'; file='"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\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\siddh\AppData\Local\Temp\pip-record-i7s5hdtt\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\anaconda\Include\editdistance'
cwd: C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148
Complete output (12 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\editdistance
copying editdistance_init_.py -> build\lib.win-amd64-3.8\editdistance
copying editdistance_editdistance.h -> build\lib.win-amd64-3.8\editdistance
copying editdistance\def.h -> build\lib.win-amd64-3.8\editdistance
running build_ext
building 'editdistance.bycython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\setup.py'"'"'; file='"'"'C:\Users\siddh\AppData\Local\Temp\pip-install-hev3tftc\editdistance_a69ec0c068984c89a7c5bbb7c39e4148\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\siddh\AppData\Local\Temp\pip-record-i7s5hdtt\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\anaconda\Include\editdistance' Check the logs for full command output.
OK. It seems be an error when building a cython module in editdistance library that pdf-struct depends on (confirm by testing pip install editdistance).
You might be able to bypass the build by installing wheel (pip install wheel).
If that doesn't work, you need to setup C++ compiler accordingly. I found a following stackoverflow post that might be related to your problem. https://stackoverflow.com/questions/66838238/cython-setup-py-cant-find-installed-visual-c-build-tools
not working with wheel also already tried that stackoverflow post not working 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] installed version 14.16 but still same error persists
Hmmm. It is likely to do with the C++ compiler installation and there is not much that I can do when I don't have access to your environment. I suggest you contact Cython or editdistance, which seems to be the cause of failure, for further help.