Hey! We are getting there! (If you haven't guessed...I am working at learning python.)
That seems to have been the problem...kind of. I changed the python relative paths to absolute paths in the .bashrc file, rebooted, and asked python:
Code:
>>> import sys
>>> print(sys.path)
['', '/home/justme', '/home/justme/1_Scripts/python', '/home/justme/1a_Computer_Related/Python/Practice', '/home/justme/1a_Computer_Related/Python/code', '/home/justme/1a_Computer_Related/Python/scripts', '/home/justme/1a_Computer_Related/Python/Applied_Examples', '/home/justme/python_work', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']
>>>
So, the correct paths are now showing up as being active there.
Now, using the Linux Terminal in Python3 command mode to import from pets.py:
Code:
>>>
>>> from pets import Pet, Dog
>>> polly = Pet("Polly", "Parrot")
>>> print(polly)
Polly is a Parrot
>>>
Hooray! It works!!!
But if I use the new Ninja python editor which I am trying to learn how to use to do this same thing it's python3 interactive window gives me:
Code:
>>> from pets import Pet, Dog
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named pets
>>>
Moving over to the Python3 Idle interactive shell for beginners I get the same error:
Code:
>>> from pets import Pet, Dog
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from pets import Pet, Dog
ImportError: No module named 'pets'
>>>
The geany editor in python immediate mode also gives the same "No module named 'pets'" error.
Any suggestions or ideas of why these editor's python immediate mode windows aren't working correctly now?