ContextLab / davos

Import packages in Python, even if they aren't installed!
MIT License
34 stars 8 forks source link

Add Windows support #113

Open seanpaulbradley opened 11 months ago

seanpaulbradley commented 11 months ago

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?

paxtonfitzpatrick commented 11 months ago

Hi @seanpaulbradley thanks for your report!

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

Thanks!

seanpaulbradley commented 11 months ago

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

jeremymanning commented 11 months ago

@seanpaulbradley thanks! a few thoughts:

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

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 😄

paxtonfitzpatrick commented 11 months ago

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!

jeremymanning commented 9 months ago

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

seanpaulbradley commented 9 months ago

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.

jeremymanning commented 9 months ago

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