I see there are other question like this but none can solve my issue. I'm trying the Algosdk in PyCharm following the tutorial snippet. But when I try to write it in my PyCharm i get always this error
Cannot find reference 'get_accounts' in __init__.py
in PyCharm in the first line of this
from utils import get_accounts, get_algod_client
from algosdk import account, mnemonic
accts = get_accounts()
The same error appears also in get_algod_client
I've followed the path and I've discovered that the __init__.py of utils is empty, but I don't know how to fill it, because i downloaded it from the official Algorand website.
I have also imported the the py-algorand-sdk in my Project interpreter (Settings->Project: MyProject-> Python interpreter) but nothing changed.
Thanks all for the help
I have just tried on a fresh new PyCharm 2023.1.2 project (Python 3.11 with a venv), creating just two files in the project:
main.pyandutils.py. And I do not have the issue.main.py:utils.pyfrom https://github.com/algorand/py-algorand-sdk/blob/79c6ce965391dddc6764d75d8e2f6f11a194a21d/examples/utils.pyIt is possible however that if you have an older version that has some issues.
Can you try/check:
utils.pyexists in the same folder and is the one above.You can also check whether the issue is PyCharm-related or not, by running in the console
python3 main.py.