Unable to install pywin32 and pywinpty

Launching my Binder yields the following error

Collecting pytz==2022.1
  Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32
Removing intermediate container 61a7118b2b4b
The command '/bin/sh -c ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "requirements.txt"' returned a non-zero code: 1Built image, launching...
Failed to connect to event stream

How can these modules be successfully install in a Binder? My Notebook does not function without these modules.

Thank you :slight_smile:

Hi! mybinder.org runs Linux containers, so there shouldn’t be a need for pywin32.

If you need more help please could you share a link to your Git repo?

1 Like

Hello!

Removal of pywin32 resolved the build issue; however, now the Notebook generates the attached

error of missing a module named win32com, which presumably originates form pywin32. Is there a workaround with a pywin32 analogue that still builds in MyBinder?

Here is the GitHub repository: ROSSpy/requirements.txt at 22dab4339543d515194b7d9ff2785b7659386246 · freiburgermsu/ROSSpy · GitHub

Thank you :slight_smile:

It isn’t running on windows. It is asking you to tell it that it is running on unix so you need to do that.
In other words, because you aren’t configuring things correctly when kicking off the program, it is defaulting to windows just as it says in your image. Because it defaults to that it runs line 63 which is for Windows. You want it to run the unix line. It provides a way to specify that or you can hard code it. There’s an example on mac in the test notebook. That shows you one way to set the operating system to unix. Does that part of that notebook work?

1 Like

Hello!

Changing the operating_system parameter to unix rectified this error; thank you for the explanation. The code is corrected to automate this for use in MyBinder.

I now receive an error
MyBinder_error_file_source
that a distributed folder with one of the imported modules processed_databases cannot be found. Is the storage structure of a dockerfile, or perhaps in Unix, different from a native Windows environment such that os.path.dirname(__file__) does not work?

That’s a Python question that you should be able to easily test in your session.
The file directory hierarchy may very well be different. You probably need the absolute path in there somewhere? Hard to tell much at all here since your image cuts off part of the information. Always best to share error reports in full by using a code block pasted in the post, or link to it posted as text somewhere like a snippet hosting site. See about ’ Block code formatting’ here.

2 Likes

The Python bug was that the path delimiter in this regex r'(?<=processed_databases\\)(.+)(?=\.json)' is specific to Windows.

Thank you for your patience and guidance :slight_smile:

1 Like