Error installing MySQL-python: Unable to find vcvarsall.bat - python

I was trying to install mysql-python using pip
I'm getting the following error:
error: Unable to find vcvarsall.bat
----------------------------------------
Failed building wheel for mysql-python
...
...
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\hp\\appdata\\local\\temp\\pip-build-
jy5yhb\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)
(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record
c:\users\hp\appdata\local\temp\pip-jditig-record\install-record.txt --single-
version-externally-managed --compile" failed with error code 1 in
c:\users\hp\appdata\local\temp\pip-build-jy5yhb\mysql-python\
Background works did:
Installed MySQL from official website(link)
Installed SQLite3
Installed Visual C++ Redistributable 2008, 2010, 2013, 2015
Installed C++ Compiler for python (latest)
I have tried all the answers that already exist in Stack Overflow and other Websites, nothing helped.
Context:
I'm trying to run a Django server in my laptop, for which I need mysql-python.
(OS: Windows 10)

Related

Error when Installing simplecrypto on Windows

I am trying to install the Python module simplecrypto on a Windows machine. To do this I run the following:
C:\Python36\Scripts>pip install simplecrypto
However, upon running this partway through the installation process I receive the following error:
...
Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\EDM-P\\AppData\\Local\\Temp\\pip-build-teqxfnwt\\PyCrypto\\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\EDM-P\AppData\Local\Temp\pip-nrmsip8r-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\EDM-P\AppData\Local\Temp\pip-build-teqxfnwt\PyCrypto\
Why is this the case?
An error occurs when it attempts to install PyCrypto, which is a requirement of the package. The GitHub README mentions:
If the dependency installation fail on Windows, you may want to use a
prebuilt installer. If you wish to compile it I suggest using the
Mingw tools as indicated here.
Install it from here and then compile by
install MinGW with C++ Compiler option checked add C:\MinGW\bin to
your PATH in PYTHONPATH\Lib\distutils, create a file distutils.cfg and
add these lines:
[build] compiler=mingw32

Installing Twisted for Python 3.6.1 on Windows got error missing file in Windows SDK

I tried to install Twisted using pip
pip3 install Twisted
However I got the following errors
running build_ext
building 'twisted.test.raiser' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1\\lib'
----------------------------------------
Command "c:\python361\python.exe -u -c "import setuptools, tokenize;__file__='C:
\\Users\\User\\AppData\\Local\\Temp\\pip-build-32gww8wb\\twisted\\setup.py';f=ge
tattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.cl
ose();exec(compile(code, __file__, 'exec'))" install --record C:\Users\User\AppD
ata\Local\Temp\pip-f8823kmo-record\install-record.txt --single-version-externall
y-managed --compile" failed with error code 1 in C:\Users\User\AppData\Local\Tem
p\pip-build-32gww8wb\twisted\
I checked the directory in my computer, I indeed do not have the lib folder in path C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1. I have downloaded Visual Studio 2015 Community but it does not solve the problem.
Is there any thing I need to set after downloading Visual Studio ?
How to solve this problem ?
Updated:
I want to compile this program https://github.com/KDE/kajongg which require me to install Twisted.

pip install tesserocr on windows 10 gives error

I am trying to install tesserocr package for python on Windows10 host OS
i am getting following error
pip install tesserocr
execution
pip install tesserocr
Collecting tesserocr
Using cached tesserocr-2.1.3.tar.gz
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command "C:\Program Files\Anaconda3\python.exe" -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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\tmpoyt9eh40pip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_ext
Failed to extract tesseract version from executable: [WinError 2] The
system cannot find the file specified
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'],
'cython_compile_time_env': {'TESSERACT_VERSION': 197632}}
cythoning tesserocr.pyx to tesserocr.cpp
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-
build-tools
----------------------------------------
Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
Complete output from command "C:\Program Files\Anaconda3\python.exe" -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_ext
Failed to extract tesseract version from executable: [WinError 2] The system cannot find the file specified
Supporting tesseract v3.04.00
Building with configs: {'cython_compile_time_env': {'TESSERACT_VERSION': 197632}, 'libraries': ['tesseract', 'lept']}
skipping 'tesserocr.cpp' Cython extension (up-to-date)
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command ""C:\Program Files\Anaconda3\python.exe" -u -c "import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pip-
build-klj3zdup\tesserocr\
how to overcome this isuue?
As you can see from the error log, the problem here is that on your machine is missing Microsoft Visual C++ 14.0.
To fix this problem, simply install it, follow the link that you find in the traceback (this one), and try again with the command
pip install tesserocr
Reload Python directly with Anaconda, and use:
conda install -c simonflueckiger tesserocr

Cassandra driver error in installing

I am getting following error in installing Cassandra driver for python.
Command "c:\python33\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\vmasama\\appdata\\local\\temp\\pip-build-we10p7\\cassandra-driver\\setup
.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n
', '\n'), __file__, 'exec'))" install --record c:\users\vmasama\appdata\local\te
mp\pip-olh8j5-record\install-record.txt --single-version-externally-managed --co
mpile" failed with error code 1 in c:\users\vmasama\appdata\local\temp\pip-build
-we10p7\cassandra-driver\
Any one have any idea about this ? What am i missing ?
Following errors were also there when i run pip install cassandra-driver
Failed building wheel for cassandra-driver
Failed cleaning build dir
for cassandra-driver
python version : 3.3
I tried it in an environment missing compiler paths and observed something similar. I think it's a problem in setuptools error handling when it doesn't find what it's expecting. The easiest way I've found is to use the VS Command Prompt shortcut installed with Visual Studio:
Perhaps the easiest way to do this is to run the build/install from a Visual Studio Command Prompt (a shortcut installed with Visual Studio that sources the appropriate environment and presents a shell).
http://datastax.github.io/python-driver/installation.html#windows-installation-notes

Python, failed to install. Exit code: 1 windows 10

So, I have going over this back and forth, I tried several of the solutions on this forum, none worked.
I have pip3 installed, Python 3.4, Visual Studio 2015 on Windows 10.
Now whenever I run the installing for a new module manually or through pip3 I get the following error:
Say I use the cmdline as such:
pip3 install numpy
I get :
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\users\ariel\appdata\local\programs\python\python35-32\python.exe -c
"import setuptools, tokenize;__file__='C:\\Users\\Ariel
\\AppData\\Local\\Temp\\pip-build-41rz6w_o\\numpy\\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))" install --record
C:\Users\Ariel\AppData\Local\Temp\pip-vuq3ap0m-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1
in C:\Users\Ariel\AppData\Local\Temp\pip-build-41rz6w_o\numpy
If I download it and run it from the folder
setup.py install
I get
build_src
building py_modules sources
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat
Please help, considering to just use linux with python... less issues
This is based on #Jim answers in the comment section, basically make sure that you have the C++ compiler and windows SDK installed!
My problem was that when I installed Visual Studio, I did not select the windows SDK.

Categories