我想使用pip V9.0.3安装Python-adb。
当我尝试安装python-adb时,我总是得到与你在底部看到的相同的错误。
我还尝试使用pip / pip3上的管理员权限为每个CMD安装它。
我已经尝试过:
- 有/无管理员权限的CMD
- pip / pip3安装
- 为C ++错误安装了mingw
我目前在Windows 7 64Bit上使用Python3.6
输出:
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\
答案 0 :(得分:0)
显然M2Crypto
(这是您的安装过程失败的地方)很难在Windows上安装,但有unofficial binaries available(虽然这是一个过时的问题),并且包自己安装说明包括Windows installation部分。
更有希望的是,项目here有一个副本,它也有Windows instructions。但为此你需要安装SWIG
。
第三个选项是这对(32-bit,64-bit)包是M2Crypto
克隆专用于Windows的程序包,但我不确定它是如何更新的他们是(最后一次提交是在2014年,所以到目前为止原始项目可能会有很多变化。)
答案 1 :(得分:0)
当前没有用于PyADB的Debian软件包。 (将很快解决…)
[+] Debian软件包:##$ sudo dpkg -i python-pyadb_0.1.0-1_all.deb#选择先前未选择的软件包python-pyadb。 #(Leyendo la base de datos…322039 ficheros o directorios instalados实践。)#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
搜索pyadb…处理pyadb的依赖项完成处理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 $
更多说明:http://wiki.python.org/moin/CheeseShopTutorial
用法:
$ 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() $
您可以在“ examples / whatsapp.py”中查看“完整”示例