Installing PyUblas on Windows - python

I'm trying to install PyUblas on my Windows machine. I have Visual Studio 2017 Community edition. I've tried installing using
pip install pyublas
but get the following error message:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipyublas/include "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /Tpsrc/wrapper/main.cpp /Fobuild\temp.win32-3.6\Release\src/wrapper/main.obj -Wno-sign-compare
cl : Command line error D8021 : invalid numeric argument '/Wno-sign-compare'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Command ""c:\users\my name\appdata\local\programs\python\python36-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\MYNAME~1\\AppData\\Local\\Temp\\pip-build-z0yc_qan\\PyUblas\\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\MYNAME~1\AppData\Local\Temp\pip-2hhk4m35-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-z0yc_qan\PyUblas\
On the documentation page there is also a two-line description of an alternative installation method using Boost.Build; however, it seems rather outdated or at least I wasn't able to get it to work or even to understand it. I've compiled Boost but not sure what I'm supposed to do then. It seems bjam has since been superceded by b2 but running that didn't help. I also couldn't find anything useful by searching either Google or on here.
EDIT:
I have tried removing the offending lines from setup.py and installing manually as per TheGreatParker's suggestion. I have also removed references to the flag in question in lines 109 and 119 because they were throwing up errors. Now I get the following error:
src/wrapper/main.cpp(16): fatal error C1083: Cannot open include file:
'boost/python.hpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
I've tried copying the boost folder containing python.hpp into the installation folder but this didn't seem to help.
EDIT2:
I have rebuilt boost and made sure that the installation configuration file created by configure.py (which is siteconf.py) correctly links to the boost directories. Now I get the following error:
LINK : fatal error LNK1181: cannot open input file 'boost_python36-vc141-mt-x32-1_67.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
I gather that the file it wants is in the boost library directory which for me is boost_1_67_0\stage\lib\. The file in question is actually called libboost_python36-vc141-mt-x32-1_67.lib so I thought the problem was that it was missing the 'lib' in the beginning. However, when I changed siteconf.py:
BOOST_PYTHON_LIBNAME = ['libboost_python36-vc141-mt-x32-1_67']
I got the following error:
LINK : fatal error LNK1104: cannot open file 'boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION-vc141-mt-x32-1_67.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1104
Seems that either way it can't access this file. I have also tried making a copy of the file libboost_python36-vc141-mt-x32-1_67 and renaming it what the installation is looking for. In this case I get a whole bunch of errors of the sort:
main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::registration const * __cdecl boost::python::converter::registry::query(struct boost::python::type_info)" (__imp_?query#registry#converter#python#boost##YAPBUregistration#234#Utype_info#34##Z)
until the installation exits with error
build\lib.win32-3.6\pyublas\_internal.cp36-win32.pyd : fatal error LNK1120: 22 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120

You could try to install this package manually:
Clone source code;
Open setup.py and remove python logic which adds this flag. (in my version they are lines 16, and 17:
StringListOption("CXXFLAGS", ["-Wno-sign-compare"],
help="Any extra C++ compiler options to include"),
Use python setup.py install to install the package with changed setup.py
Hope this will help you.

conda install pyublas
You need to install anaconda/miniconda from
https://conda.io/docs/user-guide/install/index.html

Related

File msvc_recommended_pragmas.h missing while installing PyGObject via pip

I tried to install PyGObject via pip and it fails with given error:
Building wheels for collected packages: pygobject
Building wheel for pygobject (PEP 517) ... error
ERROR: Command errored out with exit status 1:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN -IC:\Users\James\AppData\Local\Temp\pip-install-deoh1xpv\pygobject_2e13db219b124bfd8bf7a88e47dc19a5 -IC:\Users\James\AppData\Local\Temp\pip-install-deoh1xpv\pygobject_2e13db219b124bfd8bf7a88e47dc19a5\gi -IC:\Program Files\Python39\include -IC:\Program Files\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -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 /Tcgi\gimodule.c /Fobuild\temp.win-amd64-3.9\Release\gi\gimodule.obj -FImsvc_recommended_pragmas.h
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pygobject
I had another attempt with python -m pip install pygobject --no-use-517 and it still fails with error:
Building wheels for collected packages: pygobject
Building wheel for pygobject (setup.py) ... error
ERROR: Command errored out with exit status 1:
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pygobject
Running setup.py clean for pygobject
Failed to build pygobject
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
ERROR: Command errored out with exit status 1:
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Program Files\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\James\\AppData\\Local\\Temp\\pip-install-x0ki7wgt\\pygobject_0af3e48dd4b543de8f83ff716124e468\\setup.py'"'"'; __file__='"'"'C:\\Users\\James\\AppData\\Local\\Temp\\pip-install-x0ki7wgt\\pygobject_0af3e48dd4b543de8f83ff716124e468\\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\James\AppData\Local\Temp\pip-record-andppe11\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Program Files\Python39\Include\pygobject' Check the logs for full command output.
It seems like all fails is due to a missing file msvc_recommended_pragmas.h. This leaves me with no clue of what I may have missed. All runtime dependencies involved (python3.9, pip, MSYS2, C++ Build Tools from Visual Studio) have been upgraded to the latest version FYI.
gvsbuild provides a method to compile GTK in Windows. The latest instructions can be found in the README at https://github.com/wingtk/gvsbuild. Once you install the dependencies, it will work something like this:
mkdir C:\gtk-build\github
cd C:\gtk-build\github
git clone C:\github.com\wingtk\gvsbuild
python -m venv .venv
.\.venv\Scripts\activate.ps1
pip install .
gvsbuild build --enable-gi --py-wheel gobject-introspection gtk3 pycairo pygobject
Once that builds, you can switch to your project you are trying to use PyGObject for and activate the virtualenv. Then install the wheels you created above:
Get-ChildItem C:\gtk-build\build\x64\release\*\dist\*.whl | ForEach-Object -process { poetry run pip install $_ }

Detectron2 installation in Windows Causes Me a big error

I'm Jitesh, a Python programmer trying to install detectron2 on Windows. While installing detectron2, I ran an error.
This is the segement of the code:
Emitting ninja build file C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.10.0.git.kitware.jobserver-1
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\user\appdata\local\programs\python\python38\lib\site-packages\torch\lib /LIBPATH:c:\users\user\appdata\local\programs\python\python38\libs /LIBPATH:c:\users\user\appdata\local\programs\python\python38\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib /EXPORT:PyInit__C C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\vision.obj C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\box_iou_rotated\box_iou_rotated_cpu.obj C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\cocoeval\cocoeval.obj C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\nms_rotated\nms_rotated_cpu.obj C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\ROIAlign\ROIAlign_cpu.obj C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.obj /OUT:build\lib.win-amd64-3.8\detectron2\_C.cp38-win_amd64.pyd /IMPLIB:C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\_C.cp38-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'C:\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\build\temp.win-amd64-3.8\Release\Users\USER\AppData\Local\Temp\pip-req-build-9z8ky448\detectron2\layers\csrc\vision.obj'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\users\user\appdata\local\programs\python\python38\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
return stream.closed
ValueError: underlying buffer has been detached
----------------------------------------
ERROR: Failed building wheel for detectron2
Please help me
I had a similar issue. Finally, I solved it buy:
Deleting build directory in Detectron2 (rm -rf build/ **/*.so)
cd to the Detectron2 and pip install -e.
It builds the wheel again.

How to get Poppler running on Windows

I want to install the pdftotext library for python3. For this, I need Poppler. Now, there is a question regarding this (How to install Poppler on Windows?) but the answers do not work for me. Specifically, when I write
conda install -c conda-forge poppler
it tells me that it is looking for conflicts. After quite a long time, it finished successfully but when I then try to run pip3 install pdftotext it tells me
`...
C4514: '_cwscanf_s_l': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_wconio.h(411): warning C4514: '_cwscanf_s': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(180): warning C4514: 'fwide': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(189): warning C4514: 'mbsinit': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(209): warning C4514: 'wmemcmp': unreferenced inline function has been removed
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\wchar.h(268): warning C4514: 'wmemchr': unreferenced inline function has been removed
creating C:\Users\l\AppData\Local\Temp\pip-install-hyxyhu1h\pdftotext\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\l\appdata\local\programs\python\python37\libs /LIBPATH:c:\users\l\appdata\local\programs\python\python37\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\lib\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" poppler-cpp.lib /EXPORT:PyInit_pdftotext build\temp.win-amd64-3.7\Release\pdftotext.obj /OUT:build\lib.win-amd64-3.7\pdftotext.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\pdftotext.cp37-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'poppler-cpp.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181
ERROR: Command errored out with exit status 1: 'c:\users\l\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\l\\AppData\\Local\\Temp\\pip-install-hyxyhu1h\\pdftotext\\setup.py'"'"'; __file__='"'"'C:\\Users\\l\\AppData\\Local\\Temp\\pip-install-hyxyhu1h\\pdftotext\\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\l\AppData\Local\Temp\pip-record-rhe9mc37\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\l\appdata\local\programs\python\python37\Include\pdftotext' Check the logs for full command output.`
I have also tried the apprachwith copying to program files but that gave me the same result. Any suggestions on what I might do to fix this?

Having Problem Installing Pyopencl on Windows 10 Machine Using Pip

i am trying to install pyopencl with Python but i am getting the following console output
please help me solve this issue I have already included the opencl.lib path to my env variables.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\mihir\appdata\local\programs\python\python36\libs /LIBPATH:c:\users\mihir\appdata\local\programs\python\python36\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" OpenCL.lib /EXPORT:PyInit__cl build\temp.win-amd64-3.6\Release\src/wrap_constants.obj build\temp.win-amd64-3.6\Release\src/wrap_cl.obj build\temp.win-amd64-3.6\Release\src/wrap_cl_part_1.obj build\temp.win-amd64-3.6\Release\src/wrap_cl_part_2.obj build\temp.win-amd64-3.6\Release\src/wrap_mempool.obj build\temp.win-amd64-3.6\Release\src/bitlog.obj /OUT:build\lib.win-amd64-3.6\pyopencl\_cl.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\src\_cl.cp36-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'OpenCL.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181
----------------------------------------
Command "c:\users\mihir\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MIHIR\\AppData\\Local\\Temp\\pip-install-82kaln2a\\pyopencl\\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\MIHIR\AppData\Local\Temp\pip-record-jp0yo2ti\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MIHIR\AppData\Local\Temp\pip-install-82kaln2a\pyopencl\
Almost 100% of the times when I get Visual Studio errors when using pip I fetch the wheel file of the module I wish to install, then use pip on that local file.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl
The link I provided will take you to the pyopencl area, this website is a wheel repository for many modules, I used it to install PyCairo as well when it was giving me VS errors. Select the pyopencl module that matches your Python version (For Python 3.7 it will be -cp37-), then select what OpenCL version you wish to use (For CL 2.1 it is +cl21-), then lastly select "amd64" or "win32" if you're on a 64-bit or 32-bit OS. Once you have the file downloaded point pip in the direction of the file, example command: pip install C:\Users\Mihir\Downloads\pyopencl-2018.2.2+cl21-cp37-cp37m-win_amd64.whl that will then install module (Treat a wheel file like a compressed ZIP or TAR). Make sure you have pyopencl prerequisites, which are numpy and cffi (It says Mako too, but I think it works without it).
I faced same problem and i couldn't install pyopencl. I was using python 3.7 in 64 bit windows. So i used pyopencl‑2018.2.5+cl21‑cp37‑cp37m‑win_amd64.whl version. But unfortunately it didn't work.
So i tried with pyopencl‑2018.2.5+cl21‑cp37‑cp37m‑win32.whl version and then it installed successfully.
Put pyopencl-2018.2.2+cl21-cp37-cp37m-win_amd64.whl in System32,
then tap in the power shell
pip install pyopencl-2020.3.1+cl21-cp39-cp39-win_amd64.whl

python pylibmc not installing

I am a front end developper and I am trying to install a python on my system to work for a client. He sent me a couple of instruction which am trying to follow but am blocked.
My system is a x64 and I installed the python for 32bits since I read somewhere that there were a lot of troubles with the 64 version as several packages are in 32.
here is a couple of lines of the error I have :
s-oauthlib>=0.3.0->django-allauth==0.18.0->-r requirements\base.txt (line 23))
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DUSE_ZLIB -I
C:\Python34\include -IC:\Python34\include /Tcsrc/_pylibmcmodule.c /Fobuild\temp.win32-3.4\Release\src/_pylibmcmodule.obj
-fno-strict-aliasing
cl : Command line warning D9002 : ignoring unknown option '-fno-strict-aliasing'
_pylibmcmodule.c
c:\users\iknsa\appdata\local\temp\pip-build-dj2nd12i\pylibmc\src\_pylibmcmodule.h(42) : fatal error C1083: Cannot op
en include file: 'libmemcached/memcached.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\iknsa\\AppD
ata\\Local\\Temp\\pip-build-dj2nd12i\\pylibmc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\iknsa\AppData\Local\Temp\pip-f29lv3f2-record\install
-record.txt --single-version-externally-managed --compile:
running install
which the ends with these lines :
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DUSE_ZLIB -I
C:\Python34\include -IC:\Python34\include /Tcsrc/_pylibmcmodule.c /Fobuild\temp.win32-3.4\Release\src/_pylibmcmodule.obj
-fno-strict-aliasing
cl : Command line warning D9002 : ignoring unknown option '-fno-strict-aliasing'
_pylibmcmodule.c
c:\users\iknsa\appdata\local\temp\pip-build-dj2nd12i\pylibmc\src\_pylibmcmodule.h(42) : fatal error C1083: Cannot op
en include file: 'libmemcached/memcached.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Any help would be most welcome
You can get the most recent version of libmemcached from its Launchpad download page.
With this, make sure that all headers are available from the include search path, which in your case would be C:\Python34\include (as hinted by the output); you could also place them in the search path of your compiler (which for MinGW's gcc would be something like mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include).
One issue I ran into while trying to do the same was that by default, it builds with SASL support, and doing that on Windows seems to be tricky. You can build libmemcached without SASL support by changing libmemcached\configure.h:45 to #define LIBMEMCACHED_WITH_SASL_SUPPORT 0 (as of version 1.0.18).

Categories

Resources