Hundemeier / sacn

A simple ANSI E1.31 (aka sACN) module for python.
MIT License
48 stars 21 forks source link

Import Error #3

Closed localleon closed 7 years ago

localleon commented 7 years ago

If you try to import sacn to your python file , following Error occues

Code: import sacn

Output:

Traceback (most recent call last): File "sacn-test1.py", line 1, in import sacn File "/home/linuxleon/bin/VLCnet/sacn/sacn/init.py", line 1, in from .receiver import sACNreceiver, LISTEN_ON_OPTIONS File "/home/linuxleon/bin/VLCnet/sacn/sacn/receiver.py", line 64 raise TypeError(f'The given trigger "{trigger}" is not a valid one!') ^ SyntaxError: invalid syntax

Hundemeier commented 7 years ago

That's odd. I can not reproduce the error. Maybe download the module again and install it via pip install . (you have to be in the directory with the setup.py). Try to install without the -e flag

localleon commented 7 years ago

I will try to write down to process.

First I clone a fresh copy of your Repository to my Computer. Now i have the following File structure.

├── LICENSE
├── README.md
├── sacn
│   ├── __init__.py
│   ├── messages
│   │   ├── data_packet.py
│   │   ├── __init__.py
│   │   ├── root_layer.py
│   │   └── universe_discovery.py
│   ├── __pycache__
│   │   └── __init__.cpython-35.pyc
│   ├── receiver.py
│   ├── receiving
│   │   ├── __init__.py
│   │   └── receiver_thread.py
│   ├── sender.py
│   └── sending
│       ├── __init__.py
│       ├── output.py
│       └── output_thread.py
├── setup.py
└── test.py

I wrote the file test.py, it simply contains import sacn. Now i run pip install . . Libary should be installed now. Then i run my test.py with python3. Following error occues:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from sacn import *
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/__init__.py", line 1, in <module>
    from .receiver import sACNreceiver, LISTEN_ON_OPTIONS
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/receiver.py", line 64
    raise TypeError(f'The given trigger "{trigger}" is not a valid one!')
                                                                       ^
SyntaxError: invalid syntax

I hope its know clear.

And the -e Flag doesnt changes anything

localleon commented 7 years ago

I tried to comment out your raise TypeError(f'The given trigger "{trigger}" is not a valid one!') on line 64. After that, this Error message showed up.

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from sacn import *
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/__init__.py", line 1, in <module>
    from .receiver import sACNreceiver, LISTEN_ON_OPTIONS
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/receiver.py", line 9, in <module>
    from .receiving.receiver_thread import receiverThread
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/receiving/receiver_thread.py", line 6, in <module>
    from ..messages.data_packet import DataPacket
  File "/home/linuxleon/bin/VLCnet/sacn/sacn/messages/data_packet.py", line 20
    self.sourceName: str = sourceName
                   ^
SyntaxError: invalid syntax

Maybe thats more helpful. Im always getting syntax Errors. Especailly with your variable: str = variable Lines. Maybe the :str produces some Errors ?

Hundemeier commented 7 years ago

What's your python version? It should be greater than 3.6. I'm using 3.6.3. Use python --version to check the version.

localleon commented 7 years ago

Its 3.5 , im stupid