New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brocken import from current directory in 7.2.0 #11531
Comments
What is the output of: import sys; print(sys.path) |
For ipython version (7.1.0):
For ipython version 7.2.0 (inside iypthon): For ipython 7.2.0 from the cmd line: |
Immediately after upgrading to
After restarting the computer, it remained.
The same thing happened when updating add after 30min: It does not work again, I can not repeat it.
|
In my case I see that IPython 7.2.0 puts current working directory
I am on Mac OS Mojave in case it matters. Actually, I have found the problem with my problem. Posting here in case someone else is curious: 2c70fc6 It seems like this was done intentionally. I cannot fully agree with the reasoning though |
@minrk is there any way we can disable this behavior? I just ran into this after updating IPython and was very surprised that the CWD py files were not the first things to be imported. This causes issues if you want to jump into a specific package folder and just import that module, but a higher level module init is in the PYTHONPATH which is now above the CWD and overrides your local import attempt. |
Trying to import module in the current working directory raise a ImportError exception after updating ipython to 7.2.0. I have an empty module test_module.py in the current directory.
The command:
ipython -c "import test_module"
run withouth error.
However, if I launch ipython and execute the statement
import test_module
I get an ImportError
If I reinstall version 7.1.0 (using pip), I don't have an error when trying to import test_module inside iPython
The text was updated successfully, but these errors were encountered: