AttributeError: module 'site' has no attribute 'getsitepackages' when running p4a create
See original GitHub issueHopefully this is just me doing something wrong.
I created a test project to test building an APK using Python 3.5. I’m running this comand:
p4a create \
--dist_name=testproject \
--bootstrap=sdl2 \
--requirements=sdl2,python3crystax,kivy \
--android_api=19 \
--ndk_dir=/home/melvisntnormal/.android/ndk_crystax/
which gives me the above error. Any way to get this working?
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top Results From Across the Web
AttributeError: module 'site' has no attribute 'getsitepackages' when ...
Hopefully this is just me doing something wrong. I created a test project to test building an APK using Python 3.5. I'm running...
Read more >python - module 'site' has no attribute 'getusersitepackages'
Try running site.USER_SITE(). if you get an answer, it might mean that the site package is of an older version since the docs...
Read more >kivy@groups.io | New Comment on Issue
[python-for-android:master] New Comment on Issue #610 AttributeError: module 'site' has no attribute 'getsitepackages' when running p4a create
Read more >Package fails to install in virtual env, can't find anything in the ...
ERROR: Command errored out with exit status 1: command: ... in site.getsitepackages(): AttributeError: module 'site' has no attribute ...
Read more >kivy Changelog - pyup.io
AttributeError : module 'site' has no attribute 'getsitepackages' when running p4a create [\610](https://github.com/kivy/python-for-android/issues/610)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All right, I guess I’ll wait for an actual fix. In the meantime, I’ve used a probably naive solution and changed
"\\n".join(site.getsitepackages())
toos.path.dirname(site.__file__) + "/site-packages"
, and it works just fine (though the apk crashes on my phone, but so did the python2.7 and Kivy Launcher versions). Is there any reason why usingos.path.dirname(site.__file__) + "/site-packages"
is a bad idea?Closing as stale, since it should be resolved by moving away from crystax and having a proper hostpython again for our own use.