davos icon indicating copy to clipboard operation
davos copied to clipboard

Add Windows support

Open seanpaulbradley opened this issue 2 years ago • 7 comments

I went to give this very timely release a try, and but I've encountered a problem and I'm not sure what I might be doing wrong.

In my first cell, I've included: %pip install davos import davos

But that yields:

DavosError: Could not locate a 'pip' executable in the current Python environment. To ensure you have 'pip' installed in your environment [path to python install -m ensurepip]

Ensurepip finds pip appropriately and %pip list appropriately lists the packages in the respective environment.

I've tried this both inside and outside of conda containers with the same result.

Could you tell me what silly mistake I might be making?

seanpaulbradley avatar Oct 03 '23 19:10 seanpaulbradley

Hi @seanpaulbradley thanks for your report!

To help us track this down, are you able to answer a few questions about your system?

  • Just to confirm you're installing the most recent release of Davos -- can you make sure %pip show davos shows Version: 0.2.3
  • What version of Python are you running? (import sys; print(sys.version))
  • What OS are you using? (import platform; print(platform.platform())) (Note: Davos does not officially support Windows)
  • What is the “correct” or expected path to your environment’s pip executable (removing any personal/sensitive information, if needed). E.g., mine on MacOS is /Users/<username>/miniforge3/envs/davos/bin/pip
  • same question re: your Python executable (import sys; print(sys.executable)). This will be helpful since Davos attempts to find your pip executable based on its expected location relative to your Python executable (see here)
  • Are you running this notebook through the “classic” Jupyter notebook frontend? Or JupyterLab? Or Google Colab? Or something else, such as VS Code's or another IDE’s custom notebook interface?
  • It sounds like you've tried this in a conda environment — are your notebook server and IPython kernel running in the same environment, or two different environments? i.e., do %pip list and !pip list list the same environment’s packages?

Thanks!

paxtonfitzpatrick avatar Oct 03 '23 20:10 paxtonfitzpatrick

  • %pip show davos indeed returns a summary that includes Version: 0.2.3
  • I've tried this using 3.12 and 3.8.8.
  • I'm on a Windows 10 machine (Windows-10-10.0.19044-SP0). This may be the culprit!
  • System pip path: c:\anaconda3\lib\site-packages
  • System python path: c:\Anaconda3\python.exe
  • Conda pip path: c:\users\<username>\miniconda3\envs\davostest\lib\site-packages (23.2.1)
  • Conda python path: c:\Users\<username>\Miniconda3\envs\davostest\python.exe
  • I'm using VSCode. This is another likely culprit...I'm so used to doing everything in VSCode that I hadn't considered browswer-based notebooks!
  • The environments/packages are different.

Thanks for the support and your work on this really cool project. Just this week, I'd been wishing there was a way to simply hand off notebooks to non-programmer colleagues without first setting them up with conda etc.!

seanpaulbradley avatar Oct 03 '23 21:10 seanpaulbradley

@seanpaulbradley thanks! a few thoughts:

  • python 3.12 definitely won't work (you'll need 3.6+), but 3.8.8 should!
  • windows is likely the culprit, but it'd be interesting to know how we might be able to support windows. we don't currently have a windows machine, but we could try a virtual machine approach
  • we do support VS Code-- but we've only tested the OS X + LInux versions, so it's possible (likely) there's something different about the windows implementation

@paxtonfitzpatrick might have some ideas about how to potentially debug this. In the meantime, there are a few options i can think of:

  • if you like VS Code, there's actually a nice (free!) version that you can access entirely through the web browser, and it has the same interface. it's called GitHub codespaces. If you make a new repo for your project, you can start a new codespace using that repo, and then develop just like you would in the desktop version of VS Code. i just verified that davos works correctly in the codespaces version of vs code (in the browser, running on one of their cloud machines).
  • davos also works with google colaboratory, so you could develop your notebook there instead (and run it on google cloud). of course the environment is different then, so it depends what you're looking for. (but colab notebooks are also easy to share-- just send a link; you don't even need to send an actual file!)

Depending on how badly you want windows support, we'd also welcome any assistance you wanted to provide with respect to trying to get davos working nicely with windows! Just let us know if you want to explore that 😄

jeremymanning avatar Oct 03 '23 22:10 jeremymanning

ah yep, Windows is the culprit 🙂 unfortunately, we don't support running locally on Windows at this time -- there are a bunch of internal path computations in Davos that currently aren't set up to handle either non-POSIX paths or differences in how Python installations on Windows are structured versus other OSes. You could try using WSL -- I don't have enough experience with that myself to know whether you'll run into similar issues there, but I'd be interested to know how it goes if you want to give it a shot!

Python 3.12 will work (or at least should -- I haven't seen anything in the release notes that indicates it'd break anything). We just haven't started testing against it yet because it was just officially released yesterday! I'm hoping to make that support official soon, or at least as soon as other packages we depend on in our test suite start supporting it.

Like @jeremymanning said, we do support notebooks run in VS Code, though I haven't tried the Windows version and it's possible there may be some internal differences.

If you're interested in adding Windows support ASAP, we would certainly welcome a PR!

paxtonfitzpatrick avatar Oct 03 '23 23:10 paxtonfitzpatrick

@paxtonfitzpatrick and @seanpaulbradley what do you think about changing this issue's title to "Add Windows support" or something along those lines?

I wonder if we could recruit an intern to help out with this, or perhaps do a hackathon project along these lines. The core problem on our end is that we don't currently have a windows machine, but perhaps we can dig one up...

This article on windows dockerfiles also looks potentially useful.

jeremymanning avatar Nov 28 '23 18:11 jeremymanning

Apologies for not following up; I thought I'd done so by the e-mail reply-to-post method, but it doesn't seem to have made it.

That title would make sense to me.

I took a crack at this for an afternoon, trying to just add conditional statements for posix vs. nt OS, but didn't get very far. There are a number of cases where it comes up and there's probably a more efficient way of doing it.

seanpaulbradley avatar Nov 29 '23 19:11 seanpaulbradley

@seanpaulbradley great-- please keep us posted if you continue to work on this!

jeremymanning avatar Nov 29 '23 20:11 jeremymanning