question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'site' has no attribute 'getsitepackages' when running p4a create

See original GitHub issue

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 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MelvIsntNormalcommented, Jan 23, 2016

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()) to os.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 using os.path.dirname(site.__file__) + "/site-packages" is a bad idea?

0reactions
inclementcommented, Jan 31, 2019

Closing as stale, since it should be resolved by moving away from crystax and having a proper hostpython again for our own use.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found