Comments (22)
It works!
The correct installation for Python 3 is:
python3 -m venv /tmp/v3
. /tmp/v3/bin/activate
pip install 'setuptools>=19.0.0'
pip install protobuf==3.0.0b2.post2 # needed for Python 3 support for protobuf
pip install Cython # needed to build python-trezor
pip install git+https://github.com/trezor/python-trezor.git
pip install git+https://github.com/romanz/trezor-agent.git
Thanks :)
from trezor-agent.
Thanks for reporting this issue!
Could you please try to run it with Python 2?
I think that there may be a problem with Python 3.
from trezor-agent.
As far as I understand, this happens due to non-relative import
statement at trezorlib/client.py.
In Python 3, it should be written as:
from . import mapping
from trezor-agent.
@romanz How do I do that?
from trezor-agent.
Sorry for the inconvenience, I will try to prepare a PR to python-trezor to add support for Python 3.
Meanwhile, you can install Python 2 on your machine, and use it to run trezor-agent...
from trezor-agent.
from trezor-agent.
@romanz Please give it a try and tell me back, branch "python3" might work for you already (basic functionality tested on Python 3.4 against emulator, I don't have device with myself).
from trezor-agent.
Thanks a lot for the fixes!
There was a small issue at transport_hid
(fixed by trezor/python-trezor#57) and after installing protobuf==3.0.0b2.post2
dependency (since protobuf==2.6.1
isn't compatible with Python 3), trezor-agent
works like a charm :)
from trezor-agent.
@ywecur trezor-agent
should work now on Python 3.
Please try it and tell me if it works for you.
python3 -m venv /tmp/v3
. /tmp/v3/bin/activate
pip install protobuf==3.0.0b2.post2 # needed for Python 3 support for protobuf
pip install Cython # needed to build python-trezor
pip install git+https://github.com/trezor/python-trezor.git@python3
pip install git+https://github.com/romanz/trezor-agent.git@python3
trezor-agent -vv localhost # should print you NIST256 SSH public key
EDIT: this may not work - see below: #11 (comment)
from trezor-agent.
@ywecur ?
from trezor-agent.
Somehow, the latest hidapi
package fails to build on Python3:
$ pip install hidapi==0.7.99.post16
Downloading/unpacking hidapi==0.7.99.post16
Using download cache from /home/roman/.pip_download_cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2F35%2Fe0%2Fc6b3da6999043d96cda6a1c44d5f1054058cc6e5c05b1139886444b31bb0%2Fhidapi-0.7.99.post16.tar.gz
Running setup.py (path:/tmp/pip-build-fbriuxzv/hidapi/setup.py) egg_info for package hidapi
Installing collected packages: hidapi
Found existing installation: hidapi 0.7.99.post15
Uninstalling hidapi:
Successfully uninstalled hidapi
Running setup.py install for hidapi
building 'hid' extension
error: unknown file type '.pyx' (from 'hid.pyx')
Complete output from command /media/oldhome/roman/Code/trezor/trezor-agent/v3/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-fbriuxzv/hidapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7ybd1pqu-record/install-record.txt --single-version-externally-managed --compile --install-headers /media/oldhome/roman/Code/trezor/trezor-agent/v3/include/site/python3.4:
running install
running build
running build_ext
building 'hid' extension
error: unknown file type '.pyx' (from 'hid.pyx')
However, hidapi==0.7.99.post15
seems to be working fine (on Python 3).
from trezor-agent.
@prusnak Could you please take a look on this issue?
from trezor-agent.
What version of Cython do you use? I had similar issue and fixed it by installing older Cython version. I did not dig into the problem more as I needed to focus to another thing, but if this will fix problem for you, we should stick the version and report it to cython.
Edit: nevermind, I see its installation from pip where cython is not required anymore.
from trezor-agent.
setuptools is usually the culprit. make sure you have at least version 19.
edit: setuptools>=19.0 added to install_requires
from trezor-agent.
Thanks! I will retry the installation :)
from trezor-agent.
Now the installation should be even simpler:
python3 -m venv /tmp/v3
. /tmp/v3/bin/activate
pip install -U setuptools Cython
pip install git+https://github.com/romanz/trezor-agent.git
from trezor-agent.
hello, I'm having the same issue as @romanz when trying to install hidapi with python3:
error: unknown file type '.pyx' (from 'hid.pyx')
it works with hidapi==0.7.99.post15, and it fails with any ulterior version.
from trezor-agent.
from trezor-agent.
Downloading hidapi-0.7.99.post20.tar.gz (51kB): 51kB downloaded
Running setup.py (path:/tmp/pip_build_root/hidapi/setup.py) egg_info for package hidapi
Downloading/unpacking setuptools>=19.0 (from hidapi)
Downloading setuptools-34.2.0-py2.py3-none-any.whl (389kB): 389kB downloaded
Requirement already satisfied (use --upgrade to upgrade): six>=1.6.0 in /usr/local/lib/python3.4/dist-packages (from setuptools>=19.0->hidapi)
Requirement already satisfied (use --upgrade to upgrade): appdirs>=1.4.0 in /usr/local/lib/python3.4/dist-packages (from setuptools>=19.0->hidapi)
Requirement already satisfied (use --upgrade to upgrade): packaging>=16.8 in /usr/local/lib/python3.4/dist-packages (from setuptools>=19.0->hidapi)
Installing collected packages: hidapi, setuptools
Running setup.py install for hidapi
building 'hid' extension
error: unknown file type '.pyx' (from 'hid.pyx')
Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/hidapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8f18cgdt-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'hid' extension
error: unknown file type '.pyx' (from 'hid.pyx')
from trezor-agent.
@prusnak I am running the latest setuptools, see above
from trezor-agent.
Do you have Cython installed? Preferably also latest
from trezor-agent.
@prusnak I have Cython-0.25.2, installed with pip3
from trezor-agent.
Related Issues (20)
- Rename NotFoundError exception to DeviceNotFoundError HOT 1
- ECDH curve hard-coded HOT 2
- Apply consistent style to imports in the hardware device agent scripts HOT 1
- Please enable discussions HOT 2
- [Suggestion] Use concurrency tag for GitHub workflows HOT 2
- Trezor session can't be reset if trezor-aegnt crashes or is killed during input HOT 2
- Unable to generate new GPG primary key HOT 8
- gpg addkey hangs for 2 days HOT 4
- gpg: signing failed: End of file HOT 4
- [gpg] Unable to init gpg identity HOT 4
- Invalid status 6a80 (Unknown reason)) communicating with LedgerNanoS
- protobuf issue with keepkey_agent 0.9.0
- ledger-agent <hostname> -vs fails to sign key HOT 6
- trezor-gpg-agent + pass + aws-vault does not work
- Unexpected behavior of trezor-gpg-agent after `trezorctl clear-session` call
- Risk of pip Typosquatting attack HOT 2
- age-plugin-trezor: support sessions
- trezor-gpg-agent cache expiration HOT 2
- Pinentry with trezor HOT 3
- Selection among multiple keys fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trezor-agent.