0
votes

I'm having a hard time importing a kernel into Jupyter notebook. The code I'm using in Anaconda is:

activate deeplearningproject

(deeplearningproject) C:\Users\asus>python -m ipykernel install --user --
name deeplearningproject --display-name "deeplearningproject"

And the output is:

File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\runpy.py", line 163, in _run_module_as_main mod_name, _Error) File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\runpy.py", line 111, in _get_module_details import(mod_name) # Do not catch exceptions initializing package File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\ipykernel__init__.py", line 2, in from .connect import * File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\ipykernel\connect.py", line 13, in from IPython.core.profiledir import ProfileDir File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython__init__.py", line 48, in from .core.application import Application File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\core\application.py", line 25, in from IPython.core import release, crashhandler File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\core\crashhandler.py", line 28, in from IPython.core import ultratb File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\core\ultratb.py", line 119, in from IPython.core import debugger File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\core\debugger.py", line 37, in from IPython.utils import PyColorize, ulinecache File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\utils\ulinecache.py", line 11, in from IPython.utils import openpy File "C:\Users\asus\Anaconda2\envs\deeplearningproject\lib\site-packages\IPython\utils\openpy.py", line 9, in import io File "io.py", line 1 Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 ^ SyntaxError: invalid syntax

Can anyone tell me why I get the Python 3.4.3 line in the end at all and is this why it is not running? I'm using Python 2.7 version. Is there a possibility that an old file from Python 3.4. that I had previously from IBM SPSS has stayed somewhere in the system files and is causing trouble?

Thanks in advance!

1
Check the system path, maybe python 3.4 is still there, or you have Anaconda for python 3?Kacper Wolkowski
@KacperWolkowski do you mean the environment variables? Yes, I removed everything from there, still the same error message.DanaDaskalova
Which version is reported when you run python --version on the command line?Toni Vanhala
@ToniVanhala it was Python 2.7.13DanaDaskalova

1 Answers

0
votes

I fixed it, in case someone is running into the same mistake- for Windows 10, Python 2.7 creating a kernel in Jupyter through Anaconda works fine with:

ipython kernel install --user --name nameofyourproject