I want to install Python-adb using pip V9.0.3.
When Im trying to install python-adb, but I always get the same error as you can see at the bottom.
I also tried it installing it per CMD with admin rights on pip/pip3.
What I already tried:
- CMD with/without admin rights
- pip/pip3 installation
- installed mingw for C++ errors
Im currently using Python3.6 on Windows 7 64Bit
Output:
Collecting python-adb
Using cached python_adb-1.1.1-py3-none-any.whl
Requirement already satisfied: libusb1>=1.0.16 in c:\users\alex\appdata\local\programs\python\python
36\lib\site-packages (from python-adb)
Collecting M2Crypto>=0.21.1 (from python-adb)
Using cached M2Crypto-0.29.0.tar.gz
Requirement already satisfied: six in c:\users\alex\appdata\local\programs\python\python36\lib\site-
packages (from python-adb)
Installing collected packages: M2Crypto, python-adb
Running setup.py install for M2Crypto ... error
Complete output from command c:\users\alex\appdata\local\programs\python\python36\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-build-nwjmz2a0\
\M2Crypto\\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\Alex\AppData\Local\Temp\
pip-1s9ml6zw-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
copying M2Crypto\ASN1.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\AuthCookie.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\BIO.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\BN.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\callback.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\DH.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\DSA.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\EC.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\Engine.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\Err.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\EVP.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\ftpslib.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\httpslib.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\m2.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\m2crypto.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\m2urllib.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\m2urllib2.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\m2xmlrpclib.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\Rand.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\RC4.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\RSA.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\six.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\SMIME.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\threading.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\util.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\X509.py -> build\lib.win-amd64-3.6\M2Crypto
copying M2Crypto\__init__.py -> build\lib.win-amd64-3.6\M2Crypto
creating build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\cb.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\Checker.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\Cipher.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\Connection.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\Context.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\Session.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\SSLServer.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\ssl_dispatcher.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\timeout.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\TwistedProtocolWrapper.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
copying M2Crypto\SSL\__init__.py -> build\lib.win-amd64-3.6\M2Crypto\SSL
running build_ext
building 'M2Crypto._m2crypto' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\SWIG
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /
GL /DNDEBUG /MD -Ic:\users\alex\appdata\local\programs\python\python36\include -Ic:\users\alex\appda
ta\local\programs\python\python36\include -IC:\Users\Alex\AppData\Local\Temp\pip-build-nwjmz2a0\M2Cr
ypto\SWIG "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x8
6)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\sha
red" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8
.1\include\winrt" /TcSWIG/_m2crypto_wrap.c /Fobuild\temp.win-amd64-3.6\Release\SWIG/_m2crypto_wrap.o
bj -D_CRT_SECURE_NO_WARNINGS -DTHREADING
_m2crypto_wrap.c
SWIG/_m2crypto_wrap.c(3557): fatal error C1083: Cannot open include file: 'openssl/err.h': No su
ch file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.ex
e' failed with exit status 2
----------------------------------------
Command "c:\users\alex\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, t
okenize;__file__='C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-build-nwjmz2a0\\M2Crypto\\setup.py';f=g
etattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(
code, __file__, 'exec'))" install --record C:\Users\Alex\AppData\Local\Temp\pip-1s9ml6zw-record\inst
all-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\A
lex\AppData\Local\Temp\pip-build-nwjmz2a0\M2Crypto\
Apparently M2Crypto (which is where your install process is failing) is kind of hard to install on Windows, but there are unofficial binaries available (though that is a dated question), and the package's own install instructions include a section on Windows installation.
More promisingly, there is a clone of the project here, which also has Windows instructions. But for that you'll need to have SWIG installed too.
A third option is this pair (32-bit, 64-bit) of packages that are clones of M2Crypto specifically made for Windows, but I'm not sure how up-to-date they are (the last commit was in 2014, so there might have been a lot of changes to the original project by now).
Currently there is no Debian package available for PyADB. (Will be fixed soon…)
[+] Debian Package: # #$ sudo dpkg -i python-pyadb_0.1.0-1_all.deb #Selecting previously unselected package python-pyadb. #(Leyendo la base de datos … 322039 ficheros o directorios instalados actualmente.) #Desempaquetando python-pyadb (de python-pyadb_0.1.0-1_all.deb) … #Configurando python-pyadb (0.1.0-1) … #
[+] easy_install
$ sudo easy_install pyadb Searching for pyadb … Processing dependencies for pyadb Finished processing dependencies for pyadb $
[+] setup.py
$ python setup.py build running build running build_py creating build creating build/lib.linux-i686-2.7 creating build/lib.linux-i686-2.7/pyadb copying pyadb/adb.py -> build/lib.linux-i686-2.7/pyadb copying pyadb/__init__.py -> build/lib.linux-i686-2.7/pyadb $ sudo python setup.py install running install running build running build_py running install_lib running install_egg_info Removing /usr/local/lib/python2.7/dist-packages/pyadb-0.1.1.egg-info Writing /usr/local/lib/python2.7/dist-packages/pyadb-0.1.1.egg-info $
More instructions: http://wiki.python.org/moin/CheeseShopTutorial
Usage:
$ python Python 2.7.3 (default, Jun 15 2012, 18:14:05) [GCC 4.7.0] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> from pyadb import ADB >>> adb = ADB(‘~/android/platform-tools/adb’) >>> print adb.pyadb_version() 0.1.1 >>> quit() $
You can view a “complete” example in “examples/whatsapp.py”
Related
So I downloaded Python 32 bits 1st, then I did
python -m pip install mysqlclient.
I needed Visual C++ 2015, but I had them cuz my text editors is VSCode.
I uninstalled VSCode, installed Visual Studio Build Tools, and I am getting this errors whenever I do python -m pip install mysqlclient.One, cl.exe wasnt added to my path, so I did, but it still says
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
so I downloaded the wheel package for windows, as some other stackoverflow answer said. Whenever I run it, I get
I tried downloading Python 64 bits downloading the wheels, adding cl.exe to path.
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\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\Patrik\AppData\Local\Temp\pip-wheel-o3ba369p' --python-tag cp37
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.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: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.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:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
It should just work and the package mysqlclient just be installed using pip so I can use it with django.
There isn't an official wheel for the current release 1.4.4, and you are getting errors when you try to install from source.
Since you use 64-bit Python on Windows, you could install 1.4.2.post1, because there is an official wheel for that version.
python -m pip install mysqlclient==1.4.2.post1
Or, you could download an unofficial wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient, which has wheels for the latest release for 32-bit and 64-bit Python on Windows. Unless you have a particular reason to use 32-bit Python, I suggest you use 64-bit.
For example, you could download mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl (Python 3.7 64-bit for Windows) then do:
python -m pip install mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl
I had a similar situation, and i did this:
sudo apt-get install python3-dev libmysqlclient-dev
afterward, inside a virtual environment:
pip3 install mysqlclient
and that was because, i had another problem with the instalation of:
pip3 install flask-mysqldb
You can use pymysql instead of mysqlclient
Install pymysql
pip install pymysql
Modify your init.py file
import pymysql
pymysql.install_as_MySQLdb()
You can start your project
FWIW: I also faced this problem on a macOS, with the error:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'xcrun' failed with exit status 1
A solution (borrowed from this related post) that worked for me was to fix the brew-installed openssl linking:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
So I am using Python 3.7 and trying to install the MYSQL Connector using:
pip install mysqlclient but getting the following error:
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\mariak~1\envs\py1\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MARIAK~1\\AppData\\Local\\Temp\\pip-install-maurmpl9\\mysqlclient\\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\MARIAK~1\AppData\Local\Temp\pip-record-kh605r0i\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\mariak~1\envs\py1\include\site\python3.7\mysqlclient:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying _mysql_exceptions.py -> build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" "-Ic:\users\maria kuona\appdata\local\programs\python\python37-32\include" "-Ic:\users\maria kuona\appdata\local\programs\python\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2**
I have the latest VStudio Build Tools 2017 installed. What could be the issue and how can I rectify it.
I am trying to use the pip install mysql-python command and I get the error below. I have no idea what this means someone please help. I have already updated my verison of pip and setuptools and wheels so I am at a loss. I get a big error message but only have the first half presented below.
C:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64>pip install mysql-python
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108kB)
100% |################################| 112kB 179kB/s
Building wheels for collected packages: mysql-python
Running setup.py bdist_wheel for mysql-python ... error
Complete output from command "C:\Users\Alex\Desktop\Cornell Stuff\Computer
Programs\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\python.exe" -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-build-
1kxb8j7_\\mysql-python\\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\Alex\AppData\Local\Temp\tmpzz01n6ylpip-wheel- --python-tag cp34:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying _mysql_exceptions.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.4\MySQLdb
creating build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-
3.4\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
C:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64\..\tools\mingw32\bin\gcc.exe -mdll -O -DMS_WIN64
-Wall -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:\Users\Alex\Desktop\Cornell Stuff\Computer Programs\WinPython-64bit-
3.4.3.3\python-3.4.3.amd64\include" "-IC:\Users\Alex\Desktop\Cornell
Stuff\Computer Programs\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\include"
-c _mysql.c -o build\temp.win-amd64-3.4\Release\_mysql.o /Zl
gcc: error: /Zl: No such file or directory
error: command 'C:\\Users\\Alex\\Desktop\\Cornell Stuff\\Computer
Programs\\WinPython-64bit-3.4.3.3\\python-
3.4.3.amd64\\..\\tools\\mingw32\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
Failed building wheel for mysql-python
Running setup.py clean for mysql-python
Failed to build mysql-python
it's written there that mysql-python may not be python-3 compatible : https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
you may rather try, for example: "pip install mysql-connector-python"
I'm a former developer, but haven't done much with Python to date. I'm trying to get the full IMDB database into a MySQL server before the text files go poof.
I now know IMDBPy requires Python 2.7 (thanks David!) so I am on a clean machine with Py 2.7 installed. My understanding is that I need several packages installed before I can run the imdbpy2sql script successfully.
These are:
Python 2.7
MySQL (using the latest version of community server 5.7.2)
SQL Object
mysqlclient (requires VC++ compliler for Python
2.7)
I have everything installed up to the mysqlclient. When I attempt to install it, it fails with a message that seems to indicate it cannot find the \include folder for MySQL.
C:\Windows\system32>pip install -U SQLObject
Collecting SQLObject
Downloading SQLObject-3.4.0-py2.py3-none-any.whl (1.7MB)
100% |################################| 1.8MB 652kB/s
Collecting PyDispatcher>=2.0.4 (from SQLObject)
Downloading PyDispatcher-2.0.5.tar.gz
Collecting FormEncode!=1.3.0,>=1.1.1 (from SQLObject)
Downloading FormEncode-1.3.1.tar.gz (197kB)
100% |################################| 204kB 3.3MB/s
Installing collected packages: PyDispatcher, FormEncode, SQLObject
Running setup.py install for PyDispatcher ... done
Running setup.py install for FormEncode ... done
Successfully installed FormEncode-1.3.1 PyDispatcher-2.0.5 SQLObject-3.4.0
C:\Windows\system32>pip install mysqlclient
Collecting mysqlclient
Downloading mysqlclient-1.3.12.tar.gz (89kB)
100% |################################| 92kB 837kB/s
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\michael\\appdata\\local\\temp\\pip-build-jgsnac\\mysqlclient\\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\michael\appdata\local\temp\pip-uwgilx-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
copying _mysql_exceptions.py -> build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-2.7\MySQLdb
creating build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-2.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
C:\Users\Michael\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,3,12,'final',0) -D__version__=1.3.12 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobuild\temp.win-amd64-2.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29) : fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Users\\Michael\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\michael\\appdata\\local\\temp\\pip-build-jgsnac\\mysqlclient\\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\michael\appdata\local\temp\pip-uwgilx-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\michael\appdata\local\temp\pip-build-jgsnac\mysqlclient\
I have confirmed the include folder is there as well as the mysql.h file it is looking for (the default installation location was "c:\Program Files\MySQL\MySQL Server 5.7\include"). I didn't have a problem installing mysqlclient when I was using a newer version of Python (3). So I'm assuming there's some disconnect between the 2.7 version and newer versions of MySQL. Maybe a config file that needs to be updated? Any help would be appreciated.
Install driver first and then try if it works.
Download & Install Python MySQL Connector driver from following link.
https://dev.mysql.com/downloads/connector/c/6.0.html#downloads
pip install MySQL-Python
Refer:
https://github.com/PyMySQL/mysqlclient-python/issues/142
I am trying to install via pip mysql for python 3.5. I have found that I have the missing file, vcvarsall.bat in
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
But I do not know how to modify istall script to point to vcvarsall.bat
Here is the output from install. I have tried solutions suggested, I have installed Express 8, Windows SDK, but nothing seems to help.
PS C:\Python35\Scripts> .\pip.exe install mysql
Collecting mysql
Downloading mysql-0.0.1.tar.gz
Collecting MySQL-python (from mysql)
Downloading MySQL-python-1.2.5.zip (108kB)
100% |################################| 110kB 866kB/s
Installing collected packages: MySQL-python, mysql
Running setup.py install for MySQL-python
Complete output from command
c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Arthur\\AppData\\Local\\Temp\\pip-build t876fqxc\\MySQL-pyth
n\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Arthur\AppData\Local\Temp
pip-ohodnfbo-record\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _mysql_exceptions.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
creating build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
UPDATE. vsvarsall.bat error is gone, after I put a copy of it into bin folder of VC express.
But now I get this error
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -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:\
hon35\include -Ic:\python35\include /Tc_mysql.c /Fobuild\temp.win-amd64-3.5\Release\_mysql.obj /Zl
error: command '**cl.exe**' failed: No such file or directory
But when I put a copy of cl.exe in Windows folder I get this error:
<pre>
command 'C:\\WINDOWS\\cl.exe' failed with exit status -1073741515
</pre>
Where is pip install script is located?
Sovled
After I installed Microsoft Community Edition, now I have in
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
cl.exe that works for compiling modules for Python 3.5 on my amd64 bit machine
Try pymysql. https://github.com/PyMySQL/PyMySQL
It's pure Python, so you won't need to worry about building anything to make it work. I've used both and they both work very well for me.