0

I tried to install Jupyter Notebook from here but sadly get this error.

how to fix it?

Do you want to continue? [Y/n] y
Setting up linux-image-4.15.0-65-generic (4.15.0-65.74~16.04.1) ...
Processing triggers for linux-image-4.15.0-65-generic (4.15.0-65.74~16.04.1) ...
/etc/kernel/postinst.d/apt-auto-removal:
Traceback (most recent call last):
  File "/usr/local/bin/sort", line 6, in <module>
    from sort import cli
  File "/usr/local/lib/python2.7/dist-packages/sort.py", line 3
    print('This is suroegin's package - sort')
                            ^
SyntaxError: invalid syntax
run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 1
dpkg: error processing package linux-image-4.15.0-65-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.15.0-65-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I already uesd:

sudo apt-get -f install    
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
REDHWAN
  • 193
  • 1
  • 10
  • 4
    Possible duplicate of [Install Jupyter Notebook for Python 2.7](https://askubuntu.com/questions/847263/install-jupyter-notebook-for-python-2-7) The accepted answer also contains commands for installing Jupyter for Python 3.x. – karel Oct 06 '19 at 13:44
  • frist of all, thank you for your help. I am working with python 2.7.12, the output: `def cli(): print('This is suroegin's package - sort') ` – REDHWAN Oct 06 '19 at 14:17
  • for jupyter, when I use the command in terminal : `jupyter notebook `, the output: `Traceback (most recent call last): File "/home/redhwan/.local/bin/jupyter", line 6, in from jupyter_core.command import main ImportError: No module named 'jupyter_core' ` – REDHWAN Oct 06 '19 at 14:32

1 Answers1

0

Try the following

  • Open /usr/local/lib/python2.7/dist-packages/sort.py
  • Go to line 3
  • replace print('This is suroegin's package - sort') with

    print("This is suroegin's package - sort")

  • Rerun the command you ran

JosephWorks
  • 157
  • 5