Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trezor one device not detecting on electrum-3.0.6/3.1.0 python tool #4082

Closed
sharath1990 opened this issue Mar 9, 2018 · 34 comments
Closed

Comments

@sharath1990
Copy link

I am using latest python-trezor v0.9.1 and electrum-3.0.6/3.1.0 wallet but that electrum wallet not able to detect trezor one device. it says AttributeError: module 'trezorlib.client' has no attribute 'types' and AttributeError: module 'trezorlib.transport_hid' has no attribute 'DEVICE_IDS'
only python electrum tool is not able to detect the device but electrum windows tool is able to detect it.
Please check with issue and resolve it as soon as possible.

@SomberNight
Copy link
Member

python-trezor 0.9.0+ will only work with electrum 3.1.0+

Make sure python-trezor is installed for python3, and perhaps try uninstalling it "multiple times" until pip says it is not installed, and then install it again, to make sure only the version you want is installed.

If you are getting either of those errors with python-trezor 0.9.1 with electrum 3.1.0, then please provide a trace.

@SomberNight
Copy link
Member

What do you mean by "python electrum tool"?

@sharath1990
Copy link
Author

its means the source code language used for electrum bitcoin wallet is python.

https://electrum.org/#download
In the above link you have "Installation from Python sources": in that you have windows tab and i am using Install Electrum-3.1.0.zip

@SomberNight
Copy link
Member

Using the same python interpreter you are experiencing the issue with, what does the following print:

python3 -m pip show trezor

@sharath1990
Copy link
Author

screenshot

@SomberNight
Copy link
Member

Could you describe a minimal example of how to reproduce the errors?

@sharath1990
Copy link
Author

Yep,
Just go to Electrum-3.0.6 folder path in command line and type "python electrum" click enter and gui will be opened in that click next and select "standard wallet" and click next and select "Use a hardware device" and click next that's it. error will be produced.

@SomberNight
Copy link
Member

Just go to Electrum-3.0.6 folder path

Again, as I said:

python-trezor 0.9.0+ will only work with electrum 3.1.0+

@sharath1990
Copy link
Author

even if i used Electrum-3.1.0 same issue i am getting.

@SomberNight
Copy link
Member

See #3928

Please provide a stack trace for the error you are getting because I cannot reproduce.

@sharath1990
Copy link
Author

if i use Electrum-3.1.0 i am not getting AttributeError, but device is not detecting, plz find the screen shots that i tried are electrum-3.0.6 with python-trezor v0.9.0; electrum-3.1.0 and python-trezor v0.9.1; and other combination.
p1
p2
p3
p4
p5

@SomberNight
Copy link
Member

Forget about electrum 3.0.6; that error is expected; only test with electrum 3.1+.
Do you have proxy settings enabled in Electrum? Please try with 3.1.1.

@sharath1990
Copy link
Author

what do you mean by proxy setting?

@SomberNight
Copy link
Member

I mean a networking proxy set up inside Electrum:

proxy

There is a bug related to that and hw wallets in 3.1.0;
but regardless, please try with 3.1.1

@sharath1990
Copy link
Author

sharath1990 commented Mar 15, 2018

Still not works.
p6

@SomberNight
Copy link
Member

please try with the -v flag, and provide logs
python electrum -v

@sharath1990
Copy link
Author

yeah done.
p7

@SomberNight SomberNight reopened this Mar 15, 2018
@SomberNight
Copy link
Member

Just to be clear, it works with the official binary, but not when running from source?

@SomberNight
Copy link
Member

SomberNight commented Mar 15, 2018

I believe you are missing the libusb dll; that raises an exception, and all transports for trezor fail.
78a9424
If you want to use the webusb transport, you will need to make sure python can import the libusb dll.
You can e.g. manually download it and place it in the root python folder.

In any case, we should minimise the problem and not let all the transports fail.

@SomberNight
Copy link
Member

Please try on current master. :)

@sharath1990
Copy link
Author

I took the current master branch & installed respective packages but it still not works?
p8

@SomberNight
Copy link
Member

Did you run python setup.py install? As in https://github.com/spesmilo/electrum#development-version

@SomberNight
Copy link
Member

Please follow the guide I linked above; that too is covered there.

@sharath1990
Copy link
Author

after this step 'python setup.py install' still it not works for me.
p10

@SomberNight
Copy link
Member

please run with -v because without logs it is a black box, literally.

@sharath1990
Copy link
Author

okay.
p11

@SomberNight SomberNight reopened this Mar 15, 2018
@SomberNight
Copy link
Member

Can you confirm that it works with the official binary?

@sharath1990
Copy link
Author

what do you mean by official binary?

@SomberNight
Copy link
Member

I mean the exe files at https://electrum.org/#download

@SomberNight
Copy link
Member

Ok, I can reproduce. It's still libusb somehow.

@SomberNight
Copy link
Member

SomberNight commented Mar 15, 2018

Ok, for the moment, I suggest downloading the libusb dll, and copying it to your python path (e.g. %localappdata%\Programs\Python\Python36-32\); as we do for the binaries in 78a9424.

The problem is that python-trezor 0.9.0 and 0.9.1 (but not the current master) import all the transports :/

Traceback (most recent call last):
  File "...\electrum\lib\base_wizard.py", line 208, in choose_hw_device
    u = devmgr.unpaired_device_infos(None, plugin)
  File "...\electrum\lib\plugins.py", line 471, in unpaired_device_infos
    client = self.create_client(device, handler, plugin)
  File "...\electrum\lib\plugins.py", line 347, in create_client
    client = plugin.create_client(device, handler)
  File "...\electrum\plugins\trezor\trezor.py", line 171, in create_client
    from trezorlib.device import TrezorDevice
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\trezorlib\device.py", line 23, in <module>
    from .transport_webusb import WebUsbTransport
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\trezorlib\transport_webusb.py", line 24, in <module>
    import usb1
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\libusb1-1.6.4-py3.6.egg\usb1\__init__.py", line 61, in <module>
    from . import libusb1
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\libusb1-1.6.4-py3.6.egg\usb1\libusb1.py", line 199, in <module>
    libusb = _loadLibrary()
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\libusb1-1.6.4-py3.6.egg\usb1\libusb1.py", line 173, in _loadLibrary
    return dll_loader('libusb-1.0' + suffix, **loader_kw)
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
[DeviceMgr] error trezor

@SomberNight
Copy link
Member

@SomberNight
Copy link
Member

Ok, it should now work on current master.

@sharath1990
Copy link
Author

yeah, it works thanks.:)

icodeface added a commit to qtumproject/qtum-electrum that referenced this issue Mar 16, 2018
yura-pakhuchiy pushed a commit to firoorg/electrum-firo-archived that referenced this issue Jul 14, 2018
yura-pakhuchiy pushed a commit to firoorg/electrum-firo-archived that referenced this issue Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants