Oct-30-2020, 05:40 PM
I am relatively new to Python. I have two small py programs. It runs on 3.5.3. When I switch to a newer version of Python (version 3.8.6). I got the following error:
File ".\resources\scripts\batchEditProtocolXML.py", line 1, in <module>
import replaceLineInFiles
ModuleNotFoundError: No module named 'replaceLineInFiles'
after some research, I changed the import statement. Then I got the following error:
File ".\resources\scripts\batchEditProtocolXML.py", line 1, in <module>
from .replaceLineInFiles import replace
ImportError: attempted relative import with no known parent package
I know there are some big differences between Python 2 and 3. But I am surprised that the differences between 3.5 and 3.8 are not small. Does this mean I have to create a package/module on each file/unit/groupOfFunctions? Anywhere (books, online sites) I can find the information about the differences between major release versions?
File ".\resources\scripts\batchEditProtocolXML.py", line 1, in <module>
import replaceLineInFiles
ModuleNotFoundError: No module named 'replaceLineInFiles'
after some research, I changed the import statement. Then I got the following error:
File ".\resources\scripts\batchEditProtocolXML.py", line 1, in <module>
from .replaceLineInFiles import replace
ImportError: attempted relative import with no known parent package
I know there are some big differences between Python 2 and 3. But I am surprised that the differences between 3.5 and 3.8 are not small. Does this mean I have to create a package/module on each file/unit/groupOfFunctions? Anywhere (books, online sites) I can find the information about the differences between major release versions?