无法在python3中建立pycrypto配方-工具链

问题描述 投票:0回答:1

我正在尝试使用网站中的说明在iOS中打包一个简单的Kivy应用程序:

https://github.com/kivy/kivy-ios

我的应用非常简单,只有1行:

from firebase import firebase

该应用程序可以使用linux在android中成功打包。但是,我在将其打包到iOS时遇到问题。我需要建立一个名为pycrypto的食谱,但这给了我以下错误。我尝试了python2和python3。我仍然遇到相同的错误。网址链接似乎已失效(https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.1.tar.gz

https://kivy.org/doc/stable/guide/packaging-ios.html
hcaos-iMac:kivy-ios hcao$ ./toolchain.py build pycrypto
[INFO    ] Building with 4 processes, where supported
[INFO    ] Want to build ['pycrypto']
[INFO    ] Loaded recipe pycrypto (depends of ['python', 'openssl'], optional are [])
[INFO    ] Loaded recipe python (depends of [u'python3'], optional are [])
[INFO    ] Loaded recipe openssl (depends of [], optional are [])
[INFO    ] Loaded recipe python3 (depends of ['hostpython3', 'libffi', 'openssl'], optional are [])
[INFO    ] Loaded recipe hostpython3 (depends of [], optional are ['openssl'])
[INFO    ] Loaded recipe libffi (depends of [], optional are [])
[INFO    ] Build order is ['libffi', 'openssl', 'hostpython3', u'python3', 'python', 'pycrypto']
[INFO    ] Recipe order is ['libffi', 'openssl', 'hostpython3', 'python3', 'pycrypto']
[INFO    ] Include dir added: {arch.arch}/ffi
[INFO    ] Include dir added: {arch.arch}/openssl
[INFO    ] Global: hostpython located at /Users/hcao/Desktop/kivyios-python3/kivy-ios/dist/hostpython3/bin/python
[INFO    ] Global: hostpgen located at /Users/hcao/Desktop/kivyios-python3/kivy-ios/dist/hostpython3/bin/pgen
[DEBUG   ] Cached result: Download libffi. Ignoring
[DEBUG   ] Cached result: Extract libffi. Ignoring
[DEBUG   ] Cached result: Build_all libffi. Ignoring
[DEBUG   ] Cached result: Download openssl. Ignoring
[DEBUG   ] Cached result: Extract openssl. Ignoring
[DEBUG   ] Cached result: Build_all openssl. Ignoring
[DEBUG   ] Cached result: Download hostpython3. Ignoring
[DEBUG   ] Cached result: Extract hostpython3. Ignoring
[DEBUG   ] Cached result: Build_all hostpython3. Ignoring
[DEBUG   ] Cached result: Download python3. Ignoring
[DEBUG   ] Cached result: Extract python3. Ignoring
[DEBUG   ] Cached result: Build_all python3. Ignoring
[INFO    ] Download pycrypto
[INFO    ] Downloading https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.1.tar.gz
Traceback (most recent call last):
  File "./toolchain.py", line 1569, in <module>
    ToolchainCL()
  File "./toolchain.py", line 1284, in __init__
    getattr(self, args.command)()
  File "./toolchain.py", line 1325, in build
    build_recipes(args.recipe, ctx)
  File "./toolchain.py", line 1161, in build_recipes
    recipe.execute()
  File "/Users/hcao/Desktop/kivyios-python3/kivy-ios/toolchain.py", line 726, in execute
    self.download()
  File "/Users/hcao/Desktop/kivyios-python3/kivy-ios/toolchain.py", line 84, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/hcao/Desktop/kivyios-python3/kivy-ios/toolchain.py", line 761, in download
    self.download_file(self.url.format(version=self.version), fn)
  File "/Users/hcao/Desktop/kivyios-python3/kivy-ios/toolchain.py", line 478, in download_file
    urlretrieve(url, filename, report_hook)
  File "/Library/Python/2.7/site-packages/future/backports/urllib/request.py", line 1731, in retrieve
    fp = self.open(url, data)
  File "/Library/Python/2.7/site-packages/future/backports/urllib/request.py", line 1703, in open
    raise_with_traceback(IOError('socket error', msg))
  File "/Library/Python/2.7/site-packages/future/backports/urllib/request.py", line 1697, in open
    return getattr(self, name)(url)
  File "/Library/Python/2.7/site-packages/future/backports/urllib/request.py", line 1907, in open_https
    return self._open_generic_http(self._https_connection, url, data)
  File "/Library/Python/2.7/site-packages/future/backports/urllib/request.py", line 1856, in _open_generic_http
    http_conn.request("GET", selector, headers=headers)
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 1083, in request
    self._send_request(method, url, body, headers)
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 1121, in _send_request
    self.endheaders(body)
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 1079, in endheaders
    self._send_output(message_body)
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 924, in _send_output
    self.send(msg)
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 860, in send
    self.connect()
  File "/Library/Python/2.7/site-packages/future/backports/http/client.py", line 1221, in connect
    self.timeout, self.source_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
    raise err
IOError: [Errno socket error] [Errno 61] Connection refused
ios kivy pycrypto toolchain recipe
1个回答
0
投票

可以在https://github.com/kivy/kivy-ios/issues/384找到答案可以构建Pycrypto,但无法正常运行。解决方法是完全避免使用firebase(需要pycrypto)。使用request和json代替简单的get和post方法。

© www.soinside.com 2019 - 2024. All rights reserved.