question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not adding current directory to sys.path

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
davidhaltercommented, Sep 30, 2018

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).

0reactions
jonathanslenderscommented, Oct 13, 2018

Closing this. ptpython has a workaround, and there is a new Jedi release.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found