0

So I am kind of new to Python and I downloaded “Anaconda3”. I added the Anaconda path the my environment variable.

I tried to install

pip3 install keyboard

And when I tried to import keyboard in my program, it says module not found. When I try to install it again, it say Requirement already satisfied.

Am I missing something? I am new to python so I must be doing something wrong here

  • 2
    Are you using python or python3 to run your program? Its quiet possible that python is set default to python2. Try using python3 – Omkar Nath Singh Nov 11 '18 at 16:20
  • try using just pip install, and try some other library/module and see if the issue occurs again – Paritosh Singh Nov 11 '18 at 16:25
  • may be that post will helpfuly for you: https://stackoverflow.com/questions/41060382/using-pip-to-install-packages-to-anaconda-environment – Andrey Topoleov Nov 11 '18 at 16:26
  • I used "python file.py" and the module worked perfectly, but "file.py" the module doesn't work. I don't understand the difference, can you reply to the post explaining the reason as an answer? thank you – Jiji Gaming Nov 11 '18 at 16:29

1 Answers1

1

Are you running the code with IDLE? If you're running the code on a version of IDLE Python thats different from the Anaconda Python version, the modules installed will not be applicable.

If you are new to python I fully recommend that you dont use Anaconda and use only IDLE for python, this way you don't have to worry about things like environment setup.

Vikhyat Agarwal
  • 1,723
  • 1
  • 11
  • 29
  • I personally found Anaconda extremely user friendly as a new programmer. – Paritosh Singh Nov 11 '18 at 16:26
  • But IDLE - python's default installed editor has basic features that a beginner would need and I have not seen any procedures that may seem confusing for any developer. However my statement was supposed to be just a suggestion. – Vikhyat Agarwal Nov 11 '18 at 16:28
  • Yes looks like I was running the code "IDLE" which I understood it as using cmd to run the script and not using anaconda. and thank you – Jiji Gaming Nov 11 '18 at 16:35