when i input command jupyter contrib nbextension install --user, i get this error.
python traceback
ImportError: can not import name configparser
i don't know the reason.
Hope some help.
I had to resolve this by first installing configparser==3.5.0b2. After that, I modified the PKG-INFO in that installed egg to read as version 3.5.0 to satisfy package version requirements imposed by setuptools in the jupyter_contrib_nbextensions package. I'm looking into opening a pull request for that pip package to change the requirement from >=3.5.0 to something more like =3.5.0*, but I haven't worked enough with the repo to be confident in that being a good change.
I know this might be a bit late, but I ran into the same issue for the same reason I did: I'm running this on CentOS7, and it requires the 3.5.0b2 version instead of 3.5.0. Here's the GitHub issue that led me to that; it was for an Anaconda install, but it worked with a normal pip installation for me, and I was able to install nbextensions: https://github.com/conda/conda/issues/4823
@schrodingersket so if I understand correctly, it seems that this is an error in the 3.5.0 (non-b2) configparser package? If so, I'm not sure how to specify that without unecessarily pinning the version to 3.5.0b2 :thinking: If anyone has any ideas, I'm happy to alter the dependency spec...
I have this problem because I have an old version of configparser in /usr/lib/python2.7/dist-packages/configparser-3.5.0-nspkg.pth installed by apt. In newer versions of configparser, the .pth file is not used. When pip installs a new version of configparser into /usr/local/lib/python2.7/dist-packages/backports/configparser, they do not play well together.
My workaround is sudo --set-home python -m pip install --ignore-installed configparser==3.5.0 which will install a copy of configparser-3.5.0-nspkg.pth in /usr/local/lib/python2.7/dist-packages. This .pth file will do some path munging but only for /usr/local/lib, allowing the latest version installed in /usr/local/lib/python2.7/dist-packages/backports/configparser to be loaded correctly.
Most helpful comment
I have this problem because I have an old version of configparser in
/usr/lib/python2.7/dist-packages/configparser-3.5.0-nspkg.pthinstalled byapt. In newer versions of configparser, the.pthfile is not used. Whenpipinstalls a new version ofconfigparserinto/usr/local/lib/python2.7/dist-packages/backports/configparser, they do not play well together.My workaround is
sudo --set-home python -m pip install --ignore-installed configparser==3.5.0which will install a copy ofconfigparser-3.5.0-nspkg.pthin/usr/local/lib/python2.7/dist-packages. This.pthfile will do some path munging but only for/usr/local/lib, allowing the latest version installed in/usr/local/lib/python2.7/dist-packages/backports/configparserto be loaded correctly.