Skip to content

Python Interactive window does not use the python associated with the current file when starting #3865

Closed

Description

Currently we aren't passing the resource: Uri value into most methods.
This would result in various parts of the extension not working correctly in a multi-root environment (current code will pick settings from first available workspace folder).

Examples:

This only applies to multi-root environments.

Activity

  1. rchiodo commented on Nov 2, 2018

    @rchiodo
    Contributor

    The problem is what would we pass for the resource? The iPython kernel applies to all open python files. Otherwise we'd have to have multiple kernels running? I guess that's an option too.

  2. DonJayamanne commented on Nov 2, 2018

    @DonJayamanne
    ContributorAuthor

    The problem is what would we pass for the resource?

    The uri of the open python file.

    The iPython kernel applies to all open python files. Otherwise we'd have to have multiple kernels running? I guess that's an option too.

    Yes, else here's the bug:

    • User opens a multiroot workspace with two workspace folders
    • Workspace A - No python or has Python without jupyter
    • Workspace B - Has Python with Jupyter
    • User open a file from Workspace B, and runs a Cell
    • Error - No jupyter installed, etc
      But Jupyter is installed, its just that we're using the wrong python interpreter.
  3. rchiodo commented on Nov 2, 2018

    @rchiodo
    Contributor

    I think we'll have to do something like look at all of the active python files and find the one with jupyter installed in it.

  4. DonJayamanne commented on Nov 3, 2018

    @DonJayamanne
    ContributorAuthor

    That's wrong. The user should be making the decision, not us.
    The whole point of integrating with the extension is lost, the user decides what python version is to be used in the current workspace, we should maintain that, we could display a prompt asking them if they would like to change it.

    Else we have some major inconsistencies with the, python extension.

  5. changed the title [-]DataScience code needs to make use of `resource` appropriately[/-] [+]Python Interactive window does not use the python associated with the current file when starting[/+] on Mar 8, 2019
  6. rchiodo commented on Mar 8, 2019

    @rchiodo
    Contributor

    We might also need to allow the user to pick if say they start without opening a file first or even if there are multiple.

  7. ollema commented on Jun 6, 2019

    @ollema

    Is this in the pipeline for some future release? 🙂

  8. rchiodo commented on Jun 6, 2019

    @rchiodo
    Contributor

    Not at the moment, no. Our 'backlog' or 'inprogress' pipelines are what we're currently working on.

    It does have a lot of votes though.

  9. rchiodo commented on Jun 6, 2019

    @rchiodo
    Contributor

    I'm moving it to New Issues so we triage it again.

  10. ollema commented on Jun 6, 2019

    @ollema

    are these pipelines public? not sure where I can find them

  11. greazer commented on Jun 6, 2019

    @greazer
    Contributor

    To start, let's just make sure we're honoring the active python version on first start of the interactive window.

  12. rchiodo commented on Jun 6, 2019

    @rchiodo
    Contributor

    Olle Månsson (@ollema) I think you have to install zenhub to see the issues? Not sure.

    Here's what it adds for me:
    image

  13. 15 remaining items

  14. locked as resolved and limited conversation to collaborators on Nov 23, 2019
  15. rchiodo commented on Feb 5, 2020

    @rchiodo
    Contributor

    Actually this wasn't entirely addressed through #1379. We still don't use the file to pick the environment.

  16. IanMatthewHuff commented on Feb 25, 2020

    @IanMatthewHuff
    Member

    This doesn't look resolved to me.

    What I did

    Folder A
    Folder B

    Create envA in A and envB in B

    Opened up a workspace with both folders added to it. Selected envA for a file test.py in A and envB for a file test.py in B. When I did "run selection / line" in test.py in file B instead of using envB it tried to install ipykernel in envA.

  17. rchiodo commented on Feb 25, 2020

    @rchiodo
    Contributor

    Did you verify that the file in B that the environment actually stuck? Seems there's a bug in the base extension where you have to switch back and forth between the files.

  18. rchiodo commented on Feb 25, 2020

    @rchiodo
    Contributor

    For example, what does 'Python: Run in terminal' do?

  19. IanMatthewHuff commented on Feb 25, 2020

    @IanMatthewHuff
    Member

    Sorry will report back in just a bit. Having funny issue with my python virtual envs.

  20. IanMatthewHuff commented on Feb 25, 2020

    @IanMatthewHuff
    Member

    Rich Chiodo (@rchiodo) . Good call. I'm pretty darn sure that I had the scenario right, so it was probably that core bug. This time I swapped back and forth a few times and ran both of them in the terminal and it did launch with the correct env this time. Validated.

  21. unlocked this conversation on Nov 14, 2020
  22. locked as resolved and limited conversation to collaborators on May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions