You are not logged in.

#1 2015-03-18 06:38:52

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Problem with python programs

I noticed that often when I close some program written in pyton, I can no longer start it, for example:

$ solaar
Traceback (most recent call last):
  File "/usr/bin/solaar", line 43, in <module>
    import solaar.gtk
  File "/usr/lib/python3.4/site-packages/solaar/gtk.py", line 25, in <module>
    import solaar.i18n as _i18n
  File "/usr/lib/python3.4/site-packages/solaar/i18n.py", line 54, in <module>
    import gettext as _gettext
  File "/usr/lib/python3.4/gettext.py", line 49, in <module>
    import locale, copy, io, os, re, struct, sys
  File "/usr/lib/python3.4/struct.py", line 13, in <module>
    from _struct import *
ImportError: /usr/lib/python3.4/lib-dynload/_struct.cpython-34m.so: cannot read file data: Input/output error

I get very similar issue with attic backup software when I ctrl+c it.

Can it be solved in any other way than system restart?

Offline

#2 2015-03-18 09:48:04

rep_movsd
Member
Registered: 2013-08-24
Posts: 148

Re: Problem with python programs

Can you check if the python process is somehow still running after it ends?

Perhaps the file is locked exclusively?

Offline

#3 2015-03-18 10:07:31

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Problem with python programs

No, there are other instances of python2 and python3 running, but they are for other programs. However, I did kill all those python instances and it still did not help.

Here is another, more important example of a failing python program, because I must really on it working flawlessly several times per day.

I was running attic, till it stopped with an error (bullshit, btw, as there still 60% of the target hdd is empty)

attic: /mnt/Disk_D/FTP/GSM/i9195/AIK-Linux-v1.6/ramdisk-new.cpio.gz: [Errno 28] No space left on device
/mnt/Disk_D/FTP/GSM/i9195/AIK-Linux-v1.6/repackimg.sh
attic: Error: Archive panzor-2015-03-18T10:07:23.470841.checkpoint already exists
Command '('attic', 'create', '--exclude-from', '/etc/atticmatic/excludes.data', '/mnt/usb/data.attic::panzor-2015-03-18T10:07:23.470841', '/home/juha', '/mnt/Disk_D/#_Books', '--verbose', '--stats')' returned non-zero exit status 1

(This error is just an example. I experience the same python  problem even if I quit it with ctrl+c.)

So I try to rerun the command, I now get:

Traceback (most recent call last):
  File "/usr/bin/atticmatic", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 25, in <module>
    import zipfile
  File "/usr/lib/python3.4/zipfile.py", line 13, in <module>
    import shutil
  File "/usr/lib/python3.4/shutil.py", line 14, in <module>
    import tarfile
  File "/usr/lib/python3.4/tarfile.py", line 47, in <module>
    import struct
  File "/usr/lib/python3.4/struct.py", line 13, in <module>
    from _struct import *
ImportError: /usr/lib/python3.4/lib-dynload/_struct.cpython-34m.so: cannot read file data: Input/output error

And this remains true until I reboot.

Offline

#4 2015-03-18 12:15:03

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Problem with python programs

Lockheed wrote:
cannot read file data: Input/output error

Have you ruled out the possibility of a hard drive / hardware problem? It would be strange if this was the only error that ever showed up because of it, but if the software works for other users and you aren't using a special hack / configuration then I wouldn't rule out a hardware issue.

When did this start happening? What changed on your computer at that time?

Offline

#5 2015-03-18 15:03:19

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Problem with python programs

pacman -S python


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2015-03-18 17:55:02

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Problem with python programs

drcouzelis wrote:

When did this start happening? What changed on your computer at that time?

When I started using Attic. I did not use it before, and did not see this problem before, but that might be because I did not use many python command line tools before.

Mr.Elendig wrote:

pacman -S python

Actually, that seems to have helped. Can you briefly explain why?

Offline

#7 2015-03-19 11:06:17

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Problem with python programs

Lockheed wrote:
Mr.Elendig wrote:

pacman -S python

Actually, that seems to have helped. Can you briefly explain why?

I think that will reinstall Python. Maybe your Python installation was corrupt. Maybe... I'll have to take back what I've been saying all this time. sad sad

Offline

Board footer

Powered by FluxBB