• Re: Help needed - - running into issues with python and its tools

    From dn@21:1/5 to All on Sun Aug 4 09:04:11 2024
    On 4/08/24 08:17, o1bigtenor via Python-list wrote:
    Greetings

    Looking at ESP8266 and wanting to program it using micropython (really
    don't want to have to learn C++ (not enough hours in the day as it is!!)).

    One of the tools I need to be able to use is esptools - - well in the
    devuan world you need to run that on either Devaun 3 or 5 - - - its just
    not available on devuan 4.

    Tried installing all the tools I need using downloads and .deb installs but then I need to have python3.12 and that's also not part of Devuan4.

    Not versed enough to set up a good venv (if that's possible) so that I
    could work in that specific venv and have my cake (and get to eat it too (grin!).

    Suggestions - - - ideas - - - please?

    Sorry if this offends, but this is a list of short-cuts and reasons why
    they don't work (immediately).


    Have just come from a discussion about 'how to start a project'. Amongst
    the questions to ask are: "what resources do we have (or can add) to
    achieve?".

    In this case, if Python-skill is a "personnel-resource" (and C++ a "constraint"), will question the ESP over Raspberry Pi (say)?

    Why talking of Python 3.12 when the solution involves MicroPython?


    Perhaps need to take a step back and look at 'options' - relate needs to resources, and evaluate the impact of each decision on later ones - as
    well as against your personal skills (modify objectives to limits, or
    accept that some learning/training will be necessary as pre-requisite to
    (being able to) attack the project).

    --
    Regards =dn

    --
    Regards,
    =dn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cameron Simpson@21:1/5 to o1bigtenor@gmail.com on Sun Aug 4 09:11:02 2024
    On 03Aug2024 16:34, o1bigtenor <o1bigtenor@gmail.com> wrote:
    So please - - - how do I set up a venv so that I can install and run
    python
    3.12
    (and other needed programs related to 3.12) inside?

    Maybe this github comment will help with this: https://github.com/orgs/micropython/discussions/10255#discussioncomment-4444671

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dn@21:1/5 to All on Sun Aug 4 12:08:54 2024
    On 4/08/24 09:34, o1bigtenor via Python-list wrote:
    On Sat, Aug 3, 2024 at 4:06 PM dn via Python-list <python-list@python.org> wrote:

    On 4/08/24 08:17, o1bigtenor via Python-list wrote:
    Greetings

    Looking at ESP8266 and wanting to program it using micropython (really
    don't want to have to learn C++ (not enough hours in the day as it
    is!!)).

    One of the tools I need to be able to use is esptools - - well in the
    devuan world you need to run that on either Devaun 3 or 5 - - - its just >>> not available on devuan 4.

    Tried installing all the tools I need using downloads and .deb installs
    but
    then I need to have python3.12 and that's also not part of Devuan4.

    Not versed enough to set up a good venv (if that's possible) so that I
    could work in that specific venv and have my cake (and get to eat it too >>> (grin!).

    Suggestions - - - ideas - - - please?

    Sorry if this offends, but this is a list of short-cuts and reasons why
    they don't work (immediately).


    Have just come from a discussion about 'how to start a project'. Amongst
    the questions to ask are: "what resources do we have (or can add) to
    achieve?".


    Fair question details interleaved - - -


    In this case, if Python-skill is a "personnel-resource" (and C++ a
    "constraint"), will question the ESP over Raspberry Pi (say)?


    Well - - - RPi world technical specs is usable from -20 to 60 C (iirc on
    the top number)
    and for my project I absolutely need to have usability to at least -40 - - could possibly do a bit less but -35 C is a hard requirement so the RPi
    and Pico (which I would like to use) is out but ESP8266 runs in that -40 to 65 C
    range.

    Interesting, but creates a mis-match of tools - battles for you to fight...


    Why talking of Python 3.12 when the solution involves MicroPython?


    Because one uses psytool on one computer to transfer a program to the MicroPython system. In fact there are a set of tools that need Python3.12
    to be able to do this and therefore the question.



    Perhaps need to take a step back and look at 'options' - relate needs to
    resources, and evaluate the impact of each decision on later ones - as
    well as against your personal skills (modify objectives to limits, or
    accept that some learning/training will be necessary as pre-requisite to
    (being able to) attack the project).

    I have been investigating using a venv but am not finding clear directions
    so
    that I could set up Python3.12 inside (along with the other needed tools). The
    more I'm looking the less useful most of the information I'm finding is becoming.
    Therefore I thought I would go to the python gurus for information - - - which I
    have.

    So please - - - how do I set up a venv so that I can install and run python 3.12
    (and other needed programs related to 3.12) inside?

    If you mean venv itself, which "directions" have you reviewed?
    This one (https://python.land/virtual-environments/virtualenv) seems
    very straight-forward and shows "What's inside a venv?" to include
    python.exe. Given that venv is more-or-less the official/traditional
    solution, what are you doing differently - perhaps the question is
    lacking detail.
    (see also @Cameron's take)

    Personally, I'm using Poetry (https://python-poetry.org) which seemed
    just as easy to pick-up; plus pyenv to maintain multiple versions of
    Python on one machine.

    --
    Regards,
    =dn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to All on Sun Aug 4 11:17:17 2024
    On 2024-08-03 15:17:11 -0500, o1bigtenor via Python-list wrote:
    One of the tools I need to be able to use is esptools - - well in the
    devuan world you need to run that on either Devaun 3 or 5 - - - its just
    not available on devuan 4.

    Couldn't you just upgrade to Devuan 5, then?


    Tried installing all the tools I need using downloads and .deb installs but then I need to have python3.12 and that's also not part of Devuan4.

    It seems weird that something would work with the (presumably) older
    version of Python in Devuan 3 and the (presumably) newer version of
    Python in Devuan 5, but not with the version in Devuan 4.


    Not versed enough to set up a good venv (if that's possible) so that I
    could work in that specific venv and have my cake (and get to eat it too (grin!).

    You need to install Python first to create a venv. AFAIK there is no way
    to set up a venv first and then install Python into it.

    Does Devuan have a testing or unstable suite? You might be able to
    install a newer Python version from that. If not your best bet is to
    install Python from source.

    hp


    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmavRxgACgkQ8g5IURL+ KF1Ynw//eMzBPLuMmGnKBFLRlv1ULAUGmcbFwkwQGdGJ+g4WZo5QD/uoW8Sw85YM 9quBzDNR58wG4N08fvofVJfPWjUyBbS/1Sry70lWYQgtoK2Ka9pcxTcL1V9Y1B6o Qq84z3MIFrMk7juQ43psqXa/jVtiKDcuFn4Q7F34b0ZlXrbKHh43tmLgzcWZ4T0w mkYR9eTpvFrb+oMINBhst4kbA7W07pFIqrHBMEF3GL31toS6OwALUO+FV2+6Qkpu PigVwJeDDeQa8ZmWelUgujLCraxYtb/MtnlvWp2Xtx4PdyoRHkW/NH871B3oOQ/7 kG7qeMmW9lYsNlHtIlrOTlIejFOfDpoabNwJjTav+vC74/U/p/I9U+ZagLndJUvw BUSNuNG9QUsT3PT09A9PJVzoItV95utJH10TBAwQl6BQ6EW1IUmcV5HEuA2N66UQ byJEmE8f5u+OXbPnrDLrZ/KPS1Qp4l+AgTl6ITOfpEJuyFLyELu1uQCJmMVBVYsI 45MZjaLixOQGA7c7mhOPIUpWl0PCMhaI9pIQEs5z+VcOGLt3RoZ8DaWymFwg6fzr y2qlcZ8npNFY87fPQmp1IG/g3mCyVRrDCkSS+Qzjz3KgzJ6lsqtylU83LmXn+Q0U mQOGCiqzchTZyuPjVyEfHNwUQ3HD6ruz6+Ubdah
  • From Mats Wichmann@21:1/5 to All on Sun Aug 4 07:47:19 2024
    On 8/3/24 20:03, o1bigtenor via Python-list wrote:

    My question was, is and will be (and the doc absolutely doesn't cover it)
    how do I install a different version in the venv so that python 3.11.x on
    the
    system is not discombobulated by the python 3.12.x in the venv.
    That python 3.12 would let me run the tools needed.
    (Its the how to install the next version of python that I just haven't been able to find information on - - - and I would be looking for information
    on how to install on a *nix.)

    To get a different Python "in" the venv, you use the version you want in
    the construction of the venv. For example:


    $ python3.13 -m venv new_venv
    $ new_venv/bin/python --version
    Python 3.13.0b4
    $ source new_venv/bin/activate
    ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to All on Mon Aug 5 07:51:06 2024
    On 8/5/24 06:48, o1bigtenor via Python-list wrote:
    On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list < python-list@python.org> wrote:

    On 8/3/24 20:03, o1bigtenor via Python-list wrote:

    My question was, is and will be (and the doc absolutely doesn't cover it) >>> how do I install a different version in the venv so that python 3.11.x on >>> the
    system is not discombobulated by the python 3.12.x in the venv.
    That python 3.12 would let me run the tools needed.
    (Its the how to install the next version of python that I just haven't
    been
    able to find information on - - - and I would be looking for information >>> on how to install on a *nix.)

    To get a different Python "in" the venv, you use the version you want in
    the construction of the venv. For example:


    $ python3.13 -m venv new_venv
    $ new_venv/bin/python --version
    Python 3.13.0b4
    $ source new_venv/bin/activate


    "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from interacting with the OS installed python. This change has been done in red hat and other distros too . . . "

    similarly your first command produces and error code for the same reason.

    Sorry - - - not my policy - - -

    What? Yes, the *system* pip should have some restrictions, if it's a
    system mainly managed by a package manager.

    Setting up a venv is the *expected* approach to such situations, and
    creating one doesn't cause any problems. You end up with a pip in the activated venv that's going to install to a different path (the one in
    the venv), and will not be marked as externally managed, as the package manager has no control over that path.

    That's the whole point. What error are you getting? The venv module is
    not the pip module so restrictions on the system pip have nothing to do
    with it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Deegan@21:1/5 to python-list@python.org on Mon Aug 5 13:55:44 2024
    Your approach is wrong.
    You don't build python from source using pip.

    You don't install new versions of python into a venv either.

    Have you read the following? https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html

    That seems to have instructions for what you want to do..

    -Bill



    On Mon, Aug 5, 2024 at 1:41 PM o1bigtenor via Python-list < python-list@python.org> wrote:

    Matt - if you would rather that you were not included in the address list -
    -
    please advise.

    On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann <mats@wichmann.us> wrote:

    On 8/5/24 06:48, o1bigtenor via Python-list wrote:
    On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list < python-list@python.org> wrote:

    On 8/3/24 20:03, o1bigtenor via Python-list wrote:

    My question was, is and will be (and the doc absolutely doesn't cover it)
    how do I install a different version in the venv so that python
    3.11.x
    on
    the
    system is not discombobulated by the python 3.12.x in the venv.
    That python 3.12 would let me run the tools needed.
    (Its the how to install the next version of python that I just
    haven't
    been
    able to find information on - - - and I would be looking for information
    on how to install on a *nix.)

    To get a different Python "in" the venv, you use the version you want
    in
    the construction of the venv. For example:


    $ python3.13 -m venv new_venv
    $ new_venv/bin/python --version
    Python 3.13.0b4
    $ source new_venv/bin/activate


    "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from interacting with the OS installed python. This change has been done in
    red
    hat and other distros too . . . "

    similarly your first command produces and error code for the same
    reason.

    Sorry - - - not my policy - - -

    What? Yes, the *system* pip should have some restrictions, if it's a
    system mainly managed by a package manager.

    Setting up a venv is the *expected* approach to such situations, and creating one doesn't cause any problems. You end up with a pip in the activated venv that's going to install to a different path (the one in
    the venv), and will not be marked as externally managed, as the package manager has no control over that path.

    That's the whole point. What error are you getting? The venv module is not the pip module so restrictions on the system pip have nothing to do with it.

    set up pyenv
    activated a venv
    trying to install python3.12 into it

    1. download of python3.12 (blahblahblahetc).deb will not install
    2. download of python3.12.tar.xz similarly will not install

    (venv2) memyself@devuanbigbox:~$ pip install /home/memyself/Downloads/Python-3.12.4.tar.xz
    Processing ./Downloads/Python-3.12.4.tar.xz
    ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

    seems that I need a different version (installable as it were) of
    python3.12
    or my approach is all wrong!

    Please advise

    TIA
    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to All on Mon Aug 5 14:56:13 2024
    On 8/5/24 14:39, o1bigtenor wrote:
    Matt - if you would rather that you were not included in the address
    list - -
    please advise.

    On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann <mats@wichmann.us <mailto:mats@wichmann.us>> wrote:

    On 8/5/24 06:48, o1bigtenor via Python-list wrote:
    > On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
    > python-list@python.org <mailto:python-list@python.org>> wrote:
    >
    >> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
    >>
    >>> My question was, is and will be (and the doc absolutely doesn't
    cover it)
    >>> how do I install a different version in the venv so that python
    3.11.x on
    >>> the
    >>> system is not discombobulated by the python 3.12.x in the venv.
    >>> That python 3.12 would let me run the tools needed.
    >>> (Its the how to install the next version of python that I just
    haven't
    >> been
    >>> able to find information on - - - and I would be looking for
    information
    >>> on how to install on a *nix.)
    >>
    >> To get a different Python "in" the venv, you use the version you
    want in
    >> the construction of the venv. For example:
    >>
    >>
    >> $ python3.13 -m venv new_venv
    >> $ new_venv/bin/python --version
    >> Python 3.13.0b4
    >> $ source new_venv/bin/activate
    >>
    >>
    >   "https://peps.python.org/pep-0668/
    <https://peps.python.org/pep-0668/> PEP 668, which prevents pip from
    > interacting with the OS installed python. This change has been
    done in red
    > hat and other distros too . . . "
    >
    > similarly your first command produces and error code for the same
    reason.
    >
    > Sorry - - - not my policy - - -

    What? Yes, the *system* pip should have some restrictions, if it's a
    system mainly managed by a package manager.

    Setting up a venv is the *expected* approach to such situations, and
    creating one doesn't cause any problems. You end up with a pip in the
    activated venv that's going to install to a different path (the one in
    the venv), and will not be marked as externally managed, as the package
    manager has no control over that path.

    That's the whole point.  What error are you getting?  The venv
    module is
    not the pip module so restrictions on the system pip have nothing to do
    with it.

    set up pyenv
    activated a venv
    trying to install python3.12 into it

    1. download of python3.12 (blahblahblahetc).deb will not install
    2. download of python3.12.tar.xz similarly will not install

    (venv2) memyself@devuanbigbox:~$ pip install /home/memyself/Downloads/Python-3.12.4.tar.xz
    Processing ./Downloads/Python-3.12.4.tar.xz
    ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not
    appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

    seems that I need a different version (installable as it were) of
    python3.12
    or my approach is all wrong!


    you can't install Python "into" a venv.

    you use a version of Python as the base when *creating* a venv, the venv
    will use the same binary as the base python (symlinks if possible, as in
    the Linux case), but with different paths.

    Since you've already got pyenv, use it to build the version you want to
    use - I think you said there wasn't a deb for 3.12 in your distro?
    That's something like

    pyenv install 3.12.4

    that will use the build recipe it has... and hopefully work. Distro
    Pythons sometimes have some strange setups that are hard to reproduce.
    Pyenv knows how to build micropython, too, should it ever come to that.

    If you indeed found a deb for the right Python, use apt to install it,
    and then use *that* Python to create your venv.

    If you have the pyenv-virtualenv plugin, you can ask it to make the
    virtualenv for you, if pyenv built the Python

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to All on Mon Aug 5 16:12:10 2024
    On 8/5/24 15:17, o1bigtenor via Python-list wrote:

    That's something like

    pyenv install 3.12.4


    $ pyenv install 3.12.4
    bash: pyenv: command not found


    pyenv is not a 'global' package

    there is a mountain of /root/.pyenv files though
    there is also quite a number of /root/.pyenv/plugins/pyenv-virtualenv/
    files

    when looking in the /root/.pyenv files I can find options for all the older version of python
    but none for anything newer than what is on my system

    is there something else to install to achieve this 'version freedom' that pyenv promises?

    It has to go somewhere your shell can find it. Mine is a shell
    function, but it was set up so many years ago I don't remember details.
    It's presumably the pyenv installation instructions...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Deegan@21:1/5 to python-list@python.org on Mon Aug 5 15:25:43 2024
    Did Mats suggestion of:
    python3.13 -m venv new_venv
    $ new_venv/bin/python --version
    Python 3.13.0b4
    $ source new_venv/bin/activate

    Not work?
    That should work on any system, with any system installl python.
    It's not trying to modify the system installed python in anyway...

    If not, please paste the error output you're getting.


    On Mon, Aug 5, 2024 at 3:13 PM Mats Wichmann via Python-list < python-list@python.org> wrote:

    On 8/5/24 15:17, o1bigtenor via Python-list wrote:

    That's something like

    pyenv install 3.12.4


    $ pyenv install 3.12.4
    bash: pyenv: command not found


    pyenv is not a 'global' package

    there is a mountain of /root/.pyenv files though
    there is also quite a number of /root/.pyenv/plugins/pyenv-virtualenv/ files

    when looking in the /root/.pyenv files I can find options for all the
    older
    version of python
    but none for anything newer than what is on my system

    is there something else to install to achieve this 'version freedom' that pyenv promises?

    It has to go somewhere your shell can find it. Mine is a shell
    function, but it was set up so many years ago I don't remember details.
    It's presumably the pyenv installation instructions...



    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Deegan@21:1/5 to o1bigtenor@gmail.com on Mon Aug 5 20:36:12 2024
    why reply to me instead of to the list?
    It's generally considered bad form to do so.


    Do you have any python 3 installed on your system?
    Or python 2.7?
    If not, can you install such via system package?

    -Bill



    On Mon, Aug 5, 2024 at 6:06 PM o1bigtenor <o1bigtenor@gmail.com> wrote:



    On Mon, Aug 5, 2024 at 5:28 PM Bill Deegan via Python-list < python-list@python.org> wrote:

    Did Mats suggestion of:
    python3.13 -m venv new_venv
    $ new_venv/bin/python --version
    Python 3.13.0b4
    $ source new_venv/bin/activate

    Not work?
    That should work on any system, with any system installl python.
    It's not trying to modify the system installed python in anyway...

    If not, please paste the error output you're getting.


    # python3.13 -m venv new_venv
    -bash: python3.13: command not found

    $ python3.13 -m venv new_venv
    bash: python3.13: command not found

    There you have it - - - the first one run as superuser and the second as
    usr.

    Regards




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)