Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Idl
✓ from anchorpy_core.idl import Idl
Correct import for the IDL type
Program
✓ from anchorpy_core.program import Program
Correct import for the Program client
Initialize a connection to a Solana program using anchorpy-core's provider pattern.
import os
from anchorpy import Provider, Wallet
from solders.pubkey import Pubkey
# Connect to Solana devnet
provider = Provider.local()
# Replace with your program ID
program_id = Pubkey.from_string(os.environ.get('PROGRAM_ID', 'YourProgramIDHere'))
print(f"Connected to provider, ready to interact with {program_id}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'anchorpy_core'
Installed wrong package (e.g., 'anchorpy' instead of 'anchorpy-core') or version pinned to old release.
fixRun 'pip install anchorpy-core' and ensure version >=0.2.0.
ImportError: cannot import name 'Idl' from 'anchorpy'
Trying to import from the old 'anchorpy' package which has a different structure.
fixUse 'from anchorpy_core.idl import Idl'.
Upgrade
Version history
0.2.0latest on PyPI · released Dec 29, 2023
Audit
Dependencies
anchorpyrequiredCore dependency for Anchor IDL parsing and client
soldersrequiredSolana data types
Resources
No resource links recorded.