Having Problem Installing Pyopencl on Windows 10 Machine Using Pip - python

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

Related

Why 64-bit `pip install MySQL-python` refers to `C:\Program Files (x86)\`?

On Windows, with a 64-bit Python environment, pip install MySQL-python consists of a call to Visual C++ for Python for compiling source code. By default, this call always gives wrong parameters telling the compiler to look into C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\ for include .h files and .lib files. C:\Program Files (x86)\ contains 32-bit resources, not for 64-bit.
As a workaround, I fully installed 64-bit version of MySQL Connector C in customized location given in example below, and called pip install command with --global-option to specify paths of include and lib files. See the example command:
pip install MySQL-python ^
--force-reinstall --no-cache-dir ^
--global-option=build_ext ^
--global-option="-IC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\include" ^
--global-option="-LC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\lib\opt" ^
--verbose
My question is:
Why does pip install MySQL-python by default always look into the wrong directory of C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\ with 64-bit Python? Is this a bug, or did I miss any setting? Inputs will be highly appreciated.
Part of screen outputs relevant to compiler call:
...
Created temporary directory: c:\users\admini~1\appdata\local\temp\pip-record-us8ukn
Running setup.py install for MySQL-python ... Running command 'C:\my\test-pip\venv-
x64\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'c:\\users\\admini~1\\appdata\\local\\temp\\pip-install-2tppyl\\mysql-python\\setup.py'"'"';
__file__='"'"'c:\\users\\admini~1\\appdata\\local\\temp\\pip-install-2tppyl\\mysql-
python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__,
'"'"'exec'"'"'))' build_ext '-IC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\include' '-
LC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\lib\opt' install --record
'c:\users\admini~1\appdata\local\temp\pip-record-us8ukn\install-record.txt' --single-version-externally-
managed --compile --install-headers 'C:\my\test-pip\venv-x64\include\site\python2.7\MySQL-python'
running build_ext
building '_mysql' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
C:\Users\Administrator\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -
D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" "-
IC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\include" -IC:\my\test-pip\venv-x64\include -IC:\my\test-
pip\venv-x64\PC /Tc_mysql.c /Fobuild\temp.win-amd64-2.7\Release\_mysql.obj /Zl
_mysql.c
...
As you see above, it tells the compiler to refer to "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" even if the path doesn't exist. If interesting, please also refer to another post of mine.
I faced such kind of issues earlier. Couple of things to check immediately,
Check the PATH environment variable. Ensure 64 bit python is in the PATH. Get rid of other python references from PATH variable.
Start -> Run. Type %userprofile%\AppData\Roaming\Python. Usually Python will install scripts in this location. Ensure there are redundancies.
If above steps doesn't fix, I can add more steps based on above outcome. Good luck.

Unable to install pyAudio package

I am building a speech recognition program but can't install pyAudio.
I have installed Microsoft visual c++ 14.0.0 but still, I am getting another error. I can't understand what is going wrong here please help me out.
ERROR: Command errored out with exit status 1:
command: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\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\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\udit\AppData\Local\Temp\pip-install-68co_fpl\pyaudio\
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
b'\\\x00C\x00o\x00m\x00m\x00o\x00n\x00 \x00w\x00a\x00s\x00 \x00u\x00n\x00e\x00x\x00p\x00e\x00c\x00t\x00e\x00d\x00 \x00a\x00t\x00 \x00t\x00h\x00i\x00s\x00 \x00t\x00i\x00m\x00e\x00.\x00\r\x00\n\x00'
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\udit\appdata\local\programs\python\python37-32\include -Ic:\users\udit\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Include" "-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\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\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\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
These are notes for installation on Microsoft Windows:
pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6. For those versions, both 32-bit and 64-bit wheels are available.
You are using Python 3.7, which is not compatible with PyAudio. However...
EDIT:
As user #Dalen states, there are prebuilt binaries (.exe files) for pyAudio. I installed from their archive stated in documentation but importing pyAudio had an output:
There are unofficial binaries for Windows on this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio .
Download the proper one and install it.
Download the binary installer for Windows and just install the PyAudio package with no nonsense.
PyAudio is built on top of portaudio library and you require portaudio to be there. The binary installer comes with precompiled version of portaudio as a dynamically linked library and there is no need for hunting and compiling the source.
PyAudio is a great library, enjoy working with it.
pip install pipwin
pipwin install pyaudio
Try these commands in prompt. It does not require any manual downloads or searches etc.
pipwin is a complementary tool for pip on Windows. It is capable of installing unofficial python package binaries for Windows provided by Christoph Gohlke
the key info in the error message is "Cannot open include file: 'portaudio.h': No such file or directory"
so you should google it, and you will find it have an answer in stackoverflow:
https://stackoverflow.com/a/52191687/5232323
the current version PyAudio 0.2.11 is not supported for Python 3.7

Getting error while installing pyaudio in windows 10

I am a beginner in python language. I have written a test function in python for converting speech-to-text :
def getAudioFromMicrophone():
r = sr.Recognizer()
with sr.Microphone() as source:
lets_talk.in_female_voice('I am ready for your next command')
r.pause_threshold=1
r.adjust_for_ambient_noise(source,duration=1)
return r.listen(source)
When I run it, it says :
File "D:/PycharmProjects/python-modules/jarvis/jarvis.py", line 5,
in
import pyaudio ModuleNotFoundError: No module named 'pyaudio'
So, I am trying to install pyaudio in my windows 10 which is again showing an error.
Collecting pyaudio Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Installing collected packages: pyaudio Running setup.py install for pyaudio: started
Running setup.py install for pyaudio: finished with status 'error'
Complete output from command D:\softwares\python-compiler\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\username\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\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\username\AppData\Local\Temp\pip-record-9qmland0\install-record.txt
--single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
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 -DMS_WIN64=1
-ID:\softwares\python-compiler\include -ID:\softwares\python-compiler\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" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
d:\softwares\python-compiler\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.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
----------------------------------------
Command "D:\softwares\python-compiler\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\username\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\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\username\AppData\Local\Temp\pip-record-9qmland0\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\username\AppData\Local\Temp\pycharm-packaging\pyaudio\ You are using pip version 18.1, however version 19.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Any sort of help will be appreciated!
This is a problem with Python 3.7 because there isn't a PyAudio wheel for this version of Python for pip to find. To solve this, download a wheel that fits your computer's specs from here. Now, navigate to the folder the wheel was downloaded to in the command prompt and run: pip install (name of the .whl file here). This should work fine if you are on Windows and using Python 3.7.
I got this information from this post.
Try below commands to install the pyaudio on "Windows 10".
pip install pipwin
pipwin install pyaudio
Follow the steps
Step1. Download the PyAudio-0.2.11-cp310-cp310-win_amd64.whl from this link https://pypi.bartbroe.re/pyaudio
Step2. Use the following comand in cmd pip install (path to the file)/PyAudio-0.2.11-cp310-cp310-win_amd64.whl
Now it will install in my case hope this will help you too.

PyAudio failed to install on Windows 10

When I am trying to install PyAudio using
pip install pyaudio
I get this error:
C:\Users\pankajkaun>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command c:\users\pankajkaun\desktop\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PANKAJ~1\\AppData\\Local\\Temp\\pip-install-pw8_ueh5\\pyaudio
\\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\PANKAJ~1\AppData\Local\Temp
\pip-record-eru_9orv\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
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 -DMS_WIN64=1 -Ic:\users\pankajkaun\desktop\python\include -Ic:\users\pankajkaun\desktop\python\
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" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
c:\users\pankajkaun\desktop\python\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.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
----------------------------------------
Command "c:\users\pankajkaun\desktop\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PANKAJ~1\\AppData\\Local\\Temp\\pip-install-pw8_ueh5\\pyaudio
\\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\PANKAJ~1\AppData\Local\Temp\pip-record-eru_9orv\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\PANKAJ~1\AppData\Local\Temp\pip-install-pw8_ueh5\pyaudio\
Any idea what's going on in here?
Try this (in admin mode command prompt):
pip install pipwin
pipwin install pyaudio
pipwin is like pip, but it installs precompiled Windows binaries provided by Christoph Gohlke. Saves you a lot of googling and manual downloading.
According to official docs of pyaudio:
Microsoft Windows
Install using pip:
python -m pip install pyaudio
Notes: pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6. For those versions, both 32-bit and 64-bit wheels are available.
You try to install pyaudio for 3.7, so it try to compile it.
Download and install wheel from Gohlke - Unofficial Windows Binaries for Python Extension Packages. Wheels for 32 and 64-bit python 3.7 are available.
Use this link to download the .whl file according to the python version it supports:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Then, go to the following directory and run this command on the command prompt:
C:\Users\shris\AppData\Local\Programs\Python\Python37-32\Scripts> pip install PyAudio-0.2.11-cp37-cp37m-win32.whl
Run CMD as admin then run the following two commands:
pip install pipwin
pipwin install pyaudio
I had the same issue and I solved it by using the WHL file which you can download from:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio.
There are several versions that you can download and use.
For example, PyAudio-0.2.11-cp37-cp37m-win_amd64.whl.
For installing purposes on the command prompt, write
pip install "path"\PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
It seems you need to install portaudio first.
Here is my computer configuration:
Windows 10
Python 3.8.0 installed on C:\Program Files (x86)\Python\Python38-32
I've got the same issue and i solved it with these steps:
download PyAudio‑0.2.11‑cp38‑cp38‑win32.whl from here on my computer in C:\Downloads\PyAudio-0.2.11-cp38-cp38-win32.whl
run C:\Program Files (x86)\Python\Python38-32\Scripts>pip3.8 install C:\Downloads\PyAudio-0.2.11-cp38-cp38-win32.whl --user

lxml error in python3.4 installation

I'm trying to run the following command in command prompt -
pip install -r requirements.txt
But it shows so many errors and I have no idea how to resolve them as I'm not familiar with python.
The errors are:
1.
Collecting lxml==3.5.0 (from -r requirements.txt (line 1))
Using cached lxml-3.5.0.tar.gz
Collecting pyquery==1.2.10 (from -r requirements.txt (line 2))
Collecting cssselect>0.7.9 (from pyquery==1.2.10->-r requirements.txt (line 2))
Using cached cssselect-1.0.1-py2.py3-none-any.whl
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mohana\\AppData\\Local\\Temp\\pip-build-9bz1xoev\\lxml\\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\Mohana\AppData\Local\Temp\tmp425xg1fhpip-wheel- --python-tag cp34:
Building lxml version 3.5.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
2.
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe' failed with exit status 2
creating Users
creating Users\Mohana
creating Users\Mohana\AppData
creating Users\Mohana\AppData\Local
creating Users\Mohana\AppData\Local\Temp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /TcC:\Users\Mohana\AppData\Local\Temp\xmlXPathInitocb5oi7w.c /FoUsers\Mohana\AppData\Local\Temp\xmlXPathInitocb5oi7w.obj
xmlXPathInitocb5oi7w.c
C:\Users\Mohana\AppData\Local\Temp\xmlXPathInitocb5oi7w.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe' failed with exit status 2
3.
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, cssselect, pyquery
Found existing installation: lxml 4.0.0
Uninstalling lxml-4.0.0:
Successfully uninstalled lxml-4.0.0
Running setup.py install for lxml ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mohana\\AppData\\Local\\Temp\\pip-build-9bz1xoev\\lxml\\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\Mohana\AppData\Local\Temp\pip-rjvm3d2l-record\install-record.txt --single-version-externally-managed --compile:
Building lxml version 3.5.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
4.
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe' failed with exit status 2
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /TcC:\Users\Mohana\AppData\Local\Temp\xmlXPathInity8a5suic.c /FoUsers\Mohana\AppData\Local\Temp\xmlXPathInity8a5suic.obj
xmlXPathInity8a5suic.c
C:\Users\Mohana\AppData\Local\Temp\xmlXPathInity8a5suic.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe' failed with exit status 2
Please help me solve these issues, I need it for a project and I really need to get it done. I am on Windows 10 (Intel processors) and Python3.4.
As #SaeX says in this answer, you can find the precompiled
WHL of lxml with the required modules and dependencies here.
For Python 3.4 and win10 your file should be lxml‑4.1.0‑cp34‑cp34m‑win_amd64.whl. Then you can install it by using pip:
pip install lxml‑4.1.0‑cp34‑cp34m‑win_amd64.whl
For python 3.4 or above,
In command Prompt,
type pip3 install lxml in case if you want to download and install from network automatically
otheriwse, download .whl file of lxml from the below
For 32 bit : Download Here
For 64 bit : Download Here
After downloading the wheel file,navigate your command prompt to the location where the .whl file is downloaded and then try
pip3 install "downloaded whl file name"
For windows, you can install lxml by exe file if also failed by whl. You can download it from lxml
Hope this can help you.

Categories

Resources