Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'site' has no attribute 'getsitepackages' #12

Open
jayargo opened this issue Jan 31, 2020 · 2 comments
Open

AttributeError: module 'site' has no attribute 'getsitepackages' #12

jayargo opened this issue Jan 31, 2020 · 2 comments

Comments

@jayargo
Copy link

jayargo commented Jan 31, 2020

% lx init
Initializing LightEx in current directory.
Traceback (most recent call last):
File "/disk/venv/p3/bin/lx", line 46, in
main(args)
File "/disk/venv/p3/bin/lx", line 28, in main
task_init()
File "/disk/venv/p3/bin/lx", line 12, in task_init
asset_dir = Path(site.getsitepackages()[0]) / 'lightex' / 'assets'
AttributeError: module 'site' has no attribute 'getsitepackages

Looks like this is a known issue in virtualenv with no fix:
pypa/virtualenv#737

Alas, most ML development is in a virtualenv...

@ekshaks
Copy link
Member

ekshaks commented Feb 2, 2020

Thanks for pointing this out.
Does this work for you in virtualenv?

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"

A tmp fix is to copy files from lightex/assets directory into current directory. That's what lx init does.

Will look for a permanent fix to this.

@jayargo
Copy link
Author

jayargo commented Feb 4, 2020

Thanks for looking into this. Yes, get_python_lib() is working correctly. As a temp fix, I locally modified bin/lx to hardcode the site-packages directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants