Issue2928

classification
Title: Cannot install packages in Jython (Windows)
Type: behaviour Severity: normal
Components: Installer Versions: Jython 2.7.2
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: Daniel, jeff.allen, stefan.richthofer
Priority: Keywords:

Created on 2022-04-13.14:42:33 by Daniel, last changed 2022-04-21.12:15:22 by stefan.richthofer.

Messages
msg13188 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-13.14:42:32
Hello!
I've installed the latest available version Jython 2.7.2 from https://www.jython.org/download
I need to install there some packages, like numpy. But simple command 
C:\jython2.7.2\bin>pip install numpy
shows a lot of certificate errors like this:
ERROR: Certificate did not match expected hostname: pypi.org...

Ok, I've found workaround in internet:
C:\jython2.7.2\bin>pip install -v --trusted-host pypi.org --trusted-host files.pythonhosted.org numpy
But even this variant does not work:
...
  Could not fetch URL https://pypi.org/simple/numpy/: 403 Client Error: SNI is required for url: https://pypi.org/simple/numpy/ - skipping
  ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
...
ERROR: No matching distribution found for numpy

What is the reason? How to correctly install numpy, opencv-python and other packages into Jython?
msg13190 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-14.12:40:38
Also two questions, if possible.
1) Are you planning to implement Jython for Python 3 in the nearest future?
2) Do I understand correctly, that the correct way to run NumPy and other native libraries under Jython is the project https://jyni.org/ ?
msg13192 (view) Author: Jeff Allen (jeff.allen) Date: 2022-04-16.12:01:04
Jython does not support C-language extensions. JyNI may be a possibility but it's a separate project (albeit for one of our team).  I think numpy was still too difficult, but look it up.

The particular error you're experiencing isn't for that reason, it affects pip in general, and (the good news) it was fixed in https://github.com/jython/jython/issues/97 for release in 2.7.3 soon-ish (but it won't make numpy work for you).

Yes, we're working on Jython 3 (https://github.com/jython/jython/tree/main) but a release "in the nearest future" is not likely. I'd really like it to be able to wrap or replace things like numpy, after the basics, so we can do data science.

GitHub (https://github.com/jython/jython/issues) is the place to raise issues now.
msg13194 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-18.08:48:23
Thank you, Jeff, but what is "soon-ish"? A week, a month? Maybe, it is possible to download somewhere a pre-release version 2.7.3? I would like to start experiments with JyNI, but first of all I need to install numpy.

Do I understand correctly that Jython 3 is probable in a time-frame about 1 year? If yes, I could start development on the current version with a perspective to switch to Jython 3. If no, our company should focus on another ways of integration, like GraalVM (but it unfortunately does not support Windows).
msg13196 (view) Author: Jeff Allen (jeff.allen) Date: 2022-04-18.19:36:41
I said I'd aim for a 2.7.3 beta at Easter, which was yesterday (or next week if you're Orthodox) but that was optimistic. Some interesting fixes that really ought to go in are taking longer to complete/review than I hoped.

But I'm not sure it helps you: numpy still won't install as we don't support C extensions. JyNI may make it work (look it up), but you could try that with 2.7.2. Is JPipe also a possibility?

A year is also optimistic for a Jython 3. And numpy will only work then if someone re-writes it in Java. I just mean it's an ambition to make that relatively easy.
msg13198 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-18.19:57:02
I just need to choose a way for developments: Jython, GraalVM, own implementation based on JNI and C++. You give me hope that Jython may become a good start for a perspective.

I understand that 2.7.3 will not help us with numpy. But maybe JyNI will help. As I understand, it will be released very soon?

I'm not orthodox, I'm a Jew and work in a project "8th Day of Creation" :)
msg13200 (view) Author: Jeff Allen (jeff.allen) Date: 2022-04-19.09:15:20
JyNI (https://jyni.org/) is by Stefan Richthofer. Stefan is a Jython project member, and continues as an occasional reviewer, but JyNI is a separate project.

The cultural significance of Easter to the project is just that I get some time off paid work. (I hope you are enjoying a peaceful Passover.) It was a good interval in have a push on Jython 2.7.3b, and has been productive but not quite enough yet.
msg13202 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-19.10:15:37
Ok, I will hope for soon release of 2.7.3. For JyNI, if necessary, I'll contact Stefan.

Yes, we (I and my wife) enjoy Pesach in Haifa, rented an apartment near the sea. Good Passover also for you!
msg13204 (view) Author: Daniel Alievsky (Daniel) Date: 2022-04-20.13:09:20
By the way, can I ask what it the best way to contact Stefan Richthofer? Is it email at the end of the page https://www.jyni.org/#contact ?
msg13206 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2022-04-21.12:15:22
> Is it email at the end of the page https://www.jyni.org/#contact ?

Yes, it is.
History
Date User Action Args
2022-04-21 12:15:22stefan.richthofersetmessages: + msg13206
2022-04-20 13:09:20Danielsetmessages: + msg13204
2022-04-19 10:15:37Danielsetmessages: + msg13202
2022-04-19 09:15:21jeff.allensetnosy: + stefan.richthofer
messages: + msg13200
2022-04-18 19:57:02Danielsetmessages: + msg13198
2022-04-18 19:36:42jeff.allensetmessages: + msg13196
2022-04-18 08:48:23Danielsetmessages: + msg13194
2022-04-16 12:01:04jeff.allensetstatus: open -> closed
resolution: invalid
messages: + msg13192
nosy: + jeff.allen
2022-04-14 12:40:38Danielsetmessages: + msg13190
2022-04-13 14:42:33Danielcreate