netifaces import error on android

152 views
Skip to first unread message

Artem Popov

unread,
May 2, 2015, 9:25:43 AM5/2/15
to kivy-...@googlegroups.com
Hi,

I'm having a problem importing netifaces on android, relevant logcat output is below. Manually setting PYTHON_EGG_CACHE to a writeable directory seems to solve the problem, but i'd love to avoid using hacks like that. Any ideas? Thanks!

Regards,
--Artem

I/python  (15924): Android kivy bootstrap done. __name__ is __main__
I/python  (15924): Run user program, change dir and execute main.py
I/python  (15924): [INFO              ] [Logger      ] Record log in /data/data/net.artfwo.netiftest/files/.kivy/logs/kivy_15-05-02_1.txt
I/python  (15924): [INFO              ] [Kivy        ] v1.9.0
I/python  (15924): [INFO              ] [Python      ] v2.7.2 (default, May  2 2015, 18:26:44)
I/python  (15924): [GCC 4.8]
I/python  (15924): [INFO              ] [Factory     ] 173 symbols loaded
I/python  (15924):  /data/data/net.artfwo.netiftest/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:13: RuntimeWarning: import cdrom: No module named cdrom
I/python  (15924):  (ImportError: No module named cdrom)
I/python  (15924): [INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
I/python  (15924): [INFO              ] [Text        ] Provider: pygame
I/python  (15924): [INFO              ] [OSC         ] using <thread> for socket
I/python  (15924):  Traceback (most recent call last):
I/python  (15924):    File "/home/art/netiftest/.buildozer/android/app/main.py", line 44, in <module>
I/python  (15924):    File "/home/art/pkg/python-for-android/build/python-install/lib/python2.7/site-packages/zeroconf.py", line 35, in <module>
I/python  (15924):    File "build/bdist.linux-x86_64/egg/netifaces.py", line 7, in <module>
I/python  (15924):    File "build/bdist.linux-x86_64/egg/netifaces.py", line 4, in __bootstrap__
I/python  (15924):    File "/lib/python2.7/site-packages/pkg_resources.py", line 882, in resource_filename
I/python  (15924):    File "/lib/python2.7/site-packages/pkg_resources.py", line 1351, in get_resource_filename
I/python  (15924):    File "/lib/python2.7/site-packages/pkg_resources.py", line 1373, in _extract_resource
I/python  (15924):    File "/lib/python2.7/site-packages/pkg_resources.py", line 962, in get_cache_path
I/python  (15924):    File "/lib/python2.7/site-packages/pkg_resources.py", line 928, in extraction_error
I/python  (15924):  pkg_resources.ExtractionError: Can't extract file(s) to egg cache
I/python  (15924): 
I/python  (15924):  The following error occurred while trying to extract file(s) to the Python egg
I/python  (15924):  cache:
I/python  (15924): 
I/python  (15924):    [Errno 13] Permission denied: '/data/.python-eggs'
I/python  (15924): 
I/python  (15924):  The Python egg cache directory is currently set to:
I/python  (15924): 
I/python  (15924):    /data/.python-eggs
I/python  (15924): 
I/python  (15924):  Perhaps your account does not have write access to this directory?  You can
I/python  (15924):  change the cache directory by setting the PYTHON_EGG_CACHE environment
I/python  (15924):  variable to point to an accessible directory.
I/python  (15924): 
I/python  (15924): Python for android ended.

Andrei Sima

unread,
Aug 21, 2015, 11:52:13 AM8/21/15
to Kivy users support
Hi,

I am having the same issue here.
Exactly how did you manually set PYTHON_EGG_CACHE to a writeable directory.

Or a way to modify the receipe.sh for netifaces?




I/python  ( 4326): ['/data/data/org.test.ifacenet/files/lib/python2.7/site-packages', '/data/data/org.test.ifacenet/files/lib/site-python']
I/python  ( 4326): Android path ['/data/data/org.test.ifacenet/files/lib/python2.7/site-packages/netifaces-0.10.4-py2.7-linux-x86_64.egg', '/data/data/org.test.ifacenet/files/lib/python27.zip', '/data/data/org.test.ifacenet/files/lib/python2.7', '/data/data/org.test.ifacenet/files/lib/python2.7/lib-dynload', '/data/data/org.test.ifacenet/files/lib/python2.7/site-packages', '/data/data/org.test.ifacenet/files', '/data/data/org.test.ifacenet/files/_applibs']
I/python  ( 4326): Android kivy bootstrap done. __name__ is __main__
I/python  ( 4326): Run user program, change dir and execute main.py
I/python  ( 4326): [INFO              ] [Logger      ] Record log in /data/data/org.test.ifacenet/files/.kivy/logs/kivy_15-08-21_8.txt
I/python  ( 4326): [INFO              ] [Kivy        ] v1.9.0
I/python  ( 4326): [INFO              ] [Python      ] v2.7.2 (default, Aug 21 2015, 16:20:08) 
I/python  ( 4326): [GCC 4.8]
I/python  ( 4326): [INFO              ] [Factory     ] 173 symbols loaded
I/python  ( 4326):  /data/data/org.test.ifacenet/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:13: RuntimeWarning: import cdrom: No module named cdrom
I/python  ( 4326):  (ImportError: No module named cdrom)
I/python  ( 4326): [INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
I/python  ( 4326): [INFO              ] [Text        ] Provider: pygame
I/python  ( 4326):  Traceback (most recent call last):
I/python  ( 4326):    File "/home/kivy/buildozer/netifaces/.buildozer/android/app/main.py", line 12, in <module>
I/python  ( 4326):    File "/data/data/org.test.ifacenet/files/lib/python2.7/site-packages/netifaces-0.10.4-py2.7-linux-x86_64.egg/netifaces.py", line 7, in <module>
I/python  ( 4326):    File "/data/data/org.test.ifacenet/files/lib/python2.7/site-packages/netifaces-0.10.4-py2.7-linux-x86_64.egg/netifaces.py", line 4, in __bootstrap__
I/python  ( 4326):    File "/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1161, in resource_filename
I/python  ( 4326):    File "/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1861, in get_resource_filename
I/python  ( 4326):    File "/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1891, in _extract_resource
I/python  ( 4326):    File "/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1227, in get_cache_path
I/python  ( 4326):    File "/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1207, in extraction_error
I/python  ( 4326):  pkg_resources.ExtractionError: Can't extract file(s) to egg cache
I/python  ( 4326):  
I/python  ( 4326):  The following error occurred while trying to extract file(s) to the Python egg
I/python  ( 4326):  cache:
I/python  ( 4326):  
I/python  ( 4326):    [Errno 13] Permission denied: '/data/.python-eggs'
I/python  ( 4326):  
I/python  ( 4326):  The Python egg cache directory is currently set to:
I/python  ( 4326):  
I/python  ( 4326):    /data/.python-eggs
I/python  ( 4326):  
I/python  ( 4326):  Perhaps your account does not have write access to this directory?  You can
I/python  ( 4326):  change the cache directory by setting the PYTHON_EGG_CACHE environment
I/python  ( 4326):  variable to point to an accessible directory.
I/python  ( 4326):  
I/python  ( 4326): Python for android ended.
Reply all
Reply to author
Forward
0 new messages