I am having trouble with cython and anaconda.
For the sake of argument, let's assume I want to use a header file that is part of libxml2: xmlversion.h
I have installed the package libxml2 with anaconda in my build environment, but cythonize complains that it cannot find the header file.
After investigating further, I found that the headers for libxml are linked in the folder:
C:\Miniconda3\envs\build-env\Library\include\libxml
That path is not automatically added to the build command however (see below). Instead, the following path gets added twice:
C:\Miniconda3\envs\build-env\include
The build command generated by cythonize -3 -a -i xmltest.pyx on my machine is as follows:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Miniconda3\envs\build-env\lib\site-packages\lxml\includes -IC:\Miniconda3\envs\build-env\include -IC:\Miniconda3\envs\build-env\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" "/TcC:\Users\My User\Documents\my_proj\xmltest.c" "/FoC:\Users\My User\Documents\my_proj\tmpy_5rengr\Release\Users\My User\Documents\my_proj\xmltest.obj"
xmltest.c
C:\Users\My User\Documents\my_proj\xmltest.c(621): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Note 1: Question was modified after merv's comment
Related
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win-amd64-cpython-311\Release\preshed/maps.obj /Ox /EHsc
maps.cpp
preshed/maps.cpp(181): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
Encountered error while trying to install package.
preshed
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I tried many solutions for this but anything is not working
I have tried updating pip, changing environment variables and other possible solutions I've found on the internet, but nothing seems to work
It worked for me in python 3.11:
pip install chatterbot --pre
After upgrading Python to 3.11, Locust-plugin fails to install as one of its dependency throws error
First it asked me to install VC++ > 14.0
After installing VC++ build tools 15, still it throws a different error
Note: We do not see this issue until Python 3.10.8
Kindly let me know if there is any fix?
locust-plugins==2.7.1
- confluent-kafka [required: Any]
DEPRECATION: confluent-kafka is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 2
3.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for confluent-kafka ... error
error: subprocess-exited-with-error
× Running setup.py install for confluent-kafka did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
running install
C:\~\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use bu
ild and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
.............build\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src
creating build\temp.win-amd64-cpython-311\Release\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka
creating build\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\~\AppData\
Local\Programs\Python\Python311\include -IC:\~\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\M
SVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)
\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\inIC:\~\AppData\Local\Programs\Python\Python311\include -IC:\~\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files
(x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /TcC:\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\Admin.c /Fobuild\~\AppData\Local\Temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\Admin.obj
Admin.c c:\~\appdata\local\temp\pip-install-751nsega\confluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55b\src\confluent_kafka\src\confluent_kafka.h(23): fatal error C1083: Cannot open include file: 'librdkafka/rdkafka.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> confluent-kafka
Right now there is currently no pre-built version of confluent-kafka for 3.11. Hopefully it is on the way though: https://github.com/confluentinc/confluent-kafka-python/issues/1452
Also, I think the reason cannot build from source is that you need librdkafka installed. I dont know what the windows equivalent is, but apparently someone got it working on Linux this way:
apt-get install -y --no-install-recommends gcc git libssl-dev g++ make && cd /tmp && git clone https://github.com/edenhill/librdkafka.git && cd librdkafka && ./configure --prefix=/usr && make && make install
Looks like we are still waiting for 3.11 confluent-kafka. This is the only thing that is blocking my 3.10 to 3.11 upgrade.
Following all prerequisites and instructions from here
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Build-Chromium
When I'm finally getting to the building part:
autoninja -C out\Default chrome
I receive error:
Files\SQLXML: no such file or directory
lld-link: error: lib failed
Apparently -libpath argument is not parsed correctly despite it's in quotes:
"-libpath:C:\Program Files\SQLXML 4.0\bin\"
The failing command:
ninja: Entering directory `out\Default'
[18 processes, 68/41674 # 17.3/s : 3.9...ic_annotations/dynamic_annotations.lib
FAILED: obj/base/third_party/dynamic_annotations/dynamic_annotations.lib
ninja -t msvc -e environment.x64 -- ....\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /lib /nologo "-libpath:D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\ATLMFC\lib\x64" "-libpath:D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\lib\x64" "-libpath:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" "-libpath:D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\ATLMFC\lib\x86" "-libpath:D:\Program Files (x86)\Microsoft VisualStudio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\lib\x86" "-libpath:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86" "-libpath:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86" "-libpath:C:\Program Files (x86)\SQLXML 4.0\bin\" "-libpath:C:\Program Files\SQLXML 4.0\bin\" /ignore:4221 /llvmlibthin /OUT:obj/base/third_party/dynamic_annotations/dynamic_annotations.lib #obj/base/third_party/dynamic_annotations/dynamic_annotations.lib.rsp
Files\SQLXML: no such file or directory
lld-link: error: lib failed
After executing "gn gen out/Default" command open "out/Default/toolchain.ninja" file and quote path inside -libpath parameter once more with single quotes in all occurrences on SQLXML reference:
"-libpath:'C:\Program Files (x86)\SQLXML 4.0\bin\'" "-libpath:C:\Program Files\SQLXML 4.0\bin\"
for some reason only references to SQLXML required this change
My attempts to compile the simplest of C program to ARM, directly with cl.exe on a Win10 x86-64 environment always results in the following error:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX64\arm\cl.exe" /c 1.c
1.c
c1: fatal error C1356: unable to find mspdbcore.dll
Note that everything works fine if I target x86 code: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe" /c 1.c
I can compile and link this program just fine if doing it from within VS. Am I missing something on the PATH? It also seems that I only have two versions of mspdbcore.dll, one in Hostx64/x64 and another one in Hostx86/x86; nothing in the arm/arm64 equivalent folders.
File: 1.c:
int main(void) {
return 0;
}
Okay, it turned out the problem was connected to missing or incorrect environment variables after all...
I set up custom overrides for PATH, INCLUDE, LIB, and LIBPATH matching the values provided by the "VC++ Directories" options of a sample ARM VS project, and things are now compiling smoothly.
Edit #1: Settings I used, for VS2017: (They can be found in the "VC++ Directories" options widget I mentioned above)
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\arm;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\tools;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\ide;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\Include\um
set LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\lib\ARM;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\atlmfc\lib\ARM;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\lib\ARM;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\arm;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\arm;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\Lib\um\arm
set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\atlmfc\lib\ARM;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\lib\ARM;C:\Program Files (x86)\Windows Kits\10\References
Some VS directories have mspdbcore.dll, and some don't. Declaring the path in LIBPATH doesn't fix it.
For example, .\bin\Hostx64\x64\ and .\bin\Hostx86\x86\ have mspdbcore.dll, but .\bin\Hostx64\x86\ does not, so if you want to run the 32-bit compiler on a 64-bit system, use .\bin\Hostx86\x86\cl.exe, not .\bin\Hostx64\x86\cl.exe.
I am trying to download a channels package for making a chatbot by using google tensorflow. But, I am getting the following error:
3.5\twisted\words\im
copying src\twisted\words\xish\xpathparser.g -> build\lib.win-amd64-3.5\twis
ted\words\xish
running build_ext
building 'twisted.test.raiser' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\src
creating build\temp.win-amd64-3.5\Release\src\twisted
creating build\temp.win-amd64-3.5\Release\src\twisted\test
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo
/Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Ic:\python\python35\include -Ic:\python\pyt
hon35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"
-IC:\Python\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\bin" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
" "-IC:\Program Files (x86)\Windows Kits\8.1\Include\shared" "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\lib\amd64" "-IC:\Program Files (x86)\Micr
osoft Visual Studio 14.0\VC\lib\arm" "-IC:\Program Files (x86)\Microsoft Visual
Studio 14.0\VC\lib\store" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\bin\amd64_x86" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
\amd64_arm" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_ar
m" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64" "-IC:\Pr
ogram Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64" "-IC:\Program F
iles (x86)\Microsoft Visual Studio 14.0\VC\lib\store\amd64" "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\lib\store\arm" "-IC:\Program Files (x86)\M
icrosoft Visual Studio 14.0\VC\lib" -IC:\Python\Python35\Lib "-IC:\Program Files
(x86)\Microsoft Visual Studio\Installer\resources\app\lib" /Tcsrc/twisted/test/
raiser.c /Fobuild\temp.win-amd64-3.5\Release\src/twisted/test/raiser.obj
cl : Command line warning D9024 : unrecognized source file type 'C:\Program'
, object file assumed
cl : Command line warning D9027 : source file 'C:\Program' ignored
cl : Command line warning D9024 : unrecognized source file type 'Files', obj
ect file assumed
cl : Command line warning D9027 : source file 'Files' ignored
cl : Command line warning D9024 : unrecognized source file type '(x86)\Micro
soft', object file assumed
cl : Command line warning D9027 : source file '(x86)\Microsoft' ignored
cl : Command line warning D9024 : unrecognized source file type 'Visual', ob
ject file assumed
cl : Command line warning D9027 : source file 'Visual' ignored
cl : Command line warning D9024 : unrecognized source file type 'Studio', ob
ject file assumed
cl : Command line warning D9027 : source file 'Studio' ignored
cl : Command line warning D9024 : unrecognized source file type '14.0\VC\bin
\amd64_arm;', object file assumed
cl : Command line warning D9027 : source file '14.0\VC\bin\amd64_arm;' ignor
ed
raiser.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe /nologo
/INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\pyth
on\python35\libs /LIBPATH:c:\python\python35\PCbuild\amd64 /EXPORT:PyInit_raiser
build\temp.win-amd64-3.5\Release\src/twisted/test/raiser.obj /OUT:build\lib.win
-amd64-3.5\twisted\test\raiser.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3
.5\Release\src/twisted/test\raiser.cp35-win_amd64.lib
LINK : fatal error LNK1104: cannot open file 'MSVCRT.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\b
in\\link.exe' failed with exit status 1104
----------------------------------------
Command "c:\python\python35\python.exe -u -c "import setuptools, tokenize;__file
__='C:\\Users\\krati\\AppData\\Local\\Temp\\pip-build-nzxnni5z\\twisted\\setup.p
y';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\kr
ati\AppData\Local\Temp\pip-3y_pe9kx-record\install-record.txt --single-version-e
xternally-managed --compile" failed with error code 1 in C:\Users\krati\AppData\
Local\Temp\pip-build-nzxnni5z\twisted\
I am using python 3.5 on Windows 7 64 bit operating system, Visual Studio Community 2017 and Microsoft Visual Studio 14.0 .I have tried everything, link the paths to the environment variable and include variable but still this error exists.
Can someone please help in resolving that..thanks in advance