Problem with adding cryptography as requirement

199 views
Skip to first unread message

Ystvan Youganov

unread,
Aug 12, 2018, 10:41:18 AM8/12/18
to Kivy users support
Hi all,

This is my first post and I am not experienced.
I have been testing kivy for android apps for few months and I have been very happy with it, but I have now an issue I was not able to solve.

I try to compile an android app requiring the cryptography module (required for paramiko) and it has a problem with the installation of cffi:

[INFO]:    Building cryptography for armeabi-v7a
[INFO]:    cryptography apparently isn't already in site-packages
[INFO]:    Building compiled components in cryptography
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:1: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  from functools import partial
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:3: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import Recipe, shprint, current_directory
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:4: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  import sh
[INFO]:    -> directory context /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/cryptography-python2/armeabi-v7a/cryptography
[INFO]:    -> running hostpython setup.py build_ext -v
Exception in thread background thread for pid 28013:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1:

  RAN: /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT:
Download error on https://pypi.python.org/simple/cffi/: unknown url type: https -- Some packages may not be found!
Couldn'
t find index page for 'cffi' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for cffi>=1.4.1
Traceback (most recent call last):
 
File "setup.py", line 336, in <module>
   
**keywords_with_side_effects(sys.argv)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/distutils/core.py", line 112, in setup
    _setup_distribution
= dist = klass(attrs)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 268, in __init__
   
self.fetch_build_eggs(attrs['setup_requires'])
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
    replace_conflicting
=True,
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 836, in resolve
    dist
= best[req.key] = env.best_match(req, ws, installer)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1081, in best_match
   
return self.obtain(req, installer)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1093, in obtain
   
return installer(requirement)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
   
return cmd.easy_install(req)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/command/easy_install.py", line 632, in easy_install
   
raise DistutilsError(msg)
distutils
.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('cffi>=1.4.1')


  STDERR
:


Traceback (most recent call last):
 
File "/usr/lib/python2.7/runpy.py", line 175, in _run_module_as_main
   
"__main__", fname, loader, pkg_name)
 
File "/usr/lib/python2.7/runpy.py", line 73, in _run_code
   
exec code in run_globals
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 977, in <module>
    main
()
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 973, in main
   
ToolchainCL()
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 512, in __init__
    getattr
(self, args.subparser_name.replace('-', '_'))(args)
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args
(ctx, dist, args)
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 191, in build_dist_from_args
    build_recipes
(build_order, python_modules, ctx)
 
File "pythonforandroid/build.py", line 573, in build_recipes
 
File "pythonforandroid/recipe.py", line 880, in build_arch
 
File "pythonforandroid/recipe.py", line 892, in build_compiled_components
 
File "pythonforandroid/logger.py", line 176, in shprint
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 720, in next
   
self.wait()
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 651, in wait
   
self.handle_command_exit_code(exit_code)
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
   
raise exc
sh
.ErrorReturnCode_1:

  RAN
: /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT
:
Download error on https://pypi.python.org/simple/cffi/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'cffi' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for cffi>=1.4.1
Traceback (most recent call last):
  File "setup.py", line 336, in <module>
    **keywords_with_side_effects(sys.argv)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 268, in __init__
    self.fetch_build_eggs(attrs['
setup_requires'])
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
    replace_conflicting=True,
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 836, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1081, in best_match
    return self.obtain(req, installer)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1093, in obtain
    return installer(requirement)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
    return cmd.easy_install(req)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/command/easy_install.py", line 632, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('
cffi>=1.4.1')


  STDERR:



I have in my buildozer.spec:


I tried to add cffi without cryptography and it compiled using:


Adding the cryptography module to the requirements afterwards did not help.

It seems that, regardless of what is already compiled, the installation of cryptography tries to grab and install its own cffi using easy_install.

The error seems to suggest that there is an issue with SSL for using https, but I was not able to install openssl for the version of python used for the installation.

I tried a dirty trick removing the 's' in https in the easy_install.py used, did not work and I have this:



[INFO]:    Building cryptography for armeabi-v7a
[INFO]:    cryptography apparently isn't already in site-packages
[INFO]:    Building compiled components in cryptography
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:1: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  from functools import partial
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:3: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import Recipe, shprint, current_directory
/opt/python-for-android/pythonforandroid/recipes/openssl/__init__.py:4: RuntimeWarning: Parent module '
pythonforandroid.recipes' not found while handling absolute import
  import sh
[INFO]:    -> directory context /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/cryptography-python2/armeabi-v7a/cryptography
[INFO]:    -> running hostpython setup.py build_ext -v
Exception in thread background thread for pid 27510:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1:

  RAN: /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT:
Couldn'
t find index page for 'cffi' (maybe misspelled?)
No local packages or download links found for cffi>=1.4.1
Traceback (most recent call last):
 
File "setup.py", line 336, in <module>
   
**keywords_with_side_effects(sys.argv)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/distutils/core.py", line 112, in setup
    _setup_distribution
= dist = klass(attrs)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 268, in __init__
   
self.fetch_build_eggs(attrs['setup_requires'])
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
    replace_conflicting
=True,
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 836, in resolve
    dist
= best[req.key] = env.best_match(req, ws, installer)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1081, in best_match
   
return self.obtain(req, installer)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1093, in obtain
   
return installer(requirement)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
   
return cmd.easy_install(req)
 
File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/command/easy_install.py", line 633, in easy_install
   
raise DistutilsError(msg)
distutils
.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('cffi>=1.4.1')


  STDERR
:


Traceback (most recent call last):
 
File "/usr/lib/python2.7/runpy.py", line 175, in _run_module_as_main
   
"__main__", fname, loader, pkg_name)
 
File "/usr/lib/python2.7/runpy.py", line 73, in _run_code
   
exec code in run_globals
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 977, in <module>
    main
()
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 973, in main
   
ToolchainCL()
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 512, in __init__
    getattr
(self, args.subparser_name.replace('-', '_'))(args)
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args
(ctx, dist, args)
 
File "/opt/python-for-android/pythonforandroid/toolchain.py", line 191, in build_dist_from_args
    build_recipes
(build_order, python_modules, ctx)
 
File "pythonforandroid/build.py", line 573, in build_recipes
 
File "pythonforandroid/recipe.py", line 880, in build_arch
 
File "pythonforandroid/recipe.py", line 892, in build_compiled_components
 
File "pythonforandroid/logger.py", line 176, in shprint
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 720, in next
   
self.wait()
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 651, in wait
   
self.handle_command_exit_code(exit_code)
 
File "/home/spopoff/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
   
raise exc
sh
.ErrorReturnCode_1:

  RAN
: /home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py build_ext -v

  STDOUT
:
Couldn't find index page for 'cffi' (maybe misspelled?)
No local packages or download links found for cffi>=1.4.1
Traceback (most recent call last):
  File "setup.py", line 336, in <module>
    **keywords_with_side_effects(sys.argv)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 268, in __init__
    self.fetch_build_eggs(attrs['
setup_requires'])
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
    replace_conflicting=True,
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 836, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1081, in best_match
    return self.obtain(req, installer)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/pkg_resources/__init__.py", line 1093, in obtain
    return installer(requirement)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
    return cmd.easy_install(req)
  File "/home/spopoff/dev/papiview/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Lib/site-packages/setuptools/command/easy_install.py", line 633, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('
cffi>=1.4.1')

Does anyone have an idea to help solve this issue?

Thanks for your help.

Ystvan,
Reply all
Reply to author
Forward
0 new messages