Not adding current directory to sys.path
See original GitHub issueI can’t work out why some instances of ptpython
add the current directory to sys.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 from sys.path
. Is there a condition for this I’m missing? I can’t do basic imports. Stock python
(3.6.4) interpreter and bpython
- as a quick check - add the current directory without an issue. Tested in a variety of virtualenvs. $PYTHONPATH
not set. Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Why is my script's directory not in the Python sys.path?
No, I think it's normal for sys.path to not have the current working directory. It should still get searched during the import process...
Read more >Python flag/envvar to not put current directory on sys.path (but ...
In Fedora, we'd like to advise packagers to invoke pytest via python -m pytest . However, we don't like the current working directory...
Read more >Check and add the module search path with sys.path in Python
Since the module search path changes depending on the current directory, the import may not work depending on where the script file is...
Read more >pytest import mechanisms and sys.path / PYTHONPATH
prepend (default): the directory path containing each module will be inserted into the beginning of sys.path if not already there, and then imported...
Read more >python - How can I add the current directory to `PYTHONPATH ...
I use elpy and I am not able to use relative paths to access files because the PYTHONPATH doesn't include the directory I'm...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
Closing this. ptpython has a workaround, and there is a new Jedi release.