ImportError: cannot import name attrs when running axotor.py
MatejKovacic opened this issue · 7 comments
When I am runnign python axotor.py, I get this:
Traceback (most recent call last):
File "axotor.py", line 10, in <module>
from wh import WHMgr
File "/home/matej/pyaxo/examples/wh.py", line 7, in <module>
from wormhole.wormhole import wormhole
File "/usr/local/lib/python2.7/dist-packages/wormhole/wormhole.py", line 3, in <module>
from attr import attrs, attrib
ImportError: cannot import name attrs
Before that I did:
sudo apt-get install gcc libffi-dev libsodium-dev python-dev
sudo pip install pyaxo
git clone https://github.com/rxcomm/pyaxo
cd pyaxo
sudo python setup.py install
sudo pip install PySocks
sudo pip install stem
sudo pip install wormhole
sudo pip install txtorcon
sudo pip install magic-wormhole
cd examples/
python axotor.py
I am running Ubuntu 16.04.2 LTS, 64-bit.
I get this error:
Traceback (most recent call last):
File "axotor.py", line 10, in <module>
from wh import WHMgr
File "/Users/matija/axotest/pyaxo/examples/wh.py", line 7, in <module>
from wormhole.wormhole import wormhole
ImportError: cannot import name wormhole
magic-wormhole version: 0.10.2
I created virtual environment:
source ~/pyaxo/venv/bin/activate
...and run it:
python axotor.py
... and got different error now:
Traceback (most recent call last):
File "axotor.py", line 8, in <module>
import socks
ImportError: No module named socks
BTW, I installed all the modules in virtual environment.
ImportError: cannot import name attrs
I believe magic wormhole did not have attrs listed as a requirement at that time. So that is probably the reason you got a different error later. That has been fixed.
ImportError: No module named socks
Unfortuantely there is not a proper setup for it, but the requirements are in the docstring:
This version of the chat client makes connections over the tor network.
The server creates an ephemeral hidden service and the client connects
to the hidden service. You will need to load the following additional
python modules for this to work: stem, pysocks, txtorcon, pysocks,
and magic-wormhole. They are available on pypi via pip.
ImportError: cannot import name wormhole
It looks like magic wormhole's API changed and wormhole()
is now called create()
. We will have to make some changes to axotor because installing all requirements will not make it run yet.
Thanks @MatejKovacic and @nimdajitam for the reports. @rxcomm and I will let you know as soon as that is fixed.
Sorry for the inconvenient and taking such a long time to reply :/
I've got an update for axotor.py that fixes this problem. However it won't work until this bug is fixed in wormhole.
magic-wormhole/magic-wormhole#252
When that is fixed, I will push the commit.
Fixed in update_wormhole branch.
This PR (#24) requires https://github.com/warner/magic-wormhole commit 7ad006950afa309af015b93c62a64da7749a6724
or later. Until he packages
a new release, magic-wormhole will need to be installed from git.
Merged to master.