pybitcointools icon indicating copy to clipboard operation
pybitcointools copied to clipboard

SyntaxError: invalid syntax on import

Open sampipe opened this issue 7 years ago • 2 comments

Hi ...

I'm trying to utilise your amazing library but not getting very far unfortunately... I'm on a mac and did a standard pip install. When I import I am getting a syntax error below... Is there anything obvious I'm going wrong?... i.e. does it need python 3* etc...

Appreciate any pointers..

Sam

MuleMacTop:processor sampipe$ python Python 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information.

from cryptos import * Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/cryptos/init.py", line 10, in from .coins import * File "/Library/Python/2.7/site-packages/cryptos/coins/init.py", line 1, in from .bitcoin import * File "/Library/Python/2.7/site-packages/cryptos/coins/bitcoin.py", line 1, in from ..explorers import blockchain File "/Library/Python/2.7/site-packages/cryptos/explorers/init.py", line 1, in from . import base_insight, bitpay, blockcypher, blockdozer, dash_siampm, sochain File "/Library/Python/2.7/site-packages/cryptos/explorers/blockcypher.py", line 5 def unspent(*addrs, coin_symbol=None, api_key=None, **kwargs): ^ SyntaxError: invalid syntax

sampipe avatar Mar 25 '18 15:03 sampipe

So I tried this on python 3* on a linux machine and it works as expected. I suppose I will dev off this.

sampipe avatar Mar 25 '18 15:03 sampipe

I bumped into this as well on macos with Python 2.7.10. This requires python 3+ I think (https://legacy.python.org/dev/peps/pep-3102/) also reported in #13

gaborpapp avatar Oct 27 '18 21:10 gaborpapp

Python 2 no longer supported.

primal100 avatar Mar 23 '23 11:03 primal100