how to resolve import error for package utils.stellar_utils in python django

24 views Asked by At

Am recieving the follwong error

#views.py

import "utils.stellar_utils " could not be resolved 

but the i have just installed the lest version of the sdk

here is a snap short of my view.py

from stellar_sdk import Keypair
from django.conf import settings
from utils.stellar_utils import server

def send_transaction(request):
    # your send transaction logic here
    source_keypair = Keypair.from_secret(request.user.secret_key)
    destination_public_key = request.POST['destination_public_key']
    amount = request.POST['amount']
    asset = Asset.native()
    transaction = (
        TransactionBuilder(
            source_account=server.load_account(source_keypair.public_key),
            network_passphrase=settings.STELLAR_NETWORK_PASSPHRASE,
            base_fee=server.fetch_base_fee(),
        )
        .append_payment_op(destination_public_key, amount, asset)
        .set_timeout(30)
        .build()
    )
    transaction.sign(source_keypair)
    response = server.submit_transaction(transaction)

and below is my requirements.txt

aiohttp==3.8.5
aiohttp-sse-client==0.2.1
aiosignal==1.3.1
asgiref==3.7.2
async-timeout==4.0.3
attrs==23.1.0
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.2.0
Django==4.2.4
frozenlist==1.4.0
idna==3.4
mnemonic==0.20
multidict==6.0.4
psycopg2-binary==2.9.7
pycparser==2.21
PyNaCl==1.5.0
requests==2.31.0
six==1.16.0
sqlparse==0.4.4
stellar-base-sseclient==0.0.21
stellar-sdk==8.2.1
toml==0.10.2
typeguard==2.13.3
tzdata==2023.3
urllib3==2.0.5
yarl==1.9.2

i am using the latest version os stella skk with all the dependencies installed

0

There are 0 answers