package python3-scipy 0.17.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1621803 reported by Sunil
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Confirmed
Medium
Unassigned
python-scipy (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I have upgraded from ubuntu 14.04 to 16.04. Hence python 3.5 is also installed along with the upgrade. Earlier I was usinf python 3.4.3.
I don't have any problem in usin g python 3.5. Even I can import scipy in python 3.5.

This error is occurring while using "sudo apt-get upgrade".

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: python3-scipy 0.17.0-1
ProcVersionSignature: Ubuntu 4.4.0-36.55-generic 4.4.16
Uname: Linux 4.4.0-36-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Fri Sep 9 12:06:01 2016
DuplicateSignature:
 package:python3-scipy:0.17.0-1
 Setting up python3-scipy (0.17.0-1) ...
 [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/scipy/_lib/decorator.py'
 dpkg: error processing package python3-scipy (--configure):
  subprocess installed post-installation script returned error exit status 1
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2016-08-24 (16 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.12~ubuntu16.04.1
SourcePackage: python-scipy
Title: package python3-scipy 0.17.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sunil (drsunilspatil60) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Julian Taylor (jtaylor) wrote :

this should clear out the error:

apt remove python3-scipy
apt install -f
apt install python3-scipy

probably some symlink replaced with file issue on upgrade.

Revision history for this message
Sunil (drsunilspatil60) wrote : Re: [Bug 1621803] Re: package python3-scipy 0.17.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
Download full text (3.3 KiB)

Thanks. After using the above commands as administrator, I got the
following:

Setting up python3-scipy (0.17.0-1) ...
[Errno 2] No such file or directory:
'/usr/lib/python3/dist-packages/scipy/_lib/decorator.py'
dpkg: error processing package python3-scipy (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-scipy-dbg:
 python3-scipy-dbg depends on python3-scipy (= 0.17.0-1); however:
  Package python3-scipy is not configured yet.

dpkg: error processing package python3-scipy-dbg (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup
error from a previous failure.
                          Processing triggers for libc-bin (2.23-0ubuntu3)
...
Errors were encountered while processing:
 python3-scipy
 python3-scipy-dbg
E: Sub-process /usr/bin/dpkg returned an error code (1)

Dr. Sunil S. Patil
Associate Professor
Department of Physics
Dr. Babasaheb Ambedkar
Marathwada University
Aurangabad.

On Fri, Sep 9, 2016 at 4:23 PM, Julian Taylor <<email address hidden>
> wrote:

> this should clear out the error:
>
> apt remove python3-scipy
> apt install -f
> apt install python3-scipy
>
> probably some symlink replaced with file issue on upgrade.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1621803
>
> Title:
> package python3-scipy 0.17.0-1 failed to install/upgrade: subprocess
> installed post-installation script returned error exit status 1
>
> Status in python-scipy package in Ubuntu:
> New
>
> Bug description:
> I have upgraded from ubuntu 14.04 to 16.04. Hence python 3.5 is also
> installed along with the upgrade. Earlier I was usinf python 3.4.3.
> I don't have any problem in usin g python 3.5. Even I can import scipy
> in python 3.5.
>
> This error is occurring while using "sudo apt-get upgrade".
>
> ProblemType: Package
> DistroRelease: Ubuntu 16.04
> Package: python3-scipy 0.17.0-1
> ProcVersionSignature: Ubuntu 4.4.0-36.55-generic 4.4.16
> Uname: Linux 4.4.0-36-generic x86_64
> ApportVersion: 2.20.1-0ubuntu2.1
> Architecture: amd64
> Date: Fri Sep 9 12:06:01 2016
> DuplicateSignature:
> package:python3-scipy:0.17.0-1
> Setting up python3-scipy (0.17.0-1) ...
> [Errno 2] No such file or directory: '/usr/lib/python3/dist-
> packages/scipy/_lib/decorator.py'
> dpkg: error processing package python3-scipy (--configure):
> subprocess installed post-installation script returned error exit
> status 1
> ErrorMessage: subprocess installed post-installation script returned
> error exit status 1
> InstallationDate: Installed on 2016-08-24 (16 days ago)
> InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64
> (20160719)
> RelatedPackageVersions:
> dpkg 1.18.4ubuntu1.1
> apt 1.2.12~ubuntu16.04.1
> SourcePackage: python-scipy
> Title: package python3-scipy 0.17.0-1 failed to install/upgrade:
> subprocess installed post-installation script returned error exit status 1
> UpgradeStatus: No upgrade log present (pr...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-scipy (Ubuntu):
status: New → Confirmed
Revision history for this message
Allan Deamon (rea-aft) wrote :

I get the same error.

I also get a similar error when I run this code in python:

`import scipy.spatial`

It was working one week ago.

```
$ python2
Python 2.7.12+ (default, Sep 1 2016, 20:27:38)
[GCC 6.2.0 20160927] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.spatial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py", line 96, in <module>
    from ._plotutils import *
  File "/usr/lib/python2.7/dist-packages/scipy/spatial/_plotutils.py", line 4, in <module>
    from scipy._lib.decorator import decorator as _decorator
ImportError: No module named decorator
>>>
$ python3
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.spatial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/scipy/spatial/__init__.py", line 96, in <module>
    from ._plotutils import *
  File "/usr/lib/python3/dist-packages/scipy/spatial/_plotutils.py", line 4, in <module>
    from scipy._lib.decorator import decorator as _decorator
ImportError: No module named 'scipy._lib.decorator'
```

Seems something related with scipy import a missing module related with decorator.

Revision history for this message
Allan Deamon (rea-aft) wrote :

This command fixed it for me. It reinstall the python 2 and 3 decorator package.

apt install --reinstall python\*-decorator

# Explanation:

On Debian place or python3 packages (/usr/lib/python3/dist-packages/) the scipy/_lib/decorator module is a symlink to the decorator module it self.

/usr/lib/python3/dist-packages/scipy/_lib# ls -l decorator.py
lrwxrwxrwx 1 root root 18 Sep 25 06:25 decorator.py -> ../../decorator.py

The package python-decorator and python3-decorator is a requirement for python-scipy and python3-scipy. According to apt, these decorator packages are installed. I checked the installed files with:

# dpkg -L python3-decorator
/.
/usr
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/decorator.py
/usr/lib/python3/dist-packages/decorator-4.0.6.egg-info
(...)

But the file /usr/lib/python3/dist-packages/decorator.py was missing. Something in my system should (the user perhaps) should have messed with it. After I forced the reinstall of this packages, it came back to work again. But it's really strange this file gone missing.

Revision history for this message
Craig Denman (cdenman) wrote :

I can confirm that your suggestion works. I simply did this:

>>sudo apt install --reinstall python\*-decorator

and apt proceeded to fix the problem. Here are the details.

sudo apt install --reinstall python\*-decorator
[sudo] password for cad:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python3-decorator' for glob 'python*-decorator'
Note, selecting 'python-decorator' for glob 'python*-decorator'
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
Need to get 18.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 python-decorator all 4.0.6-1 [9,326 B]
Get:2 http://us.archive.ubuntu.com/ubuntu yakkety/universe amd64 python3-decorator all 4.0.6-1 [9,388 B]
Fetched 18.7 kB in 0s (46.8 kB/s)
(Reading database ... 861833 files and directories currently installed.)
Preparing to unpack .../0-python-decorator_4.0.6-1_all.deb ...
Unpacking python-decorator (4.0.6-1) over (4.0.6-1) ...
Preparing to unpack .../1-python3-decorator_4.0.6-1_all.deb ...
Unpacking python3-decorator (4.0.6-1) over (4.0.6-1) ...
Setting up python-decorator (4.0.6-1) ...
Setting up python3-decorator (4.0.6-1) ...
Setting up python3-scipy (0.17.1-1) ...

Changed in python-scipy (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Sunil (drsunilspatil60) wrote :

After upgradation to ubuntu 16.04, I have added lmfit package by using
Synaptic. This has installed scipy also.
In Ubyntu 16.04, Python 3.5.2 was already installed as a default.
Hence I removed lmfit ans scipy using Synaptic.
This resolved my error.

Dr. Sunil S. Patil
Associate Professor
Department of Physics
Dr. Babasaheb Ambedkar
Marathwada University
Aurangabad.

On Thu, Oct 13, 2016 at 9:45 PM, Launchpad Bug Tracker <
<email address hidden>> wrote:

> Status changed to 'Confirmed' because the bug affects multiple users.
>
> ** Changed in: python-scipy (Ubuntu)
> Status: New => Confirmed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1621803
>
> Title:
> package python3-scipy 0.17.0-1 failed to install/upgrade: subprocess
> installed post-installation script returned error exit status 1
>
> Status in python-scipy package in Ubuntu:
> Confirmed
>
> Bug description:
> I have upgraded from ubuntu 14.04 to 16.04. Hence python 3.5 is also
> installed along with the upgrade. Earlier I was usinf python 3.4.3.
> I don't have any problem in usin g python 3.5. Even I can import scipy
> in python 3.5.
>
> This error is occurring while using "sudo apt-get upgrade".
>
> ProblemType: Package
> DistroRelease: Ubuntu 16.04
> Package: python3-scipy 0.17.0-1
> ProcVersionSignature: Ubuntu 4.4.0-36.55-generic 4.4.16
> Uname: Linux 4.4.0-36-generic x86_64
> ApportVersion: 2.20.1-0ubuntu2.1
> Architecture: amd64
> Date: Fri Sep 9 12:06:01 2016
> DuplicateSignature:
> package:python3-scipy:0.17.0-1
> Setting up python3-scipy (0.17.0-1) ...
> [Errno 2] No such file or directory: '/usr/lib/python3/dist-
> packages/scipy/_lib/decorator.py'
> dpkg: error processing package python3-scipy (--configure):
> subprocess installed post-installation script returned error exit
> status 1
> ErrorMessage: subprocess installed post-installation script returned
> error exit status 1
> InstallationDate: Installed on 2016-08-24 (16 days ago)
> InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64
> (20160719)
> RelatedPackageVersions:
> dpkg 1.18.4ubuntu1.1
> apt 1.2.12~ubuntu16.04.1
> SourcePackage: python-scipy
> Title: package python3-scipy 0.17.0-1 failed to install/upgrade:
> subprocess installed post-installation script returned error exit status 1
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/python-scipy/+
> bug/1621803/+subscriptions
>

Revision history for this message
Zamaan (zamaan) wrote :

I use ubuntu 16.04. I confirm the solution by Allan "Deamon (rea-aft)" also fixed my problem.

shira (shirayann)
Changed in python-scipy (Ubuntu):
assignee: nobody → shira (shirayann)
Revision history for this message
Niklas Sombert (ytvwld) wrote :

I encountered the same problem today, but with scipy 0.19.1-2ubuntu1 in Bionic.
sudo apt install --reinstall python\*-decorator also solved this for me.

@shirayann are you still working on this?

Revision history for this message
Paul White (paulw2u) wrote :

@ytvwld, shirayann's profile suggests that he/she was never working on this bug.

Changed in python-scipy (Ubuntu):
assignee: shira (shirayann) → nobody
Revision history for this message
Syed Habeeb Ullah Quadri (shuq007) wrote :

I'm using 19.1 and `sudo apt install --reinstall python\*-decorator` is giving me error that `E: Unable to locate package python*-decorator`. When I checked for decorator.py it is present.

Revision history for this message
Syed Habeeb Ullah Quadri (shuq007) wrote :

At first I've got following errors after upgrade.

Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-scipy is already the newest version (1.3.3-3build1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3-scipy (1.3.3-3build1) ...
/usr/lib/python3.8/subprocess.py:838: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  self.stdin = io.open(p2cwrite, 'wb', bufsize)
Traceback (most recent call last):
  File "/usr/lib/python3.8/py_compile.py", line 197, in main
    compile(filename, doraise=True)
  File "/usr/lib/python3.8/py_compile.py", line 142, in compile
    source_bytes = loader.get_data(file)
  File "<frozen importlib._bootstrap_external>", line 972, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/scipy/_lib/decorator.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/py_compile.py", line 218, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/py_compile.py", line 204, in main
    if quiet < 2:
NameError: name 'quiet' is not defined
dpkg: error processing package python3-scipy (--configure):
 installed python3-scipy package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3-scipy
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then I fixed py_compile.py for quiet. Tried to upgrade again got following errors:

/usr/lib/python3.8/subprocess.py:838: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  self.stdin = io.open(p2cwrite, 'wb', bufsize)
[Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/scipy/_lib/decorator.py'
dpkg: error processing package python3-scipy (--configure):
 installed python3-scipy package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3-scipy
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then tried to check for decorator which is present
dpkg -L python3-decorator
/.
/usr
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info/not-zip-safe
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info/pbr.json
/usr/lib/python3/dist-packages/decorator-4.3.0.egg-info/top_level.txt
/usr/lib/python3/dist-packages/decorator.py

Revision history for this message
Syed Habeeb Ullah Quadri (shuq007) wrote :

/usr/lib/python3/dist-packages/scipy/_lib# ls -l decorator.py

lrwxrwxrwx 1 root root 18 Feb 18 15:17 decorator.py -> ../../decorator.py

Revision history for this message
Syed Habeeb Ullah Quadri (shuq007) wrote :

It seems decorator is missing in the bundle itself:
apt install --reinstall python\*-decorator
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python*-decorator

py_compile.py also needed to be fixed for quiet.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.