1

I have installed boto3 module using Windows 10 CMD and restarted my kernel. However, the kernel cannot find the module and shows the error

ModuleNotFoundError: No module named 'boto3' when tested using Anaconda

I have used pip3 because I am using Python 3

Here are my installation steps

pip3 install boto3

pip3 show boto3

shows the details of the installed boto3 package

What could be the problem?

Benson Kimathi
  • 71
  • 1
  • 1
  • 8
  • And what does the code look like ? did you import it ? – azro Sep 26 '20 at 09:13
  • Does this answer your question? [Unable to install boto3](https://stackoverflow.com/questions/33388555/unable-to-install-boto3) – Priyal Sep 26 '20 at 09:18
  • You should also be sure that pip3 is installing modules to the correct location. For example I had a similar issue when I had a virtual environment and after performing an incorrect pip upgrade modules were installed in the wrong location. – Sebastian Peterlin Sep 26 '20 at 09:19
  • _I have used pip3 because I am using Python 3_ Are you not using Conda? – AMC Sep 28 '20 at 22:18

3 Answers3

3

Try installing using this command

python -m pip install --user boto3
Dwij Sheth
  • 280
  • 1
  • 7
  • 20
  • 1
    Conda generally encourages users to prefer installing through Conda rather than Pip when the package is available through both. Further, the `--user` flag should never be used in a virtual environment because it will install outside the environment, violating the isolation integral to maintaining coexisting virtual environments. – merv Sep 26 '20 at 20:52
2

When using windows and you have Anaconda installed, it gets simple Open

Anaconda Powershell Prompt (Anaconda3)

and run as an administrator. This will give you the privilege to install the package to the Environment Then run

conda install -c anaconda boto3

It should work

Benson Kimathi
  • 71
  • 1
  • 1
  • 8
0

1st try to update the pip with the below command and try again.

python -m pip install --upgrade pip
Priyal
  • 633
  • 1
  • 8
  • 21
  • 1
    This is not a good idea for a Conda environment. This will result in clobbering the Conda-installed version of pip with the PyPI version. – merv Sep 26 '20 at 20:46
  • I took your idea and installed the package via conda. Everything is working now! – Benson Kimathi Sep 28 '20 at 07:37
  • i am glad it helped you. Please close your question by clicking the checkmark to the left of the answer that helped you most :D – Priyal Sep 28 '20 at 09:35