[issue41042] import searches for package even after file was found successfully

2020-06-19 Thread Eric V. Smith
Eric V. Smith added the comment: You should just be using "import index". By using "import index.py", you're telling the interpreter to first import index, execute the code in it, then look for a sub-module named "py" (full name: index.py). Since no such sub-module exists, and index is not a

[issue41042] import searches for package even after file was found successfully

2020-06-19 Thread Michael J.
Michael J. added the comment: This is a screenshot of the output I received when I ran index.py in a terminal. As you can see, it imports the script OK, but then it tries to find index as a package, and it fails and prints an error. (2/2) -- Added file: https://bugs.python.org/file49

[issue41042] import searches for package even after file was found successfully

2020-06-19 Thread Michael J.
Michael J. added the comment: Attached I have a file containing the script for my program. It's obviously incomplete, but it will work as a sample file for demonstrating the output and behavior of the interpreter. (1/2) -- Added file: https://bugs.python.org/file49254/index.py _

[issue41042] import searches for package even after file was found successfully

2020-06-19 Thread Eric V. Smith
Eric V. Smith added the comment: Please provide a small script that demonstrates this behavior. -- nosy: +eric.smith ___ Python tracker ___ ___

[issue41042] import searches for package even after file was found successfully

2020-06-19 Thread Michael J.
New submission from Michael J. : Hello, Earlier today, I was developing a program and I wanted to check its variables after it finished running. Simply going into a terminal, entering my program's directory, and executing "python3 index.py" would return control to the command line before I wo