labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
332 stars 174 forks source link

Basic client install fails #165

Closed kjeldflarup closed 6 years ago

kjeldflarup commented 6 years ago

This instruction failed https://labgrid.readthedocs.io/en/latest/getting_started.html

sudo apt-get install python3 python3-virtualenv python3-pip
sudo apt install virtualenv
virtualenv -p python3 labgrid-venv
source labgrid-venv/bin/activate
pip3 install labgrid
labgrid-client --help
Traceback (most recent call last):
  File "/home/kfa/labgrid-venv/bin/labgrid-client", line 7, in <module>
    from labgrid.remote.client import main
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/__init__.py", line 1, in <module>
    from .target import Target
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/target.py", line 6, in <module>
    from .driver import Driver
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/driver/__init__.py", line 3, in <module>
    from .serialdriver import SerialDriver
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/driver/serialdriver.py", line 10, in <module>
    from ..resource import SerialPort, NetworkSerialPort
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/resource/__init__.py", line 7, in <module>
    from .udev import USBSerialPort
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/labgrid/resource/udev.py", line 148, in <module>
    class USBSerialPort(SerialPort, USBResource):
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/attr/_make.py", line 644, in attrs
    return wrap(maybe_cls)
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/attr/_make.py", line 613, in wrap
    builder = _ClassBuilder(cls, these, slots, frozen, auto_attribs)
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/attr/_make.py", line 345, in __init__
    attrs, super_attrs = _transform_attrs(cls, these, auto_attribs)
  File "/home/kfa/labgrid-venv/lib/python3.5/site-packages/attr/_make.py", line 311, in _transform_attrs
    .format(a=a)
ValueError: No mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}), type=None)

I have no idea what this error says.

This alternative though succeed, and after running this the error goes away in the virtualenv

$ git clone https://github.com/labgrid-project/labgrid
$ cd labgrid && python3 setup.py install
jluebbe commented 6 years ago

"No mandatory attributes allowed after an attribute ..." was caused by a change in the attrs python module. The labgrid release on pypi (which you installed via pip) is incompatible with that. So using the master branch from git is correct.