Install problem on Linux

116 views
Skip to first unread message

Greg Stachowski

unread,
Jul 9, 2015, 10:32:34 AM7/9/15
to python...@googlegroups.com
Hi,

using pip or easy_install on Ubuntu 14.04 and 12.04 I'm getting:

Installing collected packages: dbf, enum34
  Running setup.py install for dbf
      File "/usr/local/lib/python2.7/dist-packages/dbf/ver_33.py", line 2577
        raise DbfError("unable to write updates to disk, original data restored: %r" % (exc,)) from None
                                                                                                  ^
    SyntaxError: invalid syntax
      
Successfully installed dbf

On a 32-bit Ubuntu 14.04 system "import dbf" then works despite the error, on a 64-bit system (both 12.04 and 14.04)  'import dbf' gives:  

ImportError: No module named dbf.

I'm a bit limited as to other 32-bit systems and non-Ubuntu systems, but I may be able to find some to test on later. So far I have been using dbf under 32-bit Windows in a VM without issue.

Cheers

Greg


Adrian Klaver

unread,
Jul 9, 2015, 10:47:20 AM7/9/15
to python...@googlegroups.com
This seems to be a Python version issue, so what version(s) of Python
are you running on the machines?

>
> Cheers
>
> Greg
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Python dBase" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to python-dbase...@googlegroups.com
> <mailto:python-dbase...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Adrian Klaver
adrian...@aklaver.com

Greg Stachowski

unread,
Jul 9, 2015, 10:53:52 AM7/9/15
to python...@googlegroups.com

Python 2.7.6, stock on Ubuntu 14.04 ...

--- You received this message because you are subscribed to a topic in the Google Groups "Python dBase" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-dbase/XSEjkI2yvjQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-dbase...@googlegroups.com.

Ethan Furman

unread,
Jul 9, 2015, 10:55:00 AM7/9/15
to python...@googlegroups.com
On 07/09/2015 07:32 AM, Greg Stachowski wrote:

> using pip or easy_install on Ubuntu 14.04 and 12.04 I'm getting:
>
> Installing collected packages: dbf, enum34
> Running setup.py install for dbf
> File "/usr/local/lib/python2.7/dist-packages/dbf/ver_33.py", line 2577
> raise DbfError("unable to write updates to disk, original data restored: %r" % (exc,)) from None
> ^
> SyntaxError: invalid syntax
>
> Successfully installed dbf

This is expected: I distribute mixed core files -- some are Python 3 syntax, and some are Python 2 syntax, and when the python running setup tries to byte-compile the other version's files it
generates a SyntaxError.


> On a 32-bit Ubuntu 14.04 system "import dbf" then works despite the error, on a 64-bit system (both 12.04 and 14.04) 'import dbf' gives:
>
> ImportError: No module named dbf.

This is not expected. On your 64-bit system do you have 32-bit installed as well? If yes, have you run setup.py with both versions?

I just tried installing dbf one of my 64-bit machines, got the SyntaxError during install, but then was able to import dbf with no problems.

--
~Ethan~

Greg Stachowski

unread,
Jul 9, 2015, 12:10:44 PM7/9/15
to python...@googlegroups.com
On 9 July 2015 at 16:54, Ethan Furman <et...@stoneleaf.us> wrote:

This is expected:  I distribute mixed core files -- some are Python 3 syntax, and some are Python 2 syntax, and when the python running setup tries to byte-compile the other version's files it generates a SyntaxError.

ok.
 
This is not expected.  On your 64-bit system do you have 32-bit installed as well?  If yes, have you run setup.py with both versions?

only the 64bit, and yes.

I think I've narrowed it down, however, after finding that another 64-bit Ubuntu 14.04 machine worked fine and looking at what was different. It seems to be a problem with older versions of pip.

The default version of pip on ubuntu 14.04 is 1.5.4. This doesn't install dbf properly. Neither does an upgraded version of pip if you install it with

pip install --upgrade pip

Curiously pip reports it is the new version (7.1.0), but importing dbf still gives a 'no module' error, as if some remnant of the 'old' pip remains.

But ... if I uninstall pip, purge the python-pip package, then use easy_install to install pip (7.1.0 ...) ... and then uninstall and reinstall enum34 and dbf ... it works! No syntax error during the installation, and no problem importing the module.

Also, I have to do all the pip operations as root (sudo su -), if I just do it as sudo pip .. the import dbf later fails (there seems to be some pip caching issue ...)

So, solved, and the issue is with pip. Very strange, though.

Greg

Ethan Furman

unread,
Jul 9, 2015, 12:27:49 PM7/9/15
to python...@googlegroups.com
On 07/09/2015 09:10 AM, Greg Stachowski wrote:

> I think I've narrowed it down, however, after finding that another 64-bit Ubuntu 14.04
> machine worked fine and looking at what was different. It seems to be a problem with
> older versions of pip.

Wow. Glad you figured it out! :)

--
~Ethan~

Greg Stachowski

unread,
Jul 9, 2015, 1:43:01 PM7/9/15
to python...@googlegroups.com
On 9 July 2015 at 18:27, Ethan Furman <et...@stoneleaf.us> wrote:

Wow.  Glad you figured it out!  :)

Thanks. Maybe it'll help someone else some time.
Reply all
Reply to author
Forward
0 new messages