tdgrant1 / denss

Calculate electron density from a solution scattering profile
GNU General Public License v3.0
31 stars 22 forks source link

python2.7: ImportError: No module named builtins #17

Closed dfranke76 closed 3 years ago

dfranke76 commented 3 years ago

$ denss.py ly01.out Traceback (most recent call last): File "/apps/prod/denss/latest/bin/denss.py", line 29, in import saxstats.saxstats as saxs File "/apps/prod/denss/latest/lib/python2.7/site-packages/saxstats/saxstats.py", line 35, in from builtins import object, range, map, zip, str ImportError: No module named builtins

"builtins" is the Pyhton3 name, Python2 requires the pip-package "future" which may not be installed. The following seems to work, though: try: from builtins import object, range, map, zip, str except ImportError: from builtin import object, range, map, zip, str

tdgrant1 commented 3 years ago

I just pushed a new commit with your suggested changes. thanks for the bug fix. Does that fix the maketrans error for you also?

dfranke76 commented 3 years ago

Thanks for the quick update. No, the maketrans issue came after this.

I just noticed, in the line "from builtin import object, range, map, zip, str", the "builtin" should have been preceded and followed by double underscore, but the editor made the module name bold instead. Again with proper "code" tags:

-from builtin import object, range, map, zip, str
+from __builtin__ import object, range, map, zip, str
tdgrant1 commented 3 years ago

whoops sorry about that. just pushed that fix. I'll see if I can make a work around for the maketrans issue

dfranke76 commented 3 years ago

My mistake. Starts up without error now. Thanks!

tdgrant1 commented 3 years ago

oh okay great. thanks!