Error - No module named 'algosdk'

I have successfully installed algosdk using command pip3 install py-algorand-sdk but when i am going to create my account using python, it reflect an error saying that

exec(compile(contents+“\n”, file, ‘exec’), glob, loc)
File “/Users/Sach/PycharmProjects/Algorand_1/”, line 1, in
import algosdk
File “/Applications/PyCharm”, line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named ‘algosdk’

how to solve this error? Please help!! As I need to complete the Algorand Lab and Homework. Thanks in advance

1 Like

Usually, such an error occurs when you’re not installing the package in the right Python installation.
You may have multiple installations that conflict.

If you are in a console, the best way to install a package is to use:

python3 -m pip install py-algorand-sdk

from the same terminal and using the exact same python executable name as you use to run the script.
So the command above assumes you run the script as python3
(If you run the script as python3.10, then you need to run python3.10 -m pip install py-algorand-sdk, and so on).

In PyCharm, you may install packages graphically by using the tab “Python Packages” at the bottom. See Install, uninstall, and upgrade packages | PyCharm Documentation

I think however that there may be an issue with your PyCharm setup as it says “” at the bottom right. Please see Configure a Python interpreter | PyCharm Documentation

1 Like