yushulx / python-barcode-qrcode-sdk

Build Python barcode QR code SDK with Dynamsoft Barcode Reader.
https://pypi.org/project/barcode-qr-code-sdk/
MIT License
51 stars 24 forks source link

error: command 'cl.exe' failed: No such file or directory #5

Closed mmortazavi closed 5 years ago

mmortazavi commented 5 years ago

Environments:

Based on the instructions:

Also note that I followed this instruction to install C++ build tools for Visual Studio. Further I have set 'cl.exe' path the environment variable (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64).

Whatever I do I get the following error when running in an Anaconda prompt:

cd src
python setup.py build install
python3 setup.py build install

running build running build_ext building 'dbr' extension cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\MajidMortazavi\Anaconda3\lib\site-packages\numpy\core\include\numpy -IC:\Users\MajidMortazavi\Anaconda3\include -IC:\Users\MajidMortazavi\Anaconda3\include /Tcdbr.c /Fobuild\temp.win-amd64-3.7\Release\dbr.obj error: command 'cl.exe' failed: No such file or directory

I am guessing that still I have still issues with C++ build tools for Visual Studio and Paths!!

yushulx commented 5 years ago

@mmortazavi You cannot use SET VS90COMNTOOLS=%VS160COMNTOOLS%. Since you've followed StackOverflow to install the VC++ 2015.3 v140 toolset, you should use SET VS90COMNTOOLS=%VS140COMNTOOLS%.

mmortazavi commented 5 years ago

@yushulx As mentioned in the Environments, I have Visual Studio 2019 (16.3.4), that is why SET VS90COMNTOOLS=%VS160COMNTOOLS% was set. I did only follow ideas that were suggested in that post.

yushulx commented 5 years ago

@mmortazavi I know you are using VS 2019, but you cannot set the environment variable like that. It's Python's problem. Only VS2015 toolset can work.

yushulx commented 5 years ago

@mmortazavi I tried SET VS90COMNTOOLS=%VS150COMNTOOLS% for my Visual Studio 2017, but failed.

mmortazavi commented 5 years ago

@yushulx What is your suggestion for Visual Studio 2019? So for Visual Studio 2019, I have to set up the env variable like SET VS90COMNTOOLS=%VS140COMNTOOLS%..

By the way, is pypi distribution not maintained? I can not do pip:

$ pip install dbr

ERROR: Could not find a version that satisfies the requirement dbr (from versions: none)
ERROR: No matching distribution found for dbr
yushulx commented 5 years ago

Yes. You can install the Visual Studio 2015 toolset and use SET VS90COMNTOOLS=%VS140COMNTOOLS%.

The maintenance of PyPI distribution is on hold. Please build the package with the source code. It's convenient by using the command python setup.py build install.

mmortazavi commented 5 years ago

I managed to finally install the package. Having the latest version of Visual Studio was not the issue at all. Surely I needed just to add C++ tools (located within Desktop development with C++) by modifying the installed Visual Studio from the installer. This is what I did from the beginning and it was not working! What I missed is the following. There are many components within Desktop development with C++, and I had missed checking MSVC v140 - VS 2015 C++ build tools (v14.00) all along. I had all other kind of built tools installed, but it turns out this is the one that has all C++ header files.