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

Installing error: cannot import "ensure_str" from "six" #58

Closed
linlinzhao opened this issue Mar 11, 2020 · 3 comments
Closed

Installing error: cannot import "ensure_str" from "six" #58

linlinzhao opened this issue Mar 11, 2020 · 3 comments

Comments

@linlinzhao
Copy link

linlinzhao commented Mar 11, 2020

Hi, I encounter an error while executing jupyter nbextension install --py --symlink --sys-prefix witwidget:
Traceback (most recent call last): File "/usr/bin/jupyter-nbextension", line 11, in <module> load_entry_point('notebook==5.2.2', 'console_scripts', 'jupyter-nbextension')() File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 658, in launch_instance app.start() File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 988, in start super(NBExtensionApp, self).start() File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 255, in start self.subapp.start() File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 716, in start self.install_extensions() File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 695, in install_extensions **kwargs File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 211, in install_nbextension_python m, nbexts = _get_nbextension_metadata(module) File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata m = import_item(module) File "/usr/lib/python3/dist-packages/traitlets/utils/importstring.py", line 42, in import_item return __import__(parts[0]) File "/home/linin/.local/lib/python3.6/site-packages/witwidget/__init__.py", line 15, in <module> from witwidget.notebook.visualization import * File "/home/linin/.local/lib/python3.6/site-packages/witwidget/notebook/visualization.py", line 27, in <module> from witwidget.notebook.jupyter.wit import * # pylint: disable=wildcard-import,g-import-not-at-top File "/home/linin/.local/lib/python3.6/site-packages/witwidget/notebook/jupyter/wit.py", line 25, in <module> from witwidget.notebook import base File "/home/linin/.local/lib/python3.6/site-packages/witwidget/notebook/base.py", line 26, in <module> from six import ensure_str ImportError: cannot import name 'ensure_str'

But I can import ensure_str within my python2 and python3, where could it go wrong?
Thanks a lot.

@jameswex
Copy link
Collaborator

Thanks for reporting. Haven't seen this one before. What environment are you running it in: are you inside a virtualenv? What does "pip list" show?

@linlinzhao
Copy link
Author

linlinzhao commented Mar 11, 2020

The environment for "six" import error:
Windows Subsystem Linux, ubuntu 18.04
python3, no virtual environment

I just tried intall witwidget within a virtual env. This time it complained that no module named 'widget' , but it is clearly installed as pip list shows:

absl-py (0.9.0) astor (0.8.1) attrs (19.3.0) backcall (0.1.0) bleach (3.1.1) cachetools (4.0.0) decorator (4.4.2) defusedxml (0.6.0) entrypoints (0.3) gast (0.3.3) google-api-python-client (1.7.11) google-auth (1.11.2) google-auth-httplib2 (0.0.3) google-pasta (0.1.8) grpcio (1.27.2) h5py (2.10.0) httplib2 (0.17.0) importlib-metadata (1.5.0) ipykernel (5.1.4) ipython (7.13.0) ipython-genutils (0.2.0) ipywidgets (7.5.1) jedi (0.16.0) Jinja2 (2.11.1) jsonschema (3.2.0) jupyter (1.0.0) jupyter-client (6.0.0) jupyter-console (6.1.0) jupyter-core (4.6.3) Keras-Applications (1.0.8) Keras-Preprocessing (1.1.0) Markdown (3.2.1) MarkupSafe (1.1.1) mistune (0.8.4) nbconvert (5.6.1) nbformat (5.0.4) notebook (6.0.3) numpy (1.18.1) oauth2client (4.1.3) pandocfilters (1.4.2) parso (0.6.2) pexpect (4.8.0) pickleshare (0.7.5) pip (9.0.1) pkg-resources (0.0.0) prometheus-client (0.7.1) prompt-toolkit (3.0.4) protobuf (3.11.3) ptyprocess (0.6.0) pyasn1 (0.4.8) pyasn1-modules (0.2.8) Pygments (2.6.1) pyrsistent (0.15.7) python-dateutil (2.8.1) pyzmq (19.0.0) qtconsole (4.7.1) QtPy (1.9.0) rsa (4.0) Send2Trash (1.5.0) setuptools (39.0.1) six (1.14.0) tensorboard (1.14.0) tensorflow (1.14.0) tensorflow-estimator (1.14.0) termcolor (1.1.0) terminado (0.8.3) testpath (0.4.4) tornado (6.0.4) traitlets (4.3.3) uritemplate (3.0.1) wcwidth (0.1.8) webencodings (0.5.1) Werkzeug (1.0.0) wheel (0.34.2) widgetsnbextension (3.5.1) witwidget (1.6.0) wrapt (1.12.1) zipp (3.1.0)

Thanks for reporting. Haven't seen this one before. What environment are you running it in: are you inside a virtualenv? What does "pip list" show?

@linlinzhao
Copy link
Author

Thanks for reporting. Haven't seen this one before. What environment are you running it in: are you inside a virtualenv? What does "pip list" show?

Hi, a quick update, I restarted the venv, then it was successfullly installed. I will play with wit.
So I closed this issue.

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