'cannot import name closurizednamespacesinfo' after update to closure linter

192 views
Skip to first unread message

Guido Tapia

unread,
Aug 19, 2011, 12:52:25 AM8/19/11
to closure-lin...@googlegroups.com
Hi All,

I'm going through and updating all my closure tools and after upgrading to the latest linter im getting an error.  I upgraded simply by running:

Output:
Processing closure_linter-latest.tar.gz
Running closure_linter-2.3.1\setup.py -q bdist_egg --dist-dir c:\users\guidot\appdata\local\temp\easy_install-rt0ozh\
closure_linter-2.3.1\egg-dist-tmp-ynxgvq
zip_safe flag not set; analyzing archive contents...
Removing closure-linter 2.2.7 from easy-install.pth file
Adding closure-linter 2.3.1 to easy-install.pth file
Installing fixjsstyle-script.py script to c:\Python27\Scripts
Installing fixjsstyle.exe script to c:\Python27\Scripts
Installing fixjsstyle.exe.manifest script to c:\Python27\Scripts
Installing gjslint-script.py script to c:\Python27\Scripts
Installing gjslint.exe script to c:\Python27\Scripts
Installing gjslint.exe.manifest script to c:\Python27\Scripts

Installed c:\python27\lib\site-packages\closure_linter-2.3.1-py2.7.egg
Processing dependencies for closure-linter==2.3.1
Finished processing dependencies for closure-linter==2.3.1


After that running either fixjsstyle or gjslint causes the following crash:

Traceback (most recent call last):
  File "c:\Python27\Scripts\fixjsstyle-script.py", line 8, in <module>
    load_entry_point('closure-linter==2.3.1', 'console_scripts', 'fixjsstyle')()
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 318, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 2221, in load_entry_point
    return ep.load()
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build\bdist.win-amd64\egg\closure_linter\fixjsstyle.py", line 25, in <module>
  File "build\bdist.win-amd64\egg\closure_linter\checker.py", line 25, in <module>
ImportError: cannot import name closurizednamespacesinfo

Has any one see this before?  

Thanks all

Guido

Sean

unread,
Aug 21, 2011, 4:24:25 PM8/21/11
to Closure Linter Discuss
I'm seeing the same thing. I'll let you know if I figure out the
problem.

On Aug 18, 9:52 pm, Guido Tapia <guido.ta...@gmail.com> wrote:
> Hi All,
>
> I'm going through and updating all my closure tools and after upgrading to
> the latest linter im getting an error.  I upgraded simply by running:> easy_install
>
> http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
>
> Output:
> Downloadinghttp://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz

Andy Perelson

unread,
Aug 23, 2011, 6:49:07 PM8/23/11
to closure-lin...@googlegroups.com
There have been a few sporadic reports of this issue but it doesn't seem to reproduce 100% of the time (at least I've never reproduced it but enough people have reported it that I believe there is a problem). If anyone can provide a file / code snippet that reliably reproduces the problem that would be helpful. We can try to do a small spot release of the Closure Linter with a fix once we find one.

Andy

Sean Soria

unread,
Aug 23, 2011, 6:57:25 PM8/23/11
to closure-lin...@googlegroups.com
On my machine there is no code required.  I just run fixjsstyle with no arguments or input and it barfs up the error.  Is there anything else I can provide?

Guido Tapia

unread,
Aug 23, 2011, 7:03:32 PM8/23/11
to closure-lin...@googlegroups.com
Like Andy, when this happens it just happens, I mean it looks like just a failed installation.

Something I should have described in my first email.  I'm using:
Python 2.7
Windows 7 x64 (is it windows???)
Don't know what version of easy_install (no --version flag) but its > 1yr old

Thanks

Sean Soria

unread,
Aug 23, 2011, 7:12:56 PM8/23/11
to closure-lin...@googlegroups.com
Python 2.6.1
Mac 10.6.8
Happens 100% on my machine.
Tried install through both easy_install and pip, both fail.  2.3.0 works fine, I was able to roll back to that version without issues.  Was really hoping 2.3.1 fixed a semi-colon bug I was seeing.

Hochhaus, Andrew

unread,
Aug 23, 2011, 7:23:55 PM8/23/11
to closure-lin...@googlegroups.com
On Tue, Aug 23, 2011 at 6:03 PM, Guido Tapia <gu...@tapia.com.au> wrote:
> Windows 7 x64 (is it windows???)

In case it is helpful, I am on Debian Squeeze Linux and I have _not_
seen this error.

-Andy

Guido Tapia

unread,
Aug 23, 2011, 8:15:08 PM8/23/11
to closure-lin...@googlegroups.com

In case it is helpful, I am on Debian Squeeze Linux and I have _not_
seen this error.


Oops I meant Sean 

Jason Smith

unread,
Aug 23, 2011, 9:27:00 PM8/23/11
to closure-lin...@googlegroups.com
Same thing happening here, with Python 2.7 x32 and setuptools 0.6c11 on Windows 7 x64. Clean install of everything today.

Edo

unread,
Aug 24, 2011, 4:11:29 AM8/24/11
to Closure Linter Discuss
Same error here:
- Ubuntu 11.04
- Python 2.7.1+
- easy_install distribute 0.6.15

Everything was perfectly OK before I upgrade to 2.3.1 yesterday.

Edo

unread,
Aug 24, 2011, 4:15:21 AM8/24/11
to Closure Linter Discuss
I'm on Ubuntu 11.04 64 bits, to be precise.

Edo

unread,
Aug 24, 2011, 4:24:01 AM8/24/11
to Closure Linter Discuss
OK, so it worked for me if I checkout the source and do
sudo python ./setup.py install

Installing through easy_install still display the error.

Jay Young

unread,
Aug 25, 2011, 2:20:00 AM8/25/11
to closure-lin...@googlegroups.com
Python 2.7.1
Mac OS X 10.7.1

I run into this issue after both easy_install and installing from source.  I can roll back to version 2.3 by doing:
sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-2.3.tar.gz
This worked for 2.3, but not for 2.3.1.

Guido Tapia

unread,
Aug 29, 2011, 6:52:55 PM8/29/11
to closure-lin...@googlegroups.com
2.3 also works fine on Win 7 x64.  Thanks Jay

eddie

unread,
Sep 2, 2011, 1:21:34 PM9/2/11
to Closure Linter Discuss
I tried to submit this problem as an issue to google code, but the
'submit issue' was disabled, so I am posting it here instead. Sorry if
it is the wrong place. This issue is trivial to fix, but it is making
people build a broken linter.

What steps will reproduce the problem?
1. Install closure_linter using easy_install as described in
https://code.google.com/intl/es/closure/utilities/docs/linter_howto.html
2. run gjslint with no arguments

What is the expected output? What do you see instead?
I expected the message '0 files checked, no errors found.'

I got a python traceback ending in an ImportError exception.


What version of the product are you using? On what operating system?
Ubuntu natty amd64, python 2.7.1

Please provide any additional information below.
Installed with without any errors using:
sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz


test run:
user@host:/tmp$ gjslint
Traceback (most recent call last):
File "/usr/local/bin/gjslint", line 9, in <module>
load_entry_point('closure-linter==2.3.1', 'console_scripts',
'gjslint')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 305,
in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2244,
in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1954,
in load
entry = __import__(self.module_name, globals(),globals(),
['__name__'])
File "/usr/local/lib/python2.7/dist-packages/closure_linter-2.3.1-
py2.7.egg/closure_linter/gjslint.py", line 42, in <module>
from closure_linter import checker
File "/usr/local/lib/python2.7/dist-packages/closure_linter-2.3.1-
py2.7.egg/closure_linter/checker.py", line 25, in <module>
from closure_linter import closurizednamespacesinfo
ImportError: cannot import name closurizednamespacesinfo

I tried to search the missing file with:
>>> import closure_linter
>>> import os
>>> 'closurizednamespacesinfo.py' in os.listdir(closure_linter.__path__[0])
False

I found closurizednamespacesinfo.py in the SVN trunk, but it is not
available in the tarball provided for setuptools in the URL mentioned
above, so it does not get into the egg. As the import has no
conditions, I would be very surprised if a working gjslint could be
built from that tarball. With trial-and-error, I found missing the
files closurizednamespacesinfo.py , error_check.py and
requireprovidesorter.py. Once I downloaded those 3 files from the SVN
repository, closure_linter was build correctly and it works as
expected.

schibum

unread,
Sep 7, 2011, 11:46:14 AM9/7/11
to closure-lin...@googlegroups.com
same problem here

Installing from svn trunk using setup.py instead worked for me.

masahito

unread,
Sep 12, 2011, 1:17:46 AM9/12/11
to Closure Linter Discuss
same problem here

I compared (A) with (B).
(A) http://closure-linter.googlecode.com/files/closure_linter-2.3.tar.gz
(B) http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz

There were no following files in (B). but exists in
http://code.google.com/p/closure-linter/source/browse/#svn%2Ftrunk%2Fclosure_linter.

closure_linter/
closurizednamespacesinfo_test.py
error_check.py
not_strict_test.py
requireprovidesorter.py

I think that this is the cause.

Andy Perelson

unread,
Sep 15, 2011, 5:34:11 PM9/15/11
to closure-lin...@googlegroups.com
I agree with the findings of everyone else. For some reason the packaged, downloadable tar file is missing some files, causing these problems. The tar file is generated by a bunch of scripts as soon as we can track down what's going wrong we'll get it fixed. If this requires a new release we'll put out 2.3.2, which can have some other recent updates. Hopefully this doesn't take too long and thank you everyone for reporting this.

Andy

Andy Perelson

unread,
Sep 16, 2011, 1:27:15 PM9/16/11
to closure-lin...@googlegroups.com
I've uploaded a new copy of Closure Linter 2.3.1 (and latest, which is the same thing), that hopefully has this install problem fixed. Let me know if you have any more problems, but hopefully not.

Andy

Guido Tapia

unread,
Sep 17, 2011, 1:29:50 AM9/17/11
to closure-lin...@googlegroups.com
I tried installing latest but it failed on Win 7 x64.

Processing closure_linter-latest.tar.gz
Running closure_linter-2.3.1\setup.py -q bdist_egg --dist-dir c:\users\guidot\appdata\local\temp\easy_install-1dtrcn\
closure_linter-2.3.1\egg-dist-tmp-rnlz9u
zip_safe flag not set; analyzing archive contents...
Removing closure-linter 2.3 from easy-install.pth file
Adding closure-linter 2.3.1 to easy-install.pth file
Installing fixjsstyle-script.py script to c:\Python27\Scripts
Installing fixjsstyle.exe script to c:\Python27\Scripts
Installing fixjsstyle.exe.manifest script to c:\Python27\Scripts
Installing gjslint-script.py script to c:\Python27\Scripts
Installing gjslint.exe script to c:\Python27\Scripts
Installing gjslint.exe.manifest script to c:\Python27\Scripts

Installed c:\python27\lib\site-packages\closure_linter-2.3.1-py2.7.egg
Processing dependencies for closure-linter==2.3.1
Traceback (most recent call last):
  File "c:\Python27\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
    with_ei_usage(lambda:
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
    return f()
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1716, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "c:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "c:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 422, in easy_install
    return self.install_item(None, download, tmpdir, deps, True)
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 478, in install_item
    self.process_distribution(spec, dist, deps)
  File "c:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 519, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 570, in resolve
    requirements.extend(dist.requires(req.extras)[::-1])
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 2149, in requires
    dm = self._dep_map
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 2141, in _dep_map
    for extra,reqs in split_sections(self._get_metadata(name)):
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 2560, in split_sections
    for line in yield_lines(s):
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 1854, in yield_lines
    for ss in strs:
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 2163, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 1181, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 1178, in get_metadata
    return self._get(self._fn(self.egg_info,name))
  File "c:\Python27\lib\site-packages\pkg_resources.py", line 1238, in _get
    return self.loader.get_data(path)
zipimport.ZipImportError: bad local file header in c:\python27\lib\site-packages\closure_linter-2.3.1-py2.7.egg

Jay Young

unread,
Sep 17, 2011, 2:09:14 PM9/17/11
to closure-lin...@googlegroups.com
I got the same error on OS X

Jay Young

unread,
Sep 17, 2011, 2:17:03 PM9/17/11
to closure-lin...@googlegroups.com
Clarification:  The following command gave me that error above
When I tried:

I was able to install and run this version with no issues, so something is off with the "latest.tar.gz" file, but the versioned one might work for you.

Nick Santos

unread,
Sep 18, 2011, 9:39:03 PM9/18/11
to closure-lin...@googlegroups.com
Hmmm...it worked fine for me on ubuntu.

maybe the original bad release corrupted something in easy_install, so
that even the new, good release won't fix it?

Looking at easy_install, it's not entirely clear to me how it manages
statefulness, and whether it's kosher to have two different release
binaries both at version 2.3.1.

Guido Tapia

unread,
Sep 18, 2011, 9:41:45 PM9/18/11
to closure-lin...@googlegroups.com
Happy to be guinea pig, just create a new version number and I'll let u know if works.

Could be a good chance to port gjslint to the compiler (i.e. just another compiler pass???) One less closure tool?? :) Just kidding, I know this is a big job.

Nick Santos

unread,
Sep 18, 2011, 9:52:43 PM9/18/11
to closure-lin...@googlegroups.com
On Sun, Sep 18, 2011 at 9:41 PM, Guido Tapia <gu...@tapia.com.au> wrote:
> Happy to be guinea pig, just create a new version number and I'll let u know
> if works.

ah, looking at the docs, have you tried running:
easy_install -mxN
http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
The first command should delete the old stale state, and let the
second command go forward? just a guess, don't blame me if it doesn't
work :)

> Could be a good chance to port gjslint to the compiler (i.e. just another
> compiler pass???) One less closure tool?? :) Just kidding, I know this is a
> big job.

As it turns out, the kind of parser you would write for an optimizing
compiler is very different than the kind of parser you would write for
a linter/auto-indenter. They have completely different IRs, and things
that are impossible to represent in one are easy to represent in the
other.

Guido Tapia

unread,
Sep 18, 2011, 9:59:41 PM9/18/11
to closure-lin...@googlegroups.com
Hi Nick, that works!!  Thanks for that

Just from a discussion perspective, I understand that a compiler pass on the AST would not be suitable for gjslint/fixjsstyle style parse/fix.  However it could definitely be done before tokenisation, i.e. Just port gjslint to Java and run this prior to actual compilation.   (I know its not that simple, I'm just saying is all)
:)

Tnx
Reply all
Reply to author
Forward
0 new messages