Possible things that could raise this error?
- Broken packages
2. Version update
3. Unmet dependencies
4.Reinstalltion of Python
The Solution!
For Windows Users Steps are:
- When you download Python3.x and run .exe file, you will be given the option to select where you want Python to be installed. For example, I chose this location: C:\Program Files\ Python36
- Then, open system properties and navigate to the “Advanced” tab. (Thus, you may simply do this: Go to Start > Type “environment variables” into the search box > Select “Edit the system environment variables.”) Look for “Environment Variables” under the “Advanced” tab and click it. A new window with the title “Environment Variables” will appear.
- Ensure that the Python path for your user variables is shown in “Path Variable.” You should see C:\Program Files\Python36. If it isn’t available, add it by choosing the Path Variable box and clicking Edit.
- The next step is to double-check the PYTHONHOME and PYTHONPATH entries in the same window’s System Variables. The path mentioned above should be visible to you. If not, include it there as well.
Then click OK to go to the CMD terminal and check for python. The error should now be resolved.
For Linux Users:
Setting path in linux is different it depends on the shell you are currently using. For different shells it will be like this:
a). In the csh shell −