pythonpython-importpython-3.8

PyCharm doesn't identify 'import random' (Python 3.8)


I was working on my discord bot when PyCharm suddenly didn't identify random. If is relevant, I uninstalled official python to free up some space on my computer.

Code (?):

import random

Solution

  • You must have an official python version installed to use python according to this page. To help you understand this is basically trying to put on whipped cream to a cake but the whipped cream doesn't exist.

    If you install a new version of python than previously:

    Press Ctrl+Alt+S Go down to where it says Project: then select Python Interpreter.

    Click the cog -> show all. Remove the ones that don't exist. Then select add then select the Base interpreter from the installation. You want to select python.exe