pravj / Doga

:chart_with_upwards_trend: HTTP log monitoring console for Humans
MIT License
241 stars 9 forks source link

Installation error (Python 3) #4

Open microamp opened 10 years ago

microamp commented 10 years ago

Hello.

It's likely that it's not supported in Python 3, but...

[microamp@arch ~]$ pip --version
pip 1.5.6 from /usr/lib/python3.4/site-packages (python 3.4)
[microamp@arch ~]$ sudo pip install doga
Downloading/unpacking doga
  Downloading Doga-0.2.0.tar.gz
  Running setup.py (path:/tmp/pip_build_root/doga/setup.py) egg_info for package doga

Requirement already satisfied (use --upgrade to upgrade): npyscreen>=4.4.1 in /usr/lib/python3.4/site-packages (from doga)
Installing collected packages: doga
  Running setup.py install for doga
      File "/usr/lib/python3.4/site-packages/Doga/interfaces/sockets.py", line 52
        except socket.error, msg:
                           ^
    SyntaxError: invalid syntax

    Installing doga script to /usr/bin
Successfully installed doga
Cleaning up...

It says "Successfully installed doga" despite of the syntax error above. When I reinstall it, I get the following output.

[microamp@arch ~]$ sudo pip install doga
Requirement already satisfied (use --upgrade to upgrade): doga in /usr/lib/python3.4/site-packages
Requirement already satisfied (use --upgrade to upgrade): npyscreen>=4.4.1 in /usr/lib/python3.4/site-packages (from doga)
Cleaning up...

I get the same syntax error when I attempt to run it.

[microamp@arch ~]$ sudo doga
Traceback (most recent call last):
  File "/usr/bin/doga", line 9, in <module>
    load_entry_point('Doga==0.2.0', 'console_scripts', 'doga')()
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2472, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2186, in load
    ['__name__'])
  File "/usr/lib/python3.4/site-packages/Doga/__init__.py", line 2, in <module>
    from .interfaces.sockets import SocketInterface
  File "/usr/lib/python3.4/site-packages/Doga/interfaces/sockets.py", line 52
    except socket.error, msg:
                       ^
SyntaxError: invalid syntax

I had a brief look at the 'setup.py', but there are no Python versions supported specified in there?

pravj commented 10 years ago

Hey @microamp,

looks like the error is related to socket library functions in python3. see here, it is unable to create a raw socket.

actually I never tried python3 on myself, so didn't wrote Doga keeping python3 in mind.

I'll try to find a fix for this and version compatibility. you are free to help for it and work on this fix.

microamp commented 10 years ago

@pravj,

I think it's good to have versions supported specified in 'setup.py' for the time being, and some form of version restriction in there too. See this for instance.

I'll see if it's trivial to make it compatible with Python 3.