pyflow icon indicating copy to clipboard operation
pyflow copied to clipboard

Add support for Python 3.10 - pyflow fails to recognize python 3.10 correctly

Open jmetz opened this issue 4 years ago • 8 comments

When attempting to run pyflow init, selecting python version 3.10 causes pyflow to think a version < 3.4 has been selected!

image

jmetz avatar Feb 20 '21 14:02 jmetz

I think this works in the repo, but not a released version.

David-OConnor avatar Feb 21 '21 04:02 David-OConnor

I think this works in the repo, but not a released version.

🤦 Sorry about that, will pull up-to-date repo version to confirm and close once I get a chance.

jmetz avatar Feb 21 '21 09:02 jmetz

So having pulled, compiled, and run the current version, there still seem to be a couple of issues:

image

There's a typo in the error message, and the bigger issue, that the extraction / installation of Python 3.10 fails.

jmetz avatar Feb 21 '21 09:02 jmetz

Typo fixed. Pyflow will only install released Python versions; it's too tough to continually compile and package/release beta versions etc. Are you able to install Python 3.10 manually, then try again? I haven't tested, but that should work. If not, there's another bug we'll have to deal with.

Even if it works after installing 3.10, I'm leaving this open until the next release, since you had to use a repo to make that work.

David-OConnor avatar Feb 21 '21 11:02 David-OConnor

First of all the xz file was clearly just a "file not found error" (i.e. the contents of .local/share/pyflow/python-3.10.0-ubuntu.tar.xz was Not Found).

After manually downloading the xz file for the alpha release of 3.10.0 (from: https://www.python.org/ftp/python/3.10.0/Python-3.10.0a5.tar.xz), and then doing a bit of manual renaming to fit with pyflow's expectations, i.e. within ~/.local/share/pyflow:

mv Python-3.10.0a5.tar.xz python-3.10.0-ubuntu.tar.xz

and then after an intermediate error:

mv Python-3.10.0a5 python-3.10.0-ubuntu

I almost got it to work :sweat_smile: :

image

Don't think there's any more I can do without diving into pyflow's code at this point - and as you said, supporting pre-release versions probably isn't something that's going to be in much demand.

Full backtrace:

thread 'main' panicked at 'Problem renaming extracted Python folder: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/py_versions.rs:274:6
stack backtrace:
   0:     0x55b80d690940 - std::backtrace_rs::backtrace::libunwind::trace::h72c2fb8038f1bbee
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x55b80d690940 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e3b084883f1e78c
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x55b80d690940 - std::sys_common::backtrace::_print_fmt::h3bf6a7ebf7f0394a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:79
   3:     0x55b80d690940 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2e8cb764b7fe02e7
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:58
   4:     0x55b80d6b80fc - core::fmt::write::h7a1184eaee6a8644
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/fmt/mod.rs:1080
   5:     0x55b80d688c32 - std::io::Write::write_fmt::haeeb374d93a67eac
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/io/mod.rs:1516
   6:     0x55b80d6930ed - std::sys_common::backtrace::_print::h1d14a7f6ad632dc8
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:61
   7:     0x55b80d6930ed - std::sys_common::backtrace::print::h301abac8bb2e3e81
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:48
   8:     0x55b80d6930ed - std::panicking::default_hook::{{closure}}::hde0cb80358a6920a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:208
   9:     0x55b80d692d98 - std::panicking::default_hook::h9b1a691049a0ec8f
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:227
  10:     0x55b80d6937d1 - std::panicking::rust_panic_with_hook::h2bdec87b60580584
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:577
  11:     0x55b80d693379 - std::panicking::begin_panic_handler::{{closure}}::h101ca09d9df5db47
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:484
  12:     0x55b80d690dac - std::sys_common::backtrace::__rust_end_short_backtrace::h3bb85654c20113ca
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:153
  13:     0x55b80d693339 - rust_begin_unwind
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
  14:     0x55b80d6b69d1 - core::panicking::panic_fmt::h48c31e1e3d550146
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
  15:     0x55b80d6b67f3 - core::option::expect_none_failed::h6154dc750ae47ade
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/option.rs:1234
  16:     0x55b80d337744 - pyflow::py_versions::create_venv::hc045cc66adadc130
  17:     0x55b80d2dbc15 - pyflow::util::find_or_create_venv::h4f993f1cfc11b05f
  18:     0x55b80d323b27 - pyflow::main::h978c07da9d7a424e
  19:     0x55b80d32cdb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2365b862a67ee391
  20:     0x55b80d32e179 - std::rt::lang_start::{{closure}}::hdc32b9b45768c285
  21:     0x55b80d693bf7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he179d32a5d10d957
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:259
  22:     0x55b80d693bf7 - std::panicking::try::do_call::hcb3d5e7be089b2b4
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
  23:     0x55b80d693bf7 - std::panicking::try::h7ac93b0cd56fb701
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
  24:     0x55b80d693bf7 - std::panic::catch_unwind::h7b40e396c93a4fcd
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
  25:     0x55b80d693bf7 - std::rt::lang_start_internal::h142b9cc66267fea1
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/rt.rs:51
  26:     0x55b80d32aa62 - main
  27:     0x7eff66940b25 - __libc_start_main
  28:     0x55b80d27b0ae - _start
  29:                0x0 - <unknown>

jmetz avatar Feb 21 '21 12:02 jmetz

That's a different file - pyflow is attempting to download a binary from a partner repo. The file you downloaded is the source code. It should be able to specify the version for a pre release and handle dependencies for it, but not download and install it

David-OConnor avatar Feb 21 '21 12:02 David-OConnor

Ahhh ok, I wondered if that's the case; building now and will try again and update once 3.10.0a is running independently of pyflow

jmetz avatar Feb 21 '21 12:02 jmetz

Can confirm that building and installing 3.10.0a5 worked - pyflow now recognizes the version and runs correctly! :+1:

jmetz avatar Feb 21 '21 12:02 jmetz