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
Not adding current directory to sys.path #246
Comments
Hi @hammerheadlemon, This should happen on the following line: https://github.com/jonathanslenders/ptpython/blob/master/ptpython/entry_points/run_ptpython.py#L48 |
Hi @jonathanslenders - thanks for pitching in so quickly. Have just been looking at this. Running under the debugger is okay - breakpoint hits at https://github.com/jonathanslenders/ptpython/blob/d00f8d454fe2b94c499869e6677cce7a22601fc4/ptpython/entry_points/run_ptpython.py#L50 and |
Further investigation... I am seeing this: Run sys.path Working directory is at import package
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'package'
No module named 'package' Then:
Working directory is not now in path. Insert directory manually: sys.path.insert(0, '')
sys.path Path is there. import package
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'package'
No module named 'package'
If I hardcode the working directory: sys.path.insert(0, '/home/path/to/working/directory')
sys.path Working directory is there. |
Confirming the same problem, current directory path isn't added automatically and it's removed from the sys.path after adding as ''. Putting dot inside works though ('.'). |
This is a Jedi bug. Confirmed in davidhalter/jedi#1148. Sorry for the issues it has caused. |
Hi everyone, I pushed a new version of ptpython that ensures that the current directory is always present in sys.path. This also upgrades to prompt_toolkit 2.0. Can you try again? |
I will probably release a new Jedi version (without major changes, but with the patch for this bug). It has been fixed since 4th of July, but hasn't been released (I forgot to do that). |
Thanks, @davidhalter! |
Thank you @davidhalter and @jonathanslenders . Will download and try in the next few days. |
Closing this. ptpython has a workaround, and there is a new Jedi release. |
I can't work out why some instances of
ptpython
add the current directory tosys.path
. Most of my projects to date, using 0.41, do this with no issues, but in recent installations I've noticed that it is missing fromsys.path
. Is there a condition for this I'm missing? I can't do basic imports. Stockpython
(3.6.4) interpreter andbpython
- as a quick check - add the current directory without an issue. Tested in a variety of virtualenvs.$PYTHONPATH
not set. Thanks.The text was updated successfully, but these errors were encountered: