Python 3.8 - alpha release
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Raik (463) 2059 posts |
Have remove my phyton3 (was alpha 6) installation and have try to install the latest via PackMan. Help is welcome. |
Chris Gransden (337) 1202 posts |
Certain python modules won’t load if their dependent shared libraries aren’t installed. At a minimum for youtube_dl to import the following shared libraries need to be installed using PackMan. LibFFI6 |
Raik (463) 2059 posts |
The packages are all installed via packman. This is not the reason. :-( |
Raik (463) 2059 posts |
Have removed all I found… Witch file is meanig? After uninstall youtube-dl I remove also the Data folder with the youtube-dl content. In Python.38.Site-Packages the youtube-dl folder are removed by uninstall. Try upgrade youtube-dl… … ??? |
Raik (463) 2059 posts |
I wondering about this… because PythonSite$Dir is set to “ADFS::Titanium.$.[Pling]Boot.Resources.[Pling]PythonSites” So the errormessage path not exist. |
David J. Ruck (33) 1629 posts |
Quick question, packages must be working in Python3, but I can’t seem to get my own to work. To be able to run some of my multi-platform stuff in RISC OS, I’ve had to strip out all of the use of multiprocessing as it isn’t fully implemented on RISC OS. I got tired of this and wrote a riscos.multitasking package containing dummy code, and this is working fine on Python 2.7.16, but I can’t get it to be recognised with 3.8.5-2 I’ve created a riscos directory in the same directory as the python programs which are going to use it, and that is also the current directory. It contains an empty ___init___/py (that’s supposed to be double underscore around init) and a multiprocessing/py containing the code. It’s imported with:- import riscos.multiprocessing as multiprocessing and Python3 complains with:- ModuleNotFoundError: No module named ‘riscos.multiprocessing’; ‘riscos’ is not a package I’ve tried the ___init___ and multiprocessing files without the extension, and with filetypes of python2, python3 and text. I’ve also tried putting the riscos directory in to !PythonSite.Site-packages but nothing seems to work. If it wasn’t for Python2 working, I’d be thinking it was me. |
David J. Ruck (33) 1629 posts |
Problem solved; it seems in Python3 the name riscos is special. Although there doesn’t seem to be a package called riscos anywhere I can find, renaming mine to riscosutils has fixed it. |
Ronald (387) 195 posts |
there doesn’t seem to be a package called riscos anywhere It wouldn’t be finding it’s way up from gcc would it? I seen plain riscos used as a definition in old libgtk/glib stuff which surprised me as |
Chris Johns (8262) 242 posts |
It’s probably the ‘posix’ module, which I think gets imported as ‘posix’ on unix, ‘nt’ on Windows and ‘riscos’ on RISC OS. I’ve kind of ignored / avoided the multiprocessing stuff. There is enough of subprocess to allow pip to work but that’s about it. I am not sure what (if anything) can be done on RISC OS to support multiprocessing. To reply (somewhat late) to Raik earlier – yes, that’s a known bug. I’ve fixed it here but I’m trying to tidy up the !PythonSite thing to get the Scripts in the right place, and put them on the Run$Path so it should then just be a matter of *pip, *youtube_dl etc. |
Raik (463) 2059 posts |
Generally no problem. Is nothing I need to survive ;-) So no hurry neded. |
David J. Ruck (33) 1629 posts |
Chris, I don’t need RISC OS to support multiprocessing fully as I have a single tasking fallback, I just need things like mp safe types which are used by the common code not to break, because low level code isn’t implemented. Incase anyone is interested, what I needed to dummy from multiprocessing:-
As I mentioned above its conditionally imported if RISC OS is detected. On Python3 sys.platform which I used for recognising other platforms returns ‘riscos’ but annoyingly Python2 returns ‘linux2’ as for real Linux, but what works on both is os.uname()[ 0 ]==“RISC OS”. |
Steve Pampling (1551) 8155 posts |
I was trawling through some older links, as old information https://www.digitalocean.com/community/tutorials/how-to-port-python-2-code-to-python-3 |
Tristan M. (2946) 1039 posts |
2to3 foo.py |
Steve Pampling (1551) 8155 posts |
Ah, automated stuff1 About that… “2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code. The standard library contains a rich set of fixers that will handle almost all code” 1 As accurate as the time and effort/brainpower put into the converter and |
Tristan M. (2946) 1039 posts |
All that being said, it does a pretty good job. A lot of things that need to be changed seem to be fairly consistent syntactical tweaks. It’s not like a cross langage converter which can generate indecipherable code. IIRC it converts, and spits out messages for anything that it finds questionable. |
David J. Ruck (33) 1629 posts |
That Python 2 to 3 page isn’t the best. Python 2 and 3 continue to support both stdio style (%d) and “{}”.format, what is new in Python 3 (3.4 onwards) is f string e.g. f"{varname}". It also missed out several functions now returning iterators instead if lists, such as range and map. range now works like Python 2’s xrange which is no longer supported. Most uses of map need to be replaced with (list)map to work the same way. As Tristam says, use 2to3, it does the vast majority of the syntax donkey work for you, although not the map issue. |
Chris Johns (8262) 242 posts |
I’ve uploaded another set of packages that will no doubt break. The big thing here is I’ve split !Python3 into two packages, Python3Base and Python3.8. |
Raik (463) 2059 posts |
Have upgrade via Packman. |
Chris Johns (8262) 242 posts |
I’ve uploaded a new Python3.8-pip package (20.0.0.2-2) – see if that helps. |
Raik (463) 2059 posts |
Thanks a lot. Traceback (most recent call last): |
Chris Johns (8262) 242 posts |
What happens if you try to “import _ctypes” from the python prompt? Often the “File not found” error happens when you are missing a shared library. ctypes needs LibFFI6 from PackMan, and I missed it from the Requirements list. |
Raik (463) 2059 posts |
LibFFI6 and -dev was installed. Is not the reason. Have downloaded a “clean” HDImage and setup the main parts of my Ti. Than I install Python and the stuff around. Now I’m back to this point… |
Chris Johns (8262) 242 posts |
I think I will have start again from the beginning too. I have a pi and an SD card I can use :) |
Raik (463) 2059 posts |
I think the main problem was on my side. First steps are a manually installation, than via PackMan. So it is more than possible that old parts and “look at” are alive. Edit: Download is working if I specify the outputname by —output in the youtube-dl line. So I will change YTPlay, hope soon. |
Raik (463) 2059 posts |
Quick fix. “/” and " " are problematic in title. Will be removed… New Testvideo ;-) about YTPlay. |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14