Jupyter server cannot start - python

I am using Macbook and was running the Jupyter server fine in the past. For nearly 3 weeks I didn't use it, and now having trouble as it isn't running.
$ jupyter notebook
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 6, in <module>
from notebook.notebookapp import main
File "/usr/local/lib/python3.7/site-packages/notebook/notebookapp.py", line 62, in <module>
from tornado import httpserver
File "/usr/local/lib/python3.7/site-packages/tornado/httpserver.py", line 29, in <module>
import ssl
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
Reason: image not found
Uninstall and re-installing jupyter didn't fix it.
MacOS Catalina
Version 10.15.2 (19C57)
Any idea how to fix this?

Looks like a problem with your brew-installed openssl, try this: https://github.com/kelaberetiv/TagUI/issues/86
That being said, I have had issues in the past where homebrew updates my python version and breaks everything, so it might be worth investigating that as well

Related

Application spyder launch may have produced errors

I am trying to start Spyder from Anaconda on a Mac, but get the error below. As a result, Spyder does not launch. The same error arises if I try to launch Spyder from the terminal.
Any ideas on the cause of the error and/or how to solve it? There have been similar questions in the past but the errors were different, that's why I am reposting.
Versions:
Spyder - 3.2.8
Anaconda - 1.8.3
Python - 3.6.5
Traceback (most recent call last):
File "/anaconda3/bin/spyder", line 7, in
from spyder.app.start import main
File "/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 27, in
from spyder.config.main import CONF
File "/anaconda3/lib/python3.6/site-packages/spyder/config/main.py", line 22, in
from spyder.config.user import UserConfig
File "/anaconda3/lib/python3.6/site-packages/spyder/config/user.py", line 26, in
from spyder.utils.programs import check_version
File "/anaconda3/lib/python3.6/site-packages/spyder/utils/programs.py", line 18, in
import subprocess
File "/anaconda3/lib/python3.6/subprocess.py", line 136, in
import _posixsubprocess
ImportError: dlopen(/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe
Referenced from: /anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
Expected in: flat namespace
in /anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
you might have to downgrad python to 3.6.4.
or:
run this command:
conda update python python.app

ModuleNotFoundError: No module named 'librepo'

I recently tried to setup https://github.com/NVIDIA/FastPhotoStyle/ locally (issues with Docker that I've been waiting for stability prevented that). After installation, my DNF has started throwing errors due to a missing librepo module.
I'm using Fedora 27.
I've gathered that it has changed how Python loads it's modules (possibly due to Conda, I'm not 100% sure), but I'm struggling to get it working again.
I've tried to install the following packages:
http://fedora.is.co.za/linux/releases/27/Everything/x86_64/os/Packages/p/python3-librepo-1.8.0-1.fc27.x86_64.rpm
http://fedora.is.co.za/linux/releases/27/Everything/x86_64/os/Packages/p/python2-librepo-1.8.0-1.fc27.x86_64.rpm
but to no avail.
I've tried to locate the librepo packages in the pip or conda repositories, again to no avail.
Any command with DNF outputs the following:
Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
import dnf.base
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in <module>
from dnf.comps import CompsQuery
File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in <module>
import dnf.util
File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in <module>
import librepo
ModuleNotFoundError: No module named 'librepo'
I'd appreciate any help or insight as I've been googling a fair bit, but have yet to come to a solution

trouble loading jedi-vim after install

My issue is possibly similar to link
but thought I'd ask jic. I'm on osx and trying to use jedi-vim. I installed jedi using pip and then jedi-vim by cloning into the dir that my vim config uses for loading packages. this one for reference. When I start vim with a python program I get the "Please install Jedi if..." message. I cloned vim 74 and configured with +python and +conceal. After still getting the error I looked into the code and found it was an import error.
As an aside, this isn't the best help message. Better might be "Unable to import jedi. Have you installed Jedi?"
I tried import jedi from within vim, as :python import jedi
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0- py2.7.egg/jedi/__init__.py", line 41, in <module>
from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0 py2.7.egg/jedi/api/__init__.py", line 16, in <module>
from jedi.parser import Parser, load_grammar
File "/usr/local/lib/python2.7/site-packages/jedi-0.9.0-py2.7.egg/jedi/parser/__init__.py", line 21, in <module>
from jedi.parser import tree as pt
ImportError: cannot import name tree
If this is a build issue, is there a good reference for building vim on mac?

Jupyter - Python 3 kernel dies

Fedora 21, default Python is 2.7, 3.x installed, originally installed iPython, now have also installed Jupyter
When I try to use the Python3 kernel from Jupyter notebook, I get a message saying the kernel has died, attempting restart. Naturally restart never succeeds.
Tried following these 2 terminal commands
ipython kernelspec install-self
ipython3 kernelspec install-self
first command executes without error. second gives this error
ipython3 kernelspec install-self
I used iPython with Python 3 kernel in the past, before installing Jupyter. I don't remember installing ipython3 to do so.
Suggestions how to resolve? I have searched and the above was the only suggestion I found that was not based on using Anaconda.
Also, I do have kernel.json at
~/.ipython/kernels/python3
thank you
UPDATE
last output on terminal when kernel dies
ImportError: No module named 'ptyprocess'
UPDATE2 traceback error
[xxxxx#localhost ~]$ sudo ipython3 kernelspec install-self
Traceback (most recent call last):
File "/bin/ipython3", line 7, in <module>
from IPython import start_ipython
File "/usr/lib/python3.4/site-packages/IPython/__init__.py", line 47, in <module>
from .core.application import Application
File "/usr/lib/python3.4/site-packages/IPython/core/application.py", line 24, in <module>
from IPython.core import release, crashhandler
File "/usr/lib/python3.4/site-packages/IPython/core/crashhandler.py", line 28, in <module>
from IPython.core import ultratb
File "/usr/lib/python3.4/site-packages/IPython/core/ultratb.py", line 116, in <module>
from IPython.utils import path as util_path
File "/usr/lib/python3.4/site-packages/IPython/utils/path.py", line 19, in <module>
from IPython.utils.process import system
File "/usr/lib/python3.4/site-packages/IPython/utils/process.py", line 19, in <module>
from ._process_posix import system, getoutput, arg_split, check_pid
File "/usr/lib/python3.4/site-packages/IPython/utils/_process_posix.py", line 24, in <module>
import pexpect
File "/usr/lib/python3.4/site-packages/pexpect/__init__.py", line 75, in <module>
from .pty_spawn import spawn, spawnu
File "/usr/lib/python3.4/site-packages/pexpect/pty_spawn.py", line 11, in <module>
import ptyprocess
ImportError: No module named 'ptyprocess'
UPDATE3:
after installing ptyprocess with pip3 new error when trying to create notebook with Python 3...No module named 'path'
[I 22:29:26.125 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel 1ae58a7d-096b-4dc1-b29a-bee4385e4e9a restarted
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/IPython/__init__.py", line 48, in <module>
from .terminal.embed import embed
File "/usr/lib/python3.4/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.core.interactiveshell import DummyMod
File "/usr/lib/python3.4/site-packages/IPython/core/interactiveshell.py", line 31, in <module>
from pickleshare import PickleShareDB
File "/usr/lib/python3.4/site-packages/pickleshare.py", line 41, in <module>
from path import path as Path
ImportError: No module named 'path'
[W 22:29:29.137 NotebookApp] KernelRestarter: restart failed
I've just been installing python, ipython, upyter and pyspark as a kernel. I run into some troubles that seem to be close to what you are having. Many times that I used "sudo ..." I would get the wrong python version. I think somehow sudo run commands without a shell, so if you have any configuration (path, python version,etc), you may not get it applied when using sudo. Something you could do is to run "sudo python", then see if you can import the module path. Also you could try to run "sudo which python" to make sure it's the right version. I found that even if the user had python 2.7 installed, sudo would use python 2.6. For me the best thing to do was to log in as root and do the installation without sudo...
I have just started learning python with the jupyter notebook, and I came across the same problem you did. An associate found the problem - I had crated a python program random.py and saved it into my Python directory. Since random is also the name of a module that I installed, an error message was generated in the Anaconda prompt window. Please check your directories for .py files named after reserved words and modules.

Ropevim error in mac os 10.8.4

I use ropevim perfectly in Ubuntu system,
but i got lots of lots error.
i use homebrew to install macvim and python
and follow the tutorial.
http://wizardmode.com/2012/07/mountain-lion-and-homebrew-vim-importerror-no-module-named-site/
I wander know is the ropevim are very buggy or not practical in mac os system.
because the discussion is not popular?
or is there any better solution in vim for Python on mac os?
Thanks very much...it's annoying me lots of time
>>> import rope
>>> import ropevim
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ropevim-0.3_rc-py2.7.egg/ropevim.py", line 10, in <module>
import vim
ImportError: No module named vim
and when I put the ropevim.vim in .vim/plugin
I will got the error when using vim
/install/ropehg/ropemode:vim la
Error detected while processing function LoadRope:
line 3:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/pyt
hon2.7/site-packages/ropevim-0.3_rc-py2.7.egg/ropevim.py", line 3, in <module>
import tempfile
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/pyt
hon2.7/tempfile.py", line 32, in <module>
import io as _io
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/pyt
hon2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions
/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyInt_AsInt
Referenced from: /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/
2.7/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2
.7/lib-dynload/_io.so
I encountered a very similar stack trace when setting up some vim extensions from this page http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide
I believe the problem comes from incompatibilities between 'macport' and native python libraries, and that the native version of vim tries to pull from both.
I ultimately resolved my problem by using macport to install vim with python27 variant.
sudo port install vim +python27
The default configuration of macport's vim is without 'python' enabled.

Categories