How to fix pip install error for all modules? - python

I have been trying to install beeware all day, but I keep getting the error
failed with error code 1 in C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\
Seeing that this error had something to do with pythonnet, I tried installing that using
pip install pythonnet
I then get the same error, I'll paste everything cmd says below
C:\Users\dmcga>pip install pythonnet
Collecting pythonnet
Using cached
https://files.pythonhosted.org/packages/89/3b/
a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-
2.3.0.tar.gz
Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
Complete output from command
c:\users\dmcga\appdata\local\programs\python\python37-32\python.exe -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\dmcga\\AppData\\Local\\Temp\\pip-install-
snn9ad__\\pythonnet\\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\dmcga\AppData\Local\Temp\pip-
record-33b2bjj0\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.5.0.
Updating NuGet.exe to 4.9.2.
Update successful.
MSBuild auto-detection: using msbuild version '4.0' from
'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
Restoring NuGet package NUnit.3.6.0.
Restoring NuGet package UnmanagedExports.1.2.7.
Restoring NuGet package NUnit.ConsoleRunner.3.6.0.
Adding package 'UnmanagedExports.1.2.7' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Adding package 'NUnit.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Adding package 'NUnit.ConsoleRunner.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'UnmanagedExports.1.2.7' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'NUnit.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
NuGet Config files used:
C:\Users\dmcga\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
C:\Users\dmcga\.nuget\packages\
https://api.nuget.org/v3/index.json
Installed:
3 package(s) to packages.config projects
Traceback (most recent call last):
File "tools\geninterop\geninterop.py", line 24, in <module>
from pycparser import c_ast, c_parser
ModuleNotFoundError: No module named 'pycparser'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\setup.py", line 405, in <module>
zip_safe=False,
File "c:\users\dmcga\appdata\local\programs\python\python37-32\lib\site-
packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-32\lib\site-
packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 473, in
_build_extensions_serial
self.build_extension(ext)
File "C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\setup.py", line 191, in build_extension
subprocess.check_call([sys.executable, geninterop, interop_file])
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command
'['c:\\users\\dmcga\\appdata\\local\\programs\\python\\python37-
32\\python.exe', 'tools\\geninterop\\geninterop.py',
'src\\runtime\\interop37.cs']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\dmcga\appdata\local\programs\python\python37-32\python.exe
-u -c "import setuptools,
tokenize;__file__='C:\\Users\\dmcga\\AppData\\Local\\Temp\\pip-install-
snn9ad__\\pythonnet\\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\dmcga\AppData\Local\Temp\pip-
record-33b2bjj0\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\dmcga\AppData\Local\Temp\pip-
install-snn9ad__\pythonnet\
I am using Python 3.7, pip 19.0.1, Windows 10
This seems to be occurring with almost all modules that I attempt to install, I tried a fresh install of python, but still am getting this error.

Related

Cannot install jamspell on macOS Big Sur via pip?

I followed the instructions on how to install JamSpell spell checking library.
I installed swig by running brew install swig (v. 4.0.2), but I cannot manage to install the library with pip install jamspell on macOS Big Sur, Python3 (not even with sudo).
Error log:
WARNING: The directory '/Users/ljudmilapetkovic/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
WARNING: Ignoring invalid distribution -cwidth (/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -cwidth (/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages)
Collecting jamspell
Downloading jamspell-0.0.12.tar.gz (174 kB)
|████████████████████████████████| 174 kB 4.1 MB/s
Building wheels for collected packages: jamspell
Building wheel for jamspell (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/ljudmilapetkovic/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-bw5_k9h5
cwd: /private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/
Complete output (41 lines):
running bdist_wheel
running build
running build_ext
building '_jamspell' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 55, in <module>
setup(
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 37, in run
self.run_command('build_ext')
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 506, in build_extension
sources = self.swig_sources(sources, ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 597, in swig_sources
swig = self.swig or self.find_swig()
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 50, in find_swig
assert subprocess.check_output([swigBinary, "-version"]).find(b'SWIG Version 3') != -1
AssertionError
----------------------------------------
ERROR: Failed building wheel for jamspell
Running setup.py clean for jamspell
Failed to build jamspell
WARNING: Ignoring invalid distribution -cwidth (/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages)
Installing collected packages: jamspell
Running setup.py install for jamspell ... error
ERROR: Command errored out with exit status 1:
command: /Users/ljudmilapetkovic/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-lu0nx9hk/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ljudmilapetkovic/opt/anaconda3/include/python3.8/jamspell
cwd: /private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/
Complete output (34 lines):
running install
running build_ext
building '_jamspell' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 55, in <module>
setup(
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 43, in run
self.run_command('build_ext')
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 506, in build_extension
sources = self.swig_sources(sources, ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 597, in swig_sources
swig = self.swig or self.find_swig()
File "/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py", line 50, in find_swig
assert subprocess.check_output([swigBinary, "-version"]).find(b'SWIG Version 3') != -1
AssertionError
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/ljudmilapetkovic/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_wxwt5tq/jamspell_2c920e7dbac74937875274f33ed536c4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-lu0nx9hk/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ljudmilapetkovic/opt/anaconda3/include/python3.8/jamspell Check the logs for full command output.
WARNING: Ignoring invalid distribution -cwidth (/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -cwidth (/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages)
python setup.py install does not help either:
running install
running build_ext
building '_jamspell' extension
Traceback (most recent call last):
File "setup.py", line 55, in <module>
setup(
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 43, in run
self.run_command('build_ext')
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 506, in build_extension
sources = self.swig_sources(sources, ext)
File "/Users/ljudmilapetkovic/opt/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 597, in swig_sources
swig = self.swig or self.find_swig()
File "setup.py", line 50, in find_swig
assert subprocess.check_output([swigBinary, "-version"]).find(b'SWIG Version 3') != -1
AssertionError
What is going on here?
Having encountered this same exact problem with your same desktop specs, this thread should fix your problem. It took a long while for me to find this buried discussion, but since your post came up at the very top of my original search results, I'm hoping that keeping this up can guide other people to a solution much more quickly.
I'm linking it here but also including the solution that worked for me:
Manually download swig3 via sourceforge
Extract the zipped download folder
Run the following via terminal:
Downloads/swig-3.0.12/configure && make && make install
Running this command will display a very long output and take ~1 minute
Run pip install jamspell
Terminal may appear to "hesitate" for a second longer than it would with the normal installation process before building wheels for the package:
It'll tell you the package has been installed, but you will not see the usual:
Downloading jamspell-0.0.12.tar.gz (174 kB) |████████████████████████████████| 174 kB 4.1 MB/s
An alternative is, if you just run the package via Co-Lab, it'll work. The only downside I suppose is that you'll have to reinstall the package every time you reconnect.

How to solve CMake must be installed to build the following extensions: dlib in PyCharm?

Facing the following error while installing dlib for the OpenCV project. It shows that
CMake must be installed to build the following extensions: dlib.
Command Output:
Collecting dlib==19.18.0
Using cached dlib-19.18.0.tar.gz (3.1 MB)
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib'
cwd: C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\
Complete output (57 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Traceback (most recent call last):
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\Install Drive\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\Install Drive\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\Install Drive\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\Install Drive\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 223, in <module>
setup(
File "D:\Install Drive\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\Install Drive\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Install Drive\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\Install Drive\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 122, in get_cmake_version
raise RuntimeError("\n*******************************************************************\n" +
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Install Drive\python.exe -m pip install --upgrade pip' command.
Notice that in the output that "CMake must be installed to build the following extensions: dlib". So install CMake first and only then try to install dlib. If CMake is installed, try updating your pip version to 21.1.2 via "D:\Install Drive\python.exe -m pip install --upgrade pip".
It requires cmake must be installed before installing dlib. Do execute in the following order.
pip install cmake
pip install dlib
This will fix the issue.

how to install dlib library in anaconda?

Collecting dlib
Using cached dlib-19.19.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda\envs\env_dlib\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\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\HP\AppData\Local\Temp\pip-wheel-sam_vsqz'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\
Complete output (53 lines):
running bdist_wheel
running build
running build_py
package init file 'dlib__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 800, in init
restore_signals, start_new_session)
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 261, in
'Topic :: Software Development',
File "D:\anaconda\envs\env_dlib\lib\site-packages\setuptools__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "D:\anaconda\envs\env_dlib\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\anaconda\envs\env_dlib\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "D:\anaconda\envs\env_dlib\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\anaconda\envs\env_dlib\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\anaconda\envs\env_dlib\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
CMake must be installed to build the following extensions: dlib
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda\envs\env_dlib\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\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\HP\AppData\Local\Temp\pip-record-77ybyx6j\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\anaconda\envs\env_dlib\Include\dlib'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\
Complete output (55 lines):
running install
running build
running build_py
package init file 'dlib__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 800, in init
restore_signals, start_new_session)
File "D:\anaconda\envs\env_dlib\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "D:\anaconda\envs\env_dlib\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "D:\anaconda\envs\env_dlib\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\anaconda\envs\env_dlib\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\anaconda\envs\env_dlib\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "D:\anaconda\envs\env_dlib\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\anaconda\envs\env_dlib\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\anaconda\envs\env_dlib\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\env_dlib\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\anaconda\envs\env_dlib\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-hlayhizn\dlib\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\HP\AppData\Local\Temp\pip-record-77ybyx6j\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\anaconda\envs\env_dlib\Include\dlib' Check the logs for full command output.
Run the following command in Anaconda Prompt.
easy_install dlib

How can I solve Error of installation Dlib?

How I can install dlib. I tried to install dlib in many way but it's alway error.
Got an error:
ERROR: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\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\hommy\AppData\Local\Temp\pip-wheel-5e3dfpnu' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/hommy/AppData/Local/Temp/pip-install-c_rc8wfx/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\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\hommy\AppData\Local\Temp\pip-record-ik12xcpk\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/hommy/AppData/Local/Temp/pip-install-c_rc8wfx/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command "'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\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\hommy\AppData\Local\Temp\pip-record-ik12xcpk\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\
Anaconda is available from, https://www.anaconda.com/distribution/#download-section
conda instruction are, https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
Dlib is support with python 3.6 to 3.7.0 version s.Try to install the dlib in anaconda prompt by following command.,
step 1:
conda create -n env_name python=3.7.0
step 2:
conda activate env_name
step 3:
conda install -c conda-forge dlib=19.17
-c is stands for channel, conda-forge is one of channels.
you can find all supported packages for conda's in this link https://repo.anaconda.com/pkgs/main/win-64/

Python 2.7 - error installing MySQL-Python on Windows 8

I have been beating my head against a wall on this for 2+ days and am making no progress.
I am trying to install the Python MySQL connectors on my Windows 8 (hate Windows 8) box.
I am using Python 2.7. I originally received an error:
vcvarsall.bat is not found.
I did some research and found that I needed VS 2008 (VC++ compiler) installed on my box and I installed the express version. I also added ProductDir value with the path to vcvarsall.bat to the following key in my registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC.
I also added the VS90COMNTOOLS environment variable with the path to vcvarsall.bat. I am still getting an error when I run the following:
pip install MySQL-python
Any input you can provide is most appreciated... Thanks...
The error is listed in the following snippet from the pip.log:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\t\appdata\local\temp\pip_build_T\MySQL-python\setup.py", line 21, in <module>
setuptools.setup(**metadata)
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\install.py", line 53, in run
File "C:\Python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\build_ext.py", line 52, in run
File "C:\Python27\lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "C:\Python27\lib\distutils\command\build_ext.py", line 446, in build_extensions
self.build_extension(ext)
File "build\bdist.win-amd64\egg\setuptools\command\build_ext.py", line 186, in build_extension
File "C:\Python27\lib\distutils\command\build_ext.py", line 496, in build_extension
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
----------------------------------------
Cleaning up...
Removing temporary dir c:\users\t\appdata\local\temp\pip_build_T...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\t\\appdata\\local\\temp\\pip_build_T\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\t\appdata\local\temp\pip-d5hmns-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\t\appdata\local\temp\pip_build_T\MySQL-python
Exception information:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\commands\install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:\Python27\lib\site-packages\pip-1.5.4-py2.7.egg\pip\util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\t\\appdata\\local\\temp\\pip_build_T\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\t\appdata\local\temp\pip-d5hmns-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\t\appdata\local\temp\pip_build_T\MySQL-python
The pip install failure suggests there is some underlying dependency on compiled files. An alternative would be to use the .exe installer from https://pypi.python.org/pypi/MySQL-python - but this isn't suitable for virtualenvs, and will fail for 64-bit Python (it will complain that it can't find Python 2.7 in the registry even though it is installed).
Luckily, Christoph Gohlke maintains some unofficial Windows binaries which are pip-installable. You can find them at at http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
You can now call pip install C:/PATH/TO/MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl from your main Python environment, or a virtualenv.
Ideally, wheels like these will be made available via the MySQL-python PyPI page, at which point a simple pip install will work.
(This answer is based on Carsten's helpful comments.)

Categories