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
sys.path does not include subdirectory #259
Comments
Hi @achalddave, Can you try to upgrade to the latest ptpython version and try again? I just pushed a new version to pypi. |
I just upgraded and tried, and the issue still seems to exist. Note that ptpython does always add the current directory in sys.path (although I'm unsure if that's expected or a bug: python by default only adds the directory that the file is in, while ipython adds the current directory and the directory that the file is in), but fails to add the directory the file is in. That is, the following things are always in the path for each of the interpreters:
|
I believe a new Jedi version has been released. Can you try again upgrading both ptpython and Jedi to the latest version? |
Just upgraded both. Still seeing the same issue.
ptpython
Versions:
|
@achalddave, Are you sure that the same environment is used for both pip and ptpython? Can you run the pip-show commands using the |
Yeah they should be the same environment. Does this issue not show up for you? I can debug this more on my end, if you're not seeing the issue (maybe with a separate python install or try removing and re-installing). ~ ~ which ptpy
ptpy=ptpython
~ ~ which ptpython
~/local/anaconda3/envs/pytorch-caffe2/bin/ptpython
~/tmp/ptpython-debug ~ which python
~/local/anaconda3/envs/pytorch-caffe2/bin/python
~ ~ python -m pip show ptpython
Name: ptpython
Version: 2.0.3
Summary: Python REPL build on top of prompt_toolkit
Home-page: https://github.com/jonathanslenders/ptpython
Author: Jonathan Slenders
Author-email: UNKNOWN
License: UNKNOWN
Location: /home/achald/local/anaconda3/envs/pytorch-caffe2/lib/python3.6/site-packages
Requires: jedi, docopt, prompt-toolkit, pygments
Required-by:
~ ~ cd tmp/ptpython-debug
~/tmp/ptpython-debug ~ ls
foo/
~/tmp/ptpython-debug ~ python -m ptpython foo/bar.py
['', <global paths>] |
In python and ipython, when running a script from a parent directory (e.g.
python foo/bar.py
),sys.path
contains the script's immediate parent directory. However, this does not seem to be the case for ptpython.I thought this might be related to davidhalter/jedi#1148 and #246 , but downgrading to jedi <0.12 (0.11.1 specifically) does not fix the issue.
Note the lack of
/home/achald/tmp/ptpython-path-debug/foo
in the last sys.path.The text was updated successfully, but these errors were encountered: