Open syntaxaire opened 7 years ago
This seems to have bitten someone else with a different filename in #2270.
In general, you can't call your modules the same thing as modules that IPython relies on. In this case, you're clashing with the standard library profile module.
IPykernel 4.6, when it is released, should include a workaround that allows the kernel to start in that case (see ipython/ipykernel#209). But then you won't be able to import your module with import profile
, so it's still not a good name.
Has anyone encountered this? I am dealing with it right now, and getting a similar traceback:
root@ad9085cdd07d:/code# jupyter notebook
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1368, in initialize
self.init_webapp()
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1161, in init_webapp
self.jinja_environment_options
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 154, in __init__
base_url, default_url, settings_overrides, jinja_env_options)
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 263, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 874, in nbextensions_path
from IPython.paths import get_ipython_dir
File "/usr/local/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
from .terminal.embed import embed
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/embed.py", line 17, in <module>
from IPython.terminal.ipapp import load_default_config
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ipapp.py", line 28, in <module>
from IPython.core.magics import (
File "/usr/local/lib/python3.6/site-packages/IPython/core/magics/__init__.py", line 21, in <module>
from .execution import ExecutionMagics
File "/usr/local/lib/python3.6/site-packages/IPython/core/magics/execution.py", line 23, in <module>
import cProfile as profile
File "/usr/local/lib/python3.6/cProfile.py", line 22, in <module>
run.__doc__ = _pyprofile.run.__doc__
AttributeError: module 'profile' has no attribute 'run'
Do you have the PYTHONPATH
environment variable set? That issue shouldn't usually affect launching the notebook.
Has anyone encountered this? I am dealing with it right now, and getting a similar traceback:
root@ad9085cdd07d:/code# jupyter notebook Traceback (most recent call last): File "/usr/local/bin/jupyter-notebook", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance app.initialize(argv) File "<decorator-gen-7>", line 2, in initialize File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1368, in initialize self.init_webapp() File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1161, in init_webapp self.jinja_environment_options File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 154, in __init__ base_url, default_url, settings_overrides, jinja_env_options) File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 263, in init_settings nbextensions_path=jupyter_app.nbextensions_path, File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 874, in nbextensions_path from IPython.paths import get_ipython_dir File "/usr/local/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module> from .terminal.embed import embed File "/usr/local/lib/python3.6/site-packages/IPython/terminal/embed.py", line 17, in <module> from IPython.terminal.ipapp import load_default_config File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ipapp.py", line 28, in <module> from IPython.core.magics import ( File "/usr/local/lib/python3.6/site-packages/IPython/core/magics/__init__.py", line 21, in <module> from .execution import ExecutionMagics File "/usr/local/lib/python3.6/site-packages/IPython/core/magics/execution.py", line 23, in <module> import cProfile as profile File "/usr/local/lib/python3.6/cProfile.py", line 22, in <module> run.__doc__ = _pyprofile.run.__doc__ AttributeError: module 'profile' has no attribute 'run'
Hi, I can confirm the problem still exists and it affects Jupyter Lab too. In my case I created a notebook called "profile.ipynb" and since I am using a post save hook a python file "profile.py" is created when the notebook is saved (via auto and manual save).
Traceback (most recent call last): File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, infrom ipykernel import kernelapp as app File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel\__init__.py", line 2, in from .connect import * File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel\connect.py", line 13, in from IPython.core.profiledir import ProfileDir File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\__init__.py", line 55, in from .terminal.embed import embed File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\terminal\embed.py", line 17, in from IPython.terminal.ipapp import load_default_config File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 28, in from IPython.core.magics import ( File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\magics\__init__.py", line 21, in from .execution import ExecutionMagics File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\magics\execution.py", line 24, in import cProfile as profile File "C:\Users\thib\AppData\Local\Continuum\anaconda3\lib\cProfile.py", line 22, in run.__doc__ = _pyprofile.run.__doc__ AttributeError: module 'profile' has no attribute 'run'
C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0\ C:\Windows\System32\OpenSSH\ C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL C:\Program Files\Intel\Intel(R) Management Engine Components\DAL C:\Program Files\Git LFS C:\Program Files\Git\cmd C:\Program Files\PuTTY\ C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\ C:\Program Files\nodejs\ C:\Program Files\Amazon\AWSCLI\bin\ C:\Users\thib\.cargo\bin C:\Users\thib\AppData\Local\Microsoft\WindowsApps C:\Users\thib\AppData\Local\GitHubDesktop\bin C:\Users\thib\AppData\Local\atom\bin C:\Users\thib\AppData\Local\Continuum\anaconda3\ C:\Users\thib\AppData\Local\Continuum\anaconda3\Library\bin\ C:\Users\thib\AppData\Local\Continuum\anaconda3\Scripts\ C:\Users\thib\AppData\Local\Continuum\anaconda3\condabin\ C:\Users\thib\AppData\Roaming\npm
As in title. Attempting to create a new notebook or open an existing one fails to launch the kernel. My profile.py is an empty, zero length file. Fresh install of Python 3.6 with only Jupyter installed.