Skip to content
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

IPython install failed for new conda environment #11781

Closed
amunger opened this issue Oct 25, 2022 · 15 comments
Closed

IPython install failed for new conda environment #11781

amunger opened this issue Oct 25, 2022 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug upstream-python Blocked on upstream Python Ext verified Verification succeeded
Milestone

Comments

@amunger
Copy link
Contributor

amunger commented Oct 25, 2022

Testing #11755

I created a new conda environment with the Python: Create Environment command
When ran a cell in the IW, I was prompted to install IPython and clicked install
The cell fails, but the install seemed to actually work, subsequent cell executions are successful

The cell failed to execute with the error

Running cells with 'c:\src\test\5.conda\python.exe' requires ipykernel package.
Run the following command to install 'ipykernel' into the Python environment.
Command: 'conda install -p c:\src\test\5.conda\python.exe ipykernel --update-deps --force-reinstall'

Error popup:

Error processing line 7 of C:\Users\aamunger\AppData\Roaming\Python\Python310\site-packages\pywin32.pth: Traceback (most recent call last): File "c:\src\test\5.conda\lib\site.py", line 186, in addpackage exec(line) File "", line 1, in ModuleNotFoundError: No module named 'pywin32_bootstrap' Remainder of file ignored c:\src\test\5.conda\python.exe: No module named ipykernel_launcher. View Jupyter log for further details.

@amunger
Copy link
Contributor Author

amunger commented Oct 25, 2022

While trying to repro this again, I can no longer get a cell to run at all in a conda environment, mostly failing with

Error processing line 7 of C:\Users\aamunger\AppData\Roaming\Python\Python310\site-packages\pywin32.pth:

  Traceback (most recent call last):
    File "c:\src\test\4\.conda\lib\site.py", line 186, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'pywin32_bootstrap'

Remainder of file ignored
c:\src\test\4\.conda\python.exe: No module named ipykernel_launcher. 
View Jupyter [log](command:jupyter.viewOutput) for further details.

@DonJayamanne
Copy link
Contributor

looks like the conda env isn't detected as a conda environment
@amunger
please could you provide the debug logs

@amunger
Copy link
Contributor Author

amunger commented Oct 25, 2022

fresh workspace, new conda environment, repro'd with 3.7 and 3.10
jupyterlogs.txt
pythonLogs.txt

@amunger
Copy link
Contributor Author

amunger commented Oct 25, 2022

maybe there's a hidden dependency on having conda in my path? I'm seeing quite a few logs in python that seem to be erroring on conda not being a valid command

@DonJayamanne
Copy link
Contributor

maybe there's a hidden dependency on having conda in my path? I'm seeing quite a few logs in python that seem to be erroring on conda not being a valid command

@IanMatthewHuff @amunger

Please could you install the stable version of Jupyter and test this out again & verify this works there.
I.e. I'd like to verify this is a bug in the new pre-release verison.

I can get this working in pre-release of Jupyter extension, thouh I'm not using Python: Create Environment as that fails for me.

@IanMatthewHuff @amunger
Please create the environment without the Python extension, I believe I've found the bug, and for now try creating the environment without their (python extension) VS Code UI.

@amunger
Copy link
Contributor Author

amunger commented Oct 25, 2022

It looks like it behaves the same with stable jupyter and with externally created environments.

There is some flakiness involved - I saw an install work once on the first try, sometimes it works after failing once, sometimes it never works.

@DonJayamanne
Copy link
Contributor

Upstream bug filed here microsoft/vscode-python#20070

@amunger try the following:

  • Create a new conda envionment using the terminal using the CLI conda create -n <name> python=3.8
  • Install pre-release of Python and Jupyter extension
  • Re-load VS Code and wait for this to get discovered in the kernel picker
  • Try running a cell and veriy ipykernel gets installed.

This should work, if not, please upload the logs for both extensions

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug upstream-python Blocked on upstream Python Ext labels Oct 25, 2022
@DonJayamanne DonJayamanne added this to the October 2022 milestone Oct 25, 2022
@IanMatthewHuff
Copy link
Member

Yeah, I have issues with an externally created conda env in Stable as well, so not a Python API regression. However it is a regression from some X amount of time, as this used to work. Just not sure when it broke.

@DonJayamanne
Copy link
Contributor

I'm looking into this now.
Looks like we have 2 issues, it doesn't work in stable and doesn't work in pre-release.
With pre-release it will not workk because of some upstream issues.
@amunger @IanMatthewHuff

  • Please could you upload the logs for pre-release jupyter with stable Python
    • Does this work here?
  • Please could you upload the logs for stable jupyter with stable Python
    • Does this work here?

Thanks

@amunger
Copy link
Contributor Author

amunger commented Oct 26, 2022

so today, all scenarios I tested with pre-release and stable will give an error in the cell output as if the IPython package installation failed, but running the cell again will succeed. It's very possible that I didn't attempt to rerun a cell when trying this yesterday.

These were all done with clean conda environments that were created externally from vscode.

jupyterLogs_bothprelease.txt
jupyterLogs_prereleasePython_stableJupyter_failsuccess.txt
jupyterLogs_stablePython_prereleaseJupyter_failsuccess.txt
pythonLogs_prereleasePython_stableJupyter_failsuccess.txt
pythonLogs_stablePython_prereleaseJupyter_failsuccess.txt

@amunger
Copy link
Contributor Author

amunger commented Oct 26, 2022

Just confirmed that a conda env created with Python: create Environment still fails repeatedly

@DonJayamanne
Copy link
Contributor

Just confirmed that a conda env created with Python: create Environment still fails repeatedly

Yes, this is due to an upstream bug in Python extesnion, see here #11781 (comment)

@rebornix
Copy link
Member

Both bugs leading to this bug were fixed in upstream, closing this issue for verifcation.

@DonJayamanne
Copy link
Contributor

Verified as working (upstream Python extension issue has been resolved)

@DonJayamanne DonJayamanne added the verified Verification succeeded label Nov 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug upstream-python Blocked on upstream Python Ext verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants