My problem is very similar to the one here (yes, I know, sorry), but none of the suggested solutions have any effect.
I am trying to use a python3 module located in the same directory as the main program. I am launching from within it, and even though I have also added it to the sys.path (using this for help).
>>> import sys
>>> sys.path.append("/home/name/Documents/PythonFiles")
I still receive an ImportError no matter what I do. This has remained true both for my actual program and a simplified version using "hello.py3" and "test.py3" identical to the ones used in the earlier question (see below).
hello.py3:
# !/usr/local/bin/python
# -*- coding: utf-8 -*-
def hello1():
print('HelloWorld!')
test.py3:
# !/usr/local/bin/python
# -*- coding: utf-8 -*-
import os
print(os.path.abspath(__file__))
from hello import hello1
hello1()
This is the output of running test.py3:
/home/name/Documents/PythonFiles/test.py3
Traceback (most recent call last):
File "trial.py3", line 7, in <module>
from hello import hello1
ImportError: No module named 'hello'
All the sources I have checked say that as long as either the directories of the files are the same or if the sys.path directs to their directory, the modules should import without issue, but then again I haven't used modules before so I'm open to the fact that I missed something basic.
Either way I apologize if this really seems like a duplicate question, I am at a loss for what to do here. What should I try next?