0

I am running a remote/dedicated Debian server over ssh and was hoping to get a discord bot running on it. I've run into a problem where python3 is telling me the 'discord' module can't be found despite making sure it has been installed countless times. Seen here:

enter image description here

It seems to me the module is clearly installed but python3 just can't find it. Any ideas?

I have tried several solutions from this site and others but none seem to fix it.

Patrick Haugh
  • 59,226
  • 13
  • 88
  • 96
Plutoren
  • 3
  • 1
  • Your `pip3` and `python3` might not be looking in the same places. What do you see for `pip3 show discord.py`? There should be a `Location` field in the result. Compare that to say `import csv; print(csv.__file__)` in your interpreter. – Patrick Haugh Sep 19 '18 at 00:44
  • Thanks for the quick response, it appears as though the locations are not exactly the same! One is looking in a 3.5 file and the other is in a 3.6 file. How can I go about correcting this? Here is the output https://i.gyazo.com/a3a4ad5e11a8d3932c69a56679f6afba.png – Plutoren Sep 19 '18 at 00:53

1 Answers1

1

You can make sure that you're using the pip associated with the python executable you're using by using the python -m mode.

python3 -m pip install discord

If you need to support multiple Python versions on a single machine (very common), I would recommend using something to manage the versions for you. I use pyenv personally, but there are a few more out there.

Patrick Haugh
  • 59,226
  • 13
  • 88
  • 96
  • /usr/local/bin/python3: No module named pip I get this error when running that command, I have seen tons of people suggest this command but I cant seem to figure out how to actually use it I tried following this guide, https://stackoverflow.com/questions/18363022/importerror-no-module-named-pip but still no luck. Here's some output that might help you understand my issues https://i.gyazo.com/c2d8a6588048243d9155d3752aad0aa0.png – Plutoren Sep 19 '18 at 02:15
  • Try `python3 -m ensurepip --upgrade`? I haven't personally run into this though. – Patrick Haugh Sep 19 '18 at 02:18
  • Looks like that did the trick! However I seem to be having some SSL issues with the discord install now. Looks like I need an SSL Module, any idea how I can get that installed? Here's the output: https://i.gyazo.com/1d9c653bb2467c97d1bc0c5224779b3d.png – Plutoren Sep 19 '18 at 02:25
  • @Plutoren Did you build Python yourself? I think this happens when Python is built without `openssl`. In that case you should probably abandon this Python installation, as you'll have to rebuild it to enable SSL. – Patrick Haugh Sep 19 '18 at 02:29
  • 1
    I went ahead and deleted everything with the word python in it and got a totally fresh install of only python 3.6 and all my problems are solved. Python came pre-installed on my machine and I was worried that it was essential to the OS but it all worked out and nothing seems to have broken, thanks for the advice! – Plutoren Sep 19 '18 at 03:09