PyOxidizer
PyOxidizer copied to clipboard
Cannot import readline in the macos distribution
Cannot import the readline module in the macos distribution.
$ pyoxidizer init-config-file pyapp
$ cd pyapp
$ pyoxidizer run
>>> import readline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'readline'
On Mon, Mar 14, 2022 at 02:08:04PM -0700, Mingshen Sun wrote:
Cannot import the readline module in the macos distribution.
Seeing 'MacOS' did made think of #524 I hope this helps. Thing I'm trying to say: "there was MacOS change the last 24 hours"
Thanks @stappersg. I'm not sure if #525 is related to this issue.
I found that "curses and readline have linking issues" here:
https://github.com/indygreg/PyOxidizer/blob/main/pyoxidizer/src/py_packaging/standalone_distribution.rs#L77
Thanks!
Even though the readline extension module is disabled, I don't think it should be. I want to say that readline is fixed in a modern version of the Python distributions and this hack can be deleted. But I'm not 100% sure about that. Either way, we should have this issue to track a working readline on macOS.
Probably of interest here:
https://stackoverflow.com/a/29572581
On OSX, if you are using the built-in Python shipped by Apple, you will be missing a proper readline implementation as Apple ships instead a library called libedit that provides only some of readline’s functionality. While you may find libedit sufficient, we have occasional reports of bugs with it and several developers who use OS X as their main environment consider libedit unacceptable for productive, regular use with IPython.
Anecdotal, but I was able to remove readline from the list of broken macOS extensions for my build over cpython-3.9.16+20230116 and things appeared to be working.
@indygreg Is this as trivial to remove in reality as it was for me just now? All I did was remove the line from the vec in the path linked above, with pyoxidizer/0.24.0 checked out. If it really is that simple, I would be willing to put up a patch.