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

module 'site' has no attribute 'getsitepackages' #13

Closed
sirex opened this issue Mar 10, 2016 · 3 comments
Closed

module 'site' has no attribute 'getsitepackages' #13

sirex opened this issue Mar 10, 2016 · 3 comments

Comments

@sirex
Copy link

sirex commented Mar 10, 2016

Could not make it work:

> python --version
Python 3.5.1
> transcrypt -b testme.py                                          
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.5.113
Copyright (C) Geatec Engineering. License: Apache 2.0


module 'site' has no attribute 'getsitepackages'Ready
> cat testme.py 
for i in range(10):
    console.log(i)
@JdeH
Copy link
Collaborator

JdeH commented Mar 11, 2016

Thanks,

This is an issue with virtualenv.
I'll add some kind of fix like:

except:
    os.path.dirname(site.__file__) + '/site-packages'

pypa/virtualenv#228

Citing that issue:

"
Yes, one of the uglier aspects of virtualenv's implementation is that it has to have its own copy of the site module, which is used for all virtualenvs regardless of which version of Python they are created with. And this copy predates the addition of site.getsitepackages() (first added in Python 2.7, I believe).

I would have no objection to a pull request adding that function to virtualenv's site module, as long as the implementation is one that can work on all virtualenv-supported versions of Python (2.4 through 3.3a). Or if that's too difficult due to missing APIs in other areas of the earlier Python versions, perhaps have it conditionally defined depending on sys.version or something.
"

@JdeH
Copy link
Collaborator

JdeH commented Mar 11, 2016

@sirex

V3.5.114 was committed, which contains a fix for this.
Could you please let me know if this works for you.

Kind regards
Jacques

@sirex
Copy link
Author

sirex commented Mar 11, 2016

Thanks, it worked!

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

No branches or pull requests

2 participants