Невозможно открыть открытые блокноты jupyter после добавления виртуальной среды в conda. Почему? - PullRequest
0 голосов
/ 04 марта 2020

Я установил виртуальную среду под названием "qiskit_env" в conda, но я не смог использовать ее на ноутбуке jupyter, поэтому нашел этот веб-сайт, чтобы помочь мне все это настроить. Однако после запуска следующих команд по порядку:

pip install --user ipykernel
python -m ipykernel install --user --name=qiskit_env 

Я больше не могу открыть записную книжку jupyter и получить сообщение, подобное этому, в приглашении conda:

[I 16:33:44.203 NotebookApp] Creating new notebook in
[E 16:33:44.850 NotebookApp] Uncaught exception GET /notebooks/Untitled2.ipynb?kernel_name=python3 (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled2.ipynb?kernel_name=python3', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1701, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 3178, in wrapper
        return method(self, *args, **kwargs)
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\notebook\handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 462, in render_template
        return template.render(**ns)
      File "C:\Users\duart\Anaconda3\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "C:\Users\duart\Anaconda3\lib\site-packages\jinja2\environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "C:\Users\duart\Anaconda3\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "C:\Users\duart\Anaconda3\lib\site-packages\jinja2\_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\templates\notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\templates\page.html", line 154, in top-level template code
        {% block header %}
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\templates\notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "C:\Users\duart\Anaconda3\lib\site-packages\notebook\notebook\handlers.py", line 24, in get_custom_frontend_exporters
        exporter = get_exporter(name)()
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 958, in __new__
        inst.setup_instance(*args, **kwargs)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 986, in setup_instance
        super(HasTraits, self).setup_instance(*args, **kwargs)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 977, in setup_instance
        value.instance_init(self)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 1691, in instance_init
        self._resolve_classes()
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 1696, in _resolve_classes
        self.klass = self._resolve_string(self.klass)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\traitlets.py", line 1507, in _resolve_string
        return import_item(string)
      File "C:\Users\duart\AppData\Roaming\Python\Python37\site-packages\traitlets\utils\importstring.py", line 34, in import_item
        module = __import__(package, fromlist=[obj])
      File "C:\Users\duart\Anaconda3\lib\site-packages\nbconvert\__init__.py", line 7, in <module>
        from . import postprocessors
      File "C:\Users\duart\Anaconda3\lib\site-packages\nbconvert\postprocessors\__init__.py", line 5, in <module>
        from .serve import ServePostProcessor
      File "C:\Users\duart\Anaconda3\lib\site-packages\nbconvert\postprocessors\serve.py", line 19, in <module>
        class ProxyHandler(web.RequestHandler):
      File "C:\Users\duart\Anaconda3\lib\site-packages\nbconvert\postprocessors\serve.py", line 21, in ProxyHandler
        @web.asynchronous
    AttributeError: module 'tornado.web' has no attribute 'asynchronous'
[E 16:33:44.858 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
      "Sec-Fetch-Dest": "document",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-Mode": "navigate",
      "Referer": "http://localhost:8888/tree",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7",
      "Cookie": "_xsrf=2|37d584c5|beb93776ffb29402f03c78a6a3b34c82|1583233584; username-localhost-8889=\"2|1:0|10:1583330621|23:username-localhost-8889|44:ZGE4YTNjODEzNTFiNDg5M2FkZGE1ZGFkY2MxZGM5YTE=|b83ea2d98b45e8584d417bc787e7bc80efb124fb5df074e93c7c87b64c60930a\"; username-localhost-8888=\"2|1:0|10:1583339616|23:username-localhost-8888|44:YWM2MjYxZmE1NDFjNDA3MzhlN2IyNTZlNzJmZjdmMWM=|9b6fd50722a6f64e923e47938c495dfbd7e8dea94f16bd9d7bd996ad3cc317e1\""
    }
[E 16:33:44.861 NotebookApp] 500 GET /notebooks/Untitled2.ipynb?kernel_name=python3 (::1) 534.90ms referer=http://localhost:8888/tree

Также при установке ipykernel я получил следующую ошибку:

WARNING: The scripts jupyter-migrate.exe, jupyter-troubleshoot.exe and jupyter.exe are installed in 'C:\Users\duart\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts jupyter-kernel.exe, jupyter-kernelspec.exe and jupyter-run.exe are installed in 'C:\Users\duart\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script pygmentize.exe is installed in 'C:\Users\duart\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts iptest.exe, iptest3.exe, ipython.exe and ipython3.exe are installed in 'C:\Users\duart\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Кто-нибудь знает, как это решить?

1 Ответ

0 голосов
/ 05 марта 2020

В конце концов я все уладил. К сожалению, я понятия не имею, почему, но я пошел к навигатору anaconda с полностью настроенной виртуальной средой, установил ноутбук Jupyter и лабораторию Jupyter, и теперь все работает гладко.

...