2019-08-21 15:59:59

hello
when I try to install a Module in python with the pip install command, and when I run a script that requiers the Module, it still gives me a module not found error. is there anyway to fix this?

me and a friend of mine have made a youtube channel where we upload beats that we make. If you want to check it out, you can find it at https://www.youtube.com/channel/UCD0CxF … PFlCqjOtOA

2019-08-21 17:02:39

so, you would do pip install name
so for example, pip install clipboard
then, open a new python file and do the folowing to test it,
import clipboard
name=input("what is your name")
print ("your name is" +name)
clipboard.copy(name)

if that doesn't work, there is a problem

Have a lovely day.

2019-08-21 17:11:23

There is also another issue you may run into.
Type in the command and check the last line of the output.
If it says "successfully installed package_name package_version" or "requirement already satisfied", you know that the module has been successfully installed. You can follow post 2's instructions.
If it says anything else, you know that some sort of an error occurred. You can then  google it and see if there is a solution for your problem.
May I ask what module were you trying to install?

2019-08-21 18:06:26

hi.
@amerikranian, I was trying to install the clipboard module. the problem is, it says successfully installed, but when I run the script, it still gives me the module error, evin though it was installed successfully.
should I try uninstalling python to see if that helps?

me and a friend of mine have made a youtube channel where we upload beats that we make. If you want to check it out, you can find it at https://www.youtube.com/channel/UCD0CxF … PFlCqjOtOA

2019-08-21 19:57:18

Without more details, I don't know how you expect us to provide any sort of assistance.

Send your script, name of module, whatever else you think might have some relevance the first time around. the more info the better. While you're here, find "asking questions the smart way" on google and give it a good read.
Simply saying "hey this doesn't work can you fix it please and thank you" invites continuous prompting by patient developers. Just so happens the world doesn't have too many good ones that aren't being paid. This is seen quite a lot on mailing lists, time is valuable.

2019-08-21 20:14:44

As the others said we need more informations to actually give valuable response, but here are a few things I could say
1. As dumb as it can sounds, check that the spelling is correct, as it is case sensitive.
2. Some modules have let's call it a fake name. Means that when you install them to actually use them you have to import the module with an other name. for example you would type pip install BeautifulSoup4 but you'd do import bs4. So I'd recommend to manually check in the site-packages directory.

Paul

2019-08-21 20:44:57

hi
so, I tryed to test the module problem using the script that was in post 2.
the script is
import clipboard
name=input("what is your name")
print ("your name is" +name)
clipboard.copy(name)
when I run it, I get this error
Traceback (most recent call last):                                                                                     
  File "C:\Users\remik\Documents\test.py", line 1, in <module>                                                         
    import clipboard                                                                                                   
ModuleNotFoundError: No module named 'clipboard'                                                                       
so, I tryed reinstalling the clipboard module, and it "successfully installed.
but, when I run the script again, I get the same error.
Traceback (most recent call last):                                                                                     
  File "C:\Users\remik\Documents\test.py", line 1, in <module>                                                         
    import clipboard                                                                                                   
ModuleNotFoundError: No module named 'clipboard'

me and a friend of mine have made a youtube channel where we upload beats that we make. If you want to check it out, you can find it at https://www.youtube.com/channel/UCD0CxF … PFlCqjOtOA

2019-08-22 00:40:36

The clipboard module is pretty useless because pyperclip does everything that the clipboard module does (if I'm not mistaken). Try this to get your copier to work:

import pyperclip
copy, paste = pyperclip.determine_clipboard()
copy("text")
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-22 03:32:24

Yeah, I figured that out pretty quickly after I posted the information. I will update the guide to use pyperclip, Though it may be sometime before I do so, I am quite busy these days.

2019-08-22 07:52:57

Is there any chance you have multiple installations of python on your system and you're installing modules in a different python than you're using to run the script? Only thing I can think of off the top of my head.

2019-08-22 08:49:21

Usually when you type python and pip they point to the same version, even if that's a different version that you installed. So unless you're calling a different python version maybe using even the abbreviation py, when you use the command python and pip they should theorically point to the same version. If you don't have pip fo that version, that's an other topic.

Paul

2019-08-22 09:38:50

Yeah I thought it's unlikely because just using python and pip would both use the default python installation, but couldn't really think of another reason why this would happen. One more thing actually, when you try to install a module again after having already done so (without uninstalling it), does it give you the whole installation message again or just say requirement already satisfied?

2019-08-22 14:10:19

hi
@Ethin, I tryed to run your  script , and when I run it, I get this error.
Traceback (most recent call last):                                                                                     
  File "C:\Users\remik\Documents\test2.py", line 1, in <module>                                                         
    import pyperclip                                                                                                   
ModuleNotFoundError: No module named 'pyperclip'                                                                       
should I try uninstalling python, and reinstall it again, and then install all the modules again and see if it works?

me and a friend of mine have made a youtube channel where we upload beats that we make. If you want to check it out, you can find it at https://www.youtube.com/channel/UCD0CxF … PFlCqjOtOA

2019-08-22 16:59:45

Type pip install pyperclip

2019-08-22 17:11:36

So, it seems like Python and Pip are not running under the same Python version in your case. Try this instead:

python -m pip install pyperclip

This will make sure to run pip under the very same python you use to run your script.
Best Regards.
Hijacker

2019-08-22 17:45:13

My recommendation is to first, before running any script, jump into the Python environment. Just type python in cmd, and trying importing the library. This is just to verify that your imports are either working or not working, even after pip install. If this does not work, one of a number of things could be wrong: you may have conflicting copies of Python (for example, another Python version you explicitly installed, another python version pulled in by a POSIX-like subsystem like Cygwin or Msys2, or python from somewhere in Visual Studio or similar IDE), or Pip is not properly aligned with your Python version. One last measure you can try is typing "python -m pip install library" (without the quotes) and then try importing again. Doing that command ensures that the pip module that actually corresponds to the python version you are using gets used. Finally, if all advice given here does not work, just uninstall and reinstall Python. Also, if you uninstall, make sure you delete all traces of the program, including Pip, pip cache, etc. Usually it can be found under c:\users\your_user_name\appdata\local . A few other things can be found depdning on your Python version. I hope this helps.