Re: What can I do about this?

2022-08-29 Thread gene heskett

On 8/28/22 20:51, gene heskett wrote:

On 8/28/22 19:36, Chris Angelico wrote:

On Mon, 29 Aug 2022 at 08:41, gene heskett  wrote:

Greatings all;

Persuant to my claim the py3.10 is busted, here is a sample. This is 
me,

trying to make
pronterface, inside a venv: When the package manager version will only
run the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at all.
  From the package-managers install in 
/usr/share/doc/printrun-common/ I

copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt
Defaulting to user installation because normal site-packages is not
writeable

I don't think Python 3.10 is busted; it's more likely your venv is not
providing a pip3 command. Try "pip3 --version",

gene@rock64:~/venv$ pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

  "python3 --version",

gene@rock64:~/venv$ python3 --version
Python 3.10.4


and then "python3 -m pip install -r requirements.txt".

gene@rock64:~/venv$ python3 -m pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not 
writeable
Ignoring pyobjc-framework-Cocoa: markers 'sys_platform == "darwin"' 
don't match your environment
Ignoring pyreadline: markers 'sys_platform == "win32"' don't match 
your environment
Requirement already satisfied: pyserial>=3.0 in 
/usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (3.5)

Collecting wxPython>=4.1
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
  Traceback (most recent call last):
    File "", line 2, in 
    File "", line 34, in 
    File 
"/tmp/pip-install-g3phtj8f/wxpython_17898b1c7a6f49a690adac623d839514/setup.py", 
line 27, in 
  from buildtools.config import Config, msg, opj, runcmd, 
canGetSOName, getSOName
    File 
"/tmp/pip-install-g3phtj8f/wxpython_17898b1c7a6f49a690adac623d839514/buildtools/config.py", 
line 30, in 

  from attrdict import AttrDict
  ModuleNotFoundError: No module named 'attrdict'
  [end of output]

  note: This error originates from a subprocess, and is likely not a 
problem with pip.

error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.



Why do you keep blaming Python as if it's fundamentally broken?

ChrisA
Given the above output, do you have a better target? It also fails to 
build linuxcnc on

bullseye for armhf, on an rpi4b with 2 gigs of dram.
Works perfectly on buster, but I expect that has been fixed  since 
linuxcnc

looks like its good to go for inclusion in bookworm.


I;ve created a separate venv to install printrun, I does not work either.

So in that venv, I've done a git clone of printrun. Then after that, it 
appears there is
no such critter as a wxPython.whl for the arms, only x86_64's. So whats 
the diff if it
run ok on a pi, or claims it does. I don't have a spare rpi4b and they 
are equ to teeth

for a chicken ATM.

What, on the arms, substitutes for the missing "*.whl" file?


Take care and stay well Chris.

Cheers, Gene Heskett.



Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 

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


Re: What can I do about this?

2022-08-29 Thread Roel Schroeven

Op 29/08/2022 om 2:55 schreef gene heskett:

On 8/28/22 19:39, Peter J. Holzer wrote:

On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This is 
me,

trying to make
pronterface, inside a venv: When the package manager version will 
only run

the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at all.
 From the package-managers install in /usr/share/doc/printrun-common/ I
copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt

You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it 
either.
I found a way to autostart it on reboots and octoprint seems happy 
with it
I agree with Peter: it doesn't look as if you are invoking the pip3 in 
the venv. Just making the venv-directory the current directory doesn't 
activate it.


As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3

Does that show the pip3 installed in the venv? Or the system-wide one? 
If it's not the pip3 in the venv, well, then that's the problem (or at 
least part of the problem). Solution: first check whether the venv 
really contains 'pip3' (as opposed to eg. just 'pip'): list the contents 
of the bin subdirectory of the venv. If not, use 'pip' or whatever 
instead. Then to make sure you use the one in the venv, either activate 
the venv or explicitly specify the path when invoking pip/pip3 (and 
likewise for python/python3).


So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv
$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

Activating the venv is easier if you're going to use multiple commands 
in the venv. Note that activating the venv only has effect on the 
current shell; other shells are unaffected, and when you close the 
current shell the venv is not activated anymore.
Explicitly using the path is easier for one-off calls, or in things like 
crontab.


--
"There is no cause so noble that it will not attract fuggheads."
-- Larry Niven

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


Re: What can I do about this?

2022-08-29 Thread gene heskett

On 8/29/22 05:25, Roel Schroeven wrote:

Op 29/08/2022 om 2:55 schreef gene heskett:

On 8/28/22 19:39, Peter J. Holzer wrote:

On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This 
is me,

trying to make
pronterface, inside a venv: When the package manager version will 
only run

the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at all.
 From the package-managers install in 
/usr/share/doc/printrun-common/ I

copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt

You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it 
either.
I found a way to autostart it on reboots and octoprint seems happy 
with it
I agree with Peter: it doesn't look as if you are invoking the pip3 in 
the venv. Just making the venv-directory the current directory doesn't 
activate it.


As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3


I get different answers in or out of the venv

venv) gene@rock64:~/printrun/Printrun$ type -a pip3
pip3 is /home/gene/printrun/Printrun/venv/bin/pip3
pip3 is /usr/bin/pip3
pip3 is /bin/pip3

or:

gene@rock64:~/src/wxPython-4.2.0$ type -a pip3
pip3 is /usr/bin/pip3
pip3 is /bin/pip3

but with all the build instructions I've now followed, I now have at 
least 3 different

venv subdirs scattered about.

one in /home/gene,
one in /home/gene/Octoprint,
and one in /home/gene/printrun

each with its own bin subdir, but not identical contents.

Does that show the pip3 installed in the venv? Or the system-wide one? 
If it's not the pip3 in the venv, well, then that's the problem (or at 
least part of the problem). Solution: first check whether the venv 
really contains 'pip3' (as opposed to eg. just 'pip'): list the 
contents of the bin subdirectory of the venv. 

gene@rock64:~/venv/bin$ ls -l
total 36
-rw-r--r-- 1 gene gene 1982 Aug 21 13:12 activate
-rw-r--r-- 1 gene gene  908 Aug 21 13:12 activate.csh
-rw-r--r-- 1 gene gene 2050 Aug 21 13:12 activate.fish
-rw-r--r-- 1 gene gene 9033 Aug 21 13:12 Activate.ps1
-rwxrwxr-x 1 gene gene  232 Aug 21 13:12 pip
-rwxrwxr-x 1 gene gene  232 Aug 21 13:12 pip3
-rwxrwxr-x 1 gene gene  232 Aug 21 13:12 pip3.10
lrwxrwxrwx 1 gene gene    7 Aug 21 13:11 python -> python3
lrwxrwxrwx 1 gene gene   16 Aug 21 13:11 python3 -> /usr/bin/python3
lrwxrwxrwx 1 gene gene    7 Aug 21 13:11 python3.10 -> python3

If not, use 'pip' or whatever instead. Then to make sure you use the 
one in the venv, either activate the venv or explicitly specify the 
path when invoking pip/pip3 (and likewise for python/python3).


So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv
$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

Activating the venv is easier if you're going to use multiple commands 
in the venv. Note that activating the venv only has effect on the 
current shell; other shells are unaffected, and when you close the 
current shell the venv is not activated anymore.
Explicitly using the path is easier for one-off calls, or in things 
like crontab.


I've not had to deal with venv's before. Can more than one of these venv 
things
peacefully coexist?  Seems like they should. If there is sufficient nv 
memory,

But I am a 100% new bee here. The card itself is a 64GB.

I also have the git clone of wxPython-4.2.0, but nothing I can invoke 
there builds it.
But there are no specific linux instructions there, osx and winders 
only. The package

managers version of wxPython-4.0.7 apparently is not new enough.

It seems to me these utility's ought to be able to all live in one venv, 
or there should be
an env python path that is specific to each application. This would lead 
to a huge waste
of nv storage by duplicating a venv for each app, not sensible when the 
target of the venv

is a common arm64 system. All broadcom for gpio etc.

Presently, Octoprint works, and so does pronsole which has no gui, but 
Octoprint

is a one printer show, and I've a small farm of printers. Most of which have
failed the PETG test ,but that claimed to be PETG compatible, but 
quickly failed
when fed a roll of it. PETG is the same plastic forever bottles are made 
from, much
stronger than the PLA most folks use for artwork and what I'm doing 
needs its
physical strength. It also raises the printhead temp around 50C, which 
causes
teflon to slowly ablate with phosgene gas as output. Dangerous stuff, 
and high

maintenance too.

What I hope to be the 2nd workhorse  is an Ender 5 Plus, a huge core-xy 
thing that
now has a 300C capable head and an orbiter-v2 direct drive, heavy enough 
I've
had to restrict  its top speed from its default 500mm. The other

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Jach Feng
Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道:
> On Mon, 29 Aug 2022 at 15:54, Jach Feng  wrote: 
> > 
> > Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: 
> > > On 8/27/22 7:42 AM, Mark Bourne wrote: 
> > > > Jach Feng wrote: 
> > > >> I have two files: test.py and test2.py 
> > > >> --test.py-- 
> > > >> x = 2 
> > > >> def foo(): 
> > > >> print(x) 
> > > >> foo() 
> > > >> 
> > > >> x = 3 
> > > >> foo() 
> > > >> 
> > > >> --test2.py-- 
> > > >> from test import * 
> > > >> x = 4 
> > > >> foo() 
> > > >> 
> > > >> - 
> > > >> Run test.py under Winows8.1, I get the expected result: 
> > > >> e:\MyDocument>py test.py 
> > > >> 2 
> > > >> 3 
> > > >> 
> > > >> But when run test2.py, the result is not my expected 2,3,4:-( 
> > > >> e:\MyDocument>py test2.py 
> > > >> 2 
> > > >> 3 
> > > >> 3 
> > > >> 
> > > >> What to do? 
> > > > 
> > > > `from test import *` does not link the names in `test2` to those in 
> > > > `test`. It just binds objects bound to names in `test` to the same 
> > > > names in `test2`. A bit like doing: 
> > > > 
> > > > import test 
> > > > x = test.x 
> > > > foo = test.foo 
> > > > del test 
> > > > 
> > > > Subsequently assigning a different object to `x` in one module does 
> > > > not affect the object assigned to `x` in the other module. So `x = 4` 
> > > > in `test2.py` does not affect the object assigned to `x` in `test.py` 
> > > > - that's still `3`. If you want to do that, you need to import `test` 
> > > > and assign to `test.x`, for example: 
> > > > 
> > > > import test 
> > > > test.x = 4 
> > > > test.foo() 
> > > > 
> > > Yes, fundamental issue is that the statement 
> > > 
> > > from x import y 
> > > 
> > > makes a binding in this module to the object CURRECTLY bound to x.y to 
> > > the name y, but if x.y gets rebound, this module does not track the 
> > > changes. 
> > > 
> > > You can mutate the object x.y and see the changes, but not rebind it. 
> > > 
> > > If you need to see rebindings, you can't use the "from x import y" form, 
> > > or at a minimum do it as: 
> > > 
> > > 
> > > import x 
> > > 
> > > from x import y 
> > > 
> > > then later to get rebindings to x.y do a 
> > > 
> > > y = x.y 
> > > 
> > > to rebind to the current x.y object. 
> > > 
> > > -- 
> > > Richard Damon 
> > Yes, an extra "import x" will solve my problem too! Sometimes I am 
> > wondering why "from x import y" hides x? hum...can't figure out the 
> > reason:-) 
> >
> "from x import y" doesn't hide x - it just grabs y. Python does what 
> you tell it to. :) 
> 
> ChrisA
But I had heard people say that "from x import y" did import the whole x module 
into memory, just as "import x" did, not "grabs y" only. Is this correct?

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


Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Mark Bourne

Jach Feng wrote:

Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道:

On Mon, 29 Aug 2022 at 15:54, Jach Feng  wrote:


Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道:

On 8/27/22 7:42 AM, Mark Bourne wrote:

Jach Feng wrote:

I have two files: test.py and test2.py
--test.py--
x = 2
def foo():
print(x)
foo()

x = 3
foo()

--test2.py--
from test import *
x = 4
foo()

-
Run test.py under Winows8.1, I get the expected result:
e:\MyDocument>py test.py
2
3

But when run test2.py, the result is not my expected 2,3,4:-(
e:\MyDocument>py test2.py
2
3
3

What to do?


`from test import *` does not link the names in `test2` to those in
`test`. It just binds objects bound to names in `test` to the same
names in `test2`. A bit like doing:

import test
x = test.x
foo = test.foo
del test

Subsequently assigning a different object to `x` in one module does
not affect the object assigned to `x` in the other module. So `x = 4`
in `test2.py` does not affect the object assigned to `x` in `test.py`
- that's still `3`. If you want to do that, you need to import `test`
and assign to `test.x`, for example:

import test
test.x = 4
test.foo()


Yes, fundamental issue is that the statement

from x import y

makes a binding in this module to the object CURRECTLY bound to x.y to
the name y, but if x.y gets rebound, this module does not track the changes.

You can mutate the object x.y and see the changes, but not rebind it.

If you need to see rebindings, you can't use the "from x import y" form,
or at a minimum do it as:


import x

from x import y

then later to get rebindings to x.y do a

y = x.y

to rebind to the current x.y object.

--
Richard Damon

Yes, an extra "import x" will solve my problem too! Sometimes I am wondering why 
"from x import y" hides x? hum...can't figure out the reason:-)


"from x import y" doesn't hide x - it just grabs y. Python does what
you tell it to. :)

ChrisA

But I had heard people say that "from x import y" did import the whole x module into memory, just 
as "import x" did, not "grabs y" only. Is this correct?


`from x import y` does import the whole module x into memory, and adds 
it to `sys.modules`.  But it only binds the name `y` in the namespace of 
module doing the import (and it binds it to the value of `x.y` at the 
time the import is done - it doesn't magically keep them in sync if one 
or the other is later reassigned).


The point about the whole module being imported is that you don't save 
any memory by using `from x import y` to avoid importing some very large 
object `z` from `x`.  Those other large objects might be needed by 
functions which have been imported (e.g. your `foo` function still needs 
`x` even if you haven't imported `x` - so it still needs to be loaded 
into memory) or might be imported and used by other modules importing 
`x`, so they still have to be loaded when any part of `x` is imported - 
they just don't have to be bound to names in the importing module's 
namespace.


As Richard mentioned, if `x.y` is a mutable object (such as a list) you 
can still mutate that object (e.g. add/remove items) and those changes 
will be seen in both modules.  That's because both are still bound to 
the same object and you're mutating that existing object.  If you assign 
a new list to either, that won't be seen by the other.


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


Re: What can I do about this?

2022-08-29 Thread Mark Bourne

Roel Schroeven wrote:

Op 29/08/2022 om 2:55 schreef gene heskett:

On 8/28/22 19:39, Peter J. Holzer wrote:

On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This is 
me,

trying to make
pronterface, inside a venv: When the package manager version will 
only run

the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at all.
 From the package-managers install in /usr/share/doc/printrun-common/ I
copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt

You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it 
either.
I found a way to autostart it on reboots and octoprint seems happy 
with it
I agree with Peter: it doesn't look as if you are invoking the pip3 in 
the venv. Just making the venv-directory the current directory doesn't 
activate it.


As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3

Does that show the pip3 installed in the venv? Or the system-wide one? 
If it's not the pip3 in the venv, well, then that's the problem (or at 
least part of the problem). Solution: first check whether the venv 
really contains 'pip3' (as opposed to eg. just 'pip'): list the contents 
of the bin subdirectory of the venv. If not, use 'pip' or whatever 
instead. Then to make sure you use the one in the venv, either activate 
the venv or explicitly specify the path when invoking pip/pip3 (and 
likewise for python/python3).


So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv


I think this first line should probably be:

$ source {path_to_venv}/bin/activate  # activate the venv

i.e. with `activate` rather than `pip3`?


$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

Activating the venv is easier if you're going to use multiple commands 
in the venv. Note that activating the venv only has effect on the 
current shell; other shells are unaffected, and when you close the 
current shell the venv is not activated anymore.
Explicitly using the path is easier for one-off calls, or in things like 
crontab.



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


Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Chris Angelico
On Tue, 30 Aug 2022 at 02:38, Jach Feng  wrote:
>
> Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道:
> > On Mon, 29 Aug 2022 at 15:54, Jach Feng  wrote:
> > >
> > > Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道:
> > > > On 8/27/22 7:42 AM, Mark Bourne wrote:
> > > > > Jach Feng wrote:
> > > > >> I have two files: test.py and test2.py
> > > > >> --test.py--
> > > > >> x = 2
> > > > >> def foo():
> > > > >> print(x)
> > > > >> foo()
> > > > >>
> > > > >> x = 3
> > > > >> foo()
> > > > >>
> > > > >> --test2.py--
> > > > >> from test import *
> > > > >> x = 4
> > > > >> foo()
> > > > >>
> > > > >> -
> > > > >> Run test.py under Winows8.1, I get the expected result:
> > > > >> e:\MyDocument>py test.py
> > > > >> 2
> > > > >> 3
> > > > >>
> > > > >> But when run test2.py, the result is not my expected 2,3,4:-(
> > > > >> e:\MyDocument>py test2.py
> > > > >> 2
> > > > >> 3
> > > > >> 3
> > > > >>
> > > > >> What to do?
> > > > >
> > > > > `from test import *` does not link the names in `test2` to those in
> > > > > `test`. It just binds objects bound to names in `test` to the same
> > > > > names in `test2`. A bit like doing:
> > > > >
> > > > > import test
> > > > > x = test.x
> > > > > foo = test.foo
> > > > > del test
> > > > >
> > > > > Subsequently assigning a different object to `x` in one module does
> > > > > not affect the object assigned to `x` in the other module. So `x = 4`
> > > > > in `test2.py` does not affect the object assigned to `x` in `test.py`
> > > > > - that's still `3`. If you want to do that, you need to import `test`
> > > > > and assign to `test.x`, for example:
> > > > >
> > > > > import test
> > > > > test.x = 4
> > > > > test.foo()
> > > > >
> > > > Yes, fundamental issue is that the statement
> > > >
> > > > from x import y
> > > >
> > > > makes a binding in this module to the object CURRECTLY bound to x.y to
> > > > the name y, but if x.y gets rebound, this module does not track the 
> > > > changes.
> > > >
> > > > You can mutate the object x.y and see the changes, but not rebind it.
> > > >
> > > > If you need to see rebindings, you can't use the "from x import y" form,
> > > > or at a minimum do it as:
> > > >
> > > >
> > > > import x
> > > >
> > > > from x import y
> > > >
> > > > then later to get rebindings to x.y do a
> > > >
> > > > y = x.y
> > > >
> > > > to rebind to the current x.y object.
> > > >
> > > > --
> > > > Richard Damon
> > > Yes, an extra "import x" will solve my problem too! Sometimes I am 
> > > wondering why "from x import y" hides x? hum...can't figure out the 
> > > reason:-)
> > >
> > "from x import y" doesn't hide x - it just grabs y. Python does what
> > you tell it to. :)
> >
> > ChrisA
> But I had heard people say that "from x import y" did import the whole x 
> module into memory, just as "import x" did, not "grabs y" only. Is this 
> correct?
>

In order to do any sort of import, Python has to run the whole module.
But after that, something gets set in your module so that you can get
access to it.

import x
# is kinda like
go_and_run("x")
x = fetch_module("x")

from x import y
# is kinda like
go_and_run("x")
y = fetch_module("x").y

Either way, the whole module gets run, but then there's an assignment
into your module that depends on what you're importing.

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


Re: What can I do about this?

2022-08-29 Thread Dennis Lee Bieber
On Mon, 29 Aug 2022 04:51:13 -0400, gene heskett 
declaimed the following:

>What, on the arms, substitutes for the missing "*.whl" file?
>
In Debian -- apt-get
https://packages.debian.org/stable/source/wxpython4.0
of course, that will install things system-wide, not in a virtual
environment, and compatible with the system Python. For Bullseye, that is
still Python 3.9!

pi@rpi3bplus-1:~$ uname -a
Linux rpi3bplus-1 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l
GNU/Linux
pi@rpi3bplus-1:~$ sudo apt search wxpython
Sorting... Done
Full Text Search... Done
gnumed-client/stable 1.8.5+dfsg-2 all
  medical practice management - Client

psychopy/stable 2020.2.10+dfsg-2 all
  environment for creating psychology stimuli in Python

pyscanfcs/stable 0.3.6+ds-2+b1 armhf
  scientific tool for perpendicular line scanning FCS

python3-genx/stable 3.0.2-1 armhf
  differential evolution algorithm for fitting

python3-opengl/stable 3.1.5+dfsg-1 all
  Python bindings to OpenGL (Python 3)

python3-pyface/stable 6.1.2-2 all
  traits-capable windowing framework

python3-squaremap/stable 1:1.0.5-2 all
  wxPython control to display hierarchic data as nested squares

python3-wxgtk-media4.0/stable 4.0.7+dfsg-10 armhf
  Python 3 interface to the wxWidgets Cross-platform C++ GUI toolkit
(wx.media)

python3-wxgtk-webview4.0/stable 4.0.7+dfsg-10 armhf
  Python 3 interface to the wxWidgets Cross-platform C++ GUI toolkit
(wx.html2)

python3-wxgtk4.0/stable 4.0.7+dfsg-10 armhf
  Python 3 interface to the wxWidgets Cross-platform C++ GUI toolkit

soundgrain/stable 6.0.1-2 all
  Graphical interface to control granular sound synthesis modules

wxglade/stable 1.0.1-1 all
  GUI designer written in Python with wxPython

wxpython-tools/stable 4.0.7+dfsg-10 all
  Tools from the wxPython distribution

pi@rpi3bplus-1:~$

pi@rpi3bplus-1:~$ sudo apt install python3-wxgtk4.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5
Suggested packages:
  wx3.0-doc
The following NEW packages will be installed:
  libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 python3-wxgtk4.0
0 upgraded, 3 newly installed, 0 to remove and 161 not upgraded.
Need to get 10.5 MB of archives.
After this operation, 51.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf
libwxbase3.0-0v5 armhf 3.0.5.1+dfsg-2 [918 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf
libwxgtk3.0-gtk3-0v5 armhf 3.0.5.1+dfsg-2 [3650 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf
python3-wxgtk4.0 armhf 4.0.7+dfsg-10 [5970 kB]
Fetched 10.5 MB in 8s (1346 kB/s)
Selecting previously unselected package libwxbase3.0-0v5:armhf.
(Reading database ... 175515 files and directories currently installed.)
Preparing to unpack .../libwxbase3.0-0v5_3.0.5.1+dfsg-2_armhf.deb ...
Unpacking libwxbase3.0-0v5:armhf (3.0.5.1+dfsg-2) ...
Selecting previously unselected package libwxgtk3.0-gtk3-0v5:armhf.
Preparing to unpack .../libwxgtk3.0-gtk3-0v5_3.0.5.1+dfsg-2_armhf.deb ...
Unpacking libwxgtk3.0-gtk3-0v5:armhf (3.0.5.1+dfsg-2) ...
Selecting previously unselected package python3-wxgtk4.0.
Preparing to unpack .../python3-wxgtk4.0_4.0.7+dfsg-10_armhf.deb ...
Unpacking python3-wxgtk4.0 (4.0.7+dfsg-10) ...
Setting up libwxbase3.0-0v5:armhf (3.0.5.1+dfsg-2) ...
Setting up libwxgtk3.0-gtk3-0v5:armhf (3.0.5.1+dfsg-2) ...
Setting up python3-wxgtk4.0 (4.0.7+dfsg-10) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ...
pi@rpi3bplus-1:~$






Or... You wait until somebody builds a Python3.10 ARMHF compatible
wheel.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can I do about this?

2022-08-29 Thread Roel Schroeven

Mark Bourne schreef op 29/08/2022 om 13:02:

Roel Schroeven wrote:
> $ source {path_to_venv}/bin/pip3  # activate the venv

I think this first line should probably be:

$ source {path_to_venv}/bin/activate  # activate the venv

i.e. with `activate` rather than `pip3`?


Oops, yes, of course. Thank you for the correction!

--

"In the old days, writers used to sit in front of a typewriter and stare out of
the window. Nowadays, because of the marvels of convergent technology, the thing
you type on and the window you stare out of are now the same thing.”
-- Douglas Adams

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


Re: What can I do about this?

2022-08-29 Thread gene heskett

On 8/29/22 12:50, Mark Bourne wrote:

Roel Schroeven wrote:

Op 29/08/2022 om 2:55 schreef gene heskett:

On 8/28/22 19:39, Peter J. Holzer wrote:

On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This 
is me,

trying to make
pronterface, inside a venv: When the package manager version will 
only run

the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at 
all.
 From the package-managers install in 
/usr/share/doc/printrun-common/ I

copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt

You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it 
either.
I found a way to autostart it on reboots and octoprint seems happy 
with it
I agree with Peter: it doesn't look as if you are invoking the pip3 
in the venv. Just making the venv-directory the current directory 
doesn't activate it.


As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3

Does that show the pip3 installed in the venv? Or the system-wide 
one? If it's not the pip3 in the venv, well, then that's the problem 
(or at least part of the problem). Solution: first check whether the 
venv really contains 'pip3' (as opposed to eg. just 'pip'): list the 
contents of the bin subdirectory of the venv. If not, use 'pip' or 
whatever instead. Then to make sure you use the one in the venv, 
either activate the venv or explicitly specify the path when invoking 
pip/pip3 (and likewise for python/python3).


So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv


I think this first line should probably be:

$ source {path_to_venv}/bin/activate  # activate the venv

i.e. with `activate` rather than `pip3`?


$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

That got me to showstopper #2: (lengthy warniing)

(venv) gene@rock64:~/printrun/Printrun$ ./venv/bin/pip3 install -r 
requirements.txt
Ignoring pyobjc-framework-Cocoa: markers 'sys_platform == "darwin"' 
don't match your environment
Ignoring pyreadline: markers 'sys_platform == "win32"' don't match your 
environment
Requirement already satisfied: pyserial>=3.0 in 
./venv/lib/python3.10/site-packages (from -r requirements.txt (line 1)) 
(3.5)

Collecting wxPython==4.1.0
  Using cached wxPython-4.1.0.tar.gz (65.8 MB)
  Preparing metadata (setup.py) ... done
Collecting numpy>=1.8.2
  Using cached 
numpy-1.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 
(13.9 MB)
Requirement already satisfied: pyglet>=1.1 in 
./venv/lib/python3.10/site-packages (from -r requirements.txt (line 4)) 
(1.5.26)

Collecting cffi
  Using cached 
cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 
(449 kB)

Collecting cairocffi
  Using cached cairocffi-1.3.0.tar.gz (88 kB)
  Preparing metadata (setup.py) ... done
Collecting cairosvg>=1.0.9
  Using cached CairoSVG-2.5.2-py3-none-any.whl (45 kB)
Collecting psutil>=2.1
  Using cached psutil-5.9.1-cp310-cp310-linux_aarch64.whl
Collecting lxml>=2.9.1
  Using cached 
lxml-4.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl 
(6.6 MB)

Collecting appdirs>=1.4.0
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting dbus-python>=1.2.0
  Using cached dbus-python-1.2.18.tar.gz (578 kB)
  Preparing metadata (setup.py) ... done
Collecting pillow
  Using cached Pillow-9.2.0-cp310-cp310-manylinux_2_28_aarch64.whl (3.1 MB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting cssselect2
  Using cached cssselect2-0.6.0-py3-none-any.whl (15 kB)
Collecting tinycss2
  Using cached tinycss2-1.1.1-py3-none-any.whl (21 kB)
Collecting defusedxml
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: webencodings in 
./venv/lib/python3.10/site-packages (from 
cssselect2->cairosvg>=1.0.9->-r requirements.txt (line 7)) (0.5.1)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is 
not installed.
Using legacy 'setup.py install' for cairocffi, since package 'wheel' is 
not installed.
Using legacy 'setup.py install' for dbus-python, since package 'wheel' 
is not installed.
Installing collected packages: dbus-python, appdirs, tinycss2, six, 
pycparser, psutil, pillow, numpy, lxml, defusedxml, wxPython, 
cssselect2, cffi, cairocffi, cairosvg

  Running setup.py install for dbus-python ... error
  error: subprocess-exited-with-error

  × Running setup.py install for dbus-python did not run successfully.
  │ exit code: 1
  ╰─> [166 lines of output]
  running install
/home/gene/printrun/Printrun/venv/lib/pyt

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 11:40:33 +0100, Mark Bourne wrote:
> Jach Feng wrote:
> > Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道:
> > > On Mon, 29 Aug 2022 at 15:54, Jach Feng  wrote:
> > > > Sometimes I am wondering why "from x import y" hides x?
> > > > hum...can't figure out the reason:-)
> > > > 
> > > "from x import y" doesn't hide x - it just grabs y. Python does
> > > what you tell it to. :)
> > > 
> > But I had heard people say that "from x import y" did import the
> > whole x module into memory, just as "import x" did, not "grabs y"
> > only. Is this correct?
> 
> `from x import y` does import the whole module x into memory, and adds
> it to `sys.modules`.  But it only binds the name `y` in the namespace
> of module doing the import (and it binds it to the value of `x.y` at
> the time the import is done

I think this should be rephrased. "`x.y` at the time the import is done"
implies that at this time the name `x` does exist in the current
namespace.  Which then leads to the conclusion that this name must be
hidden later. But I don't think this is the case.

The module is imported but it isn't bound to any name in the current
(global) namespace (obviously there must be some variable bound to it, but
that's probably a local variable in the importer and it isn't called
`x`). Then the object bound to the name `y` in the loaed module is bound
to the name `y` in the current namespace.

hp

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


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 13:43:18 -0400, gene heskett wrote:
> On 8/29/22 12:50, Mark Bourne wrote:
> > Roel Schroeven wrote:
> > > $ pip3 install -r requirements.txt  # finally invoke pip3
> > > 
> > > or:
> > > 
> > > $ {path_to_venv}/bin/pip3 install -r requirements.txt
> That got me to showstopper #2: (lengthy warniing)
> 
[...]
>   checking for dbus-1 >= 1.8... no
>   configure: error: Package requirements (dbus-1 >= 1.8) were not met:
> 
>   No package 'dbus-1' found

Since this message comes from configure, it is probably looking
for the development version of the dbus library here.

apt search dbus-1

reveals (among other things):

libdbus-1-dev/jammy 1.12.20-2ubuntu4 amd64
  simple interprocess messaging system (development headers)

(this is on Ubuntu, so the version number is probably different, but the
package name should be the same as on Debian.)

So you invoke

apt install libdbus-1-dev

and try again. At which point you will probably discove another missing
library. Rinse and repeat.

Ideally the README should mention such dependencies, but since the exact
names of the packages depend on the distribution, it will often be vague
unless you happen to use the same distribution as the developer.

hp

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


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 11:12:17 -0400, gene heskett wrote:
> I've not had to deal with venv's before. Can more than one of these
> venv things peacefully coexist?

Yes. Having multiple venvs is the main reason for their existence.

hp

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


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Coffee

2022-08-29 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes:

> |Python's obviously a great tool for all kinds of programming things,
> |and I would say if you're only gonna use one programming
> |language in your live, Python will probably the right one.
> Brian Kernighan
>
>   I transcribed this from the recent video 
>   "Coffee with Brian Kernighan".

Sounds reasonable.  I have been learning Python bit by bit simply
because there seems to be no other way to talk to university people.
But somehow I am so in love with Lisp that it makes me sort of blind
because sometimes I feel more productive in Python simply because I'm
always using it.  When I can write Lisp, I do it, but often I feel like
I'm a role-playing TCP Slow Start or something like that.
-- 
https://mail.python.org/mailman/listinfo/python-list


on GNU EMACS's python-mode, loading entire buffer

2022-08-29 Thread Meredith Montgomery
Perhaps this isn't the right newsgroup, but I kinda feel I will find
more GNU EMACS users running the native python-mode here than in GNU
EMACS newsgroups.  Not every GNU EMACS user cares about Python.
(Right?)

A sort of a complaint is that when I used to run GNU EMACS 24.3.1, I'd
open a file.py and simply say C-c C-c and it would ask me if I wanted a
dedicated process, load a REPL load my entire buffer.

Now in 27.1, things are different.  I say C-c C-c and it tells me to
start the process with C-c C-p.  I mean --- is that the most polite
thing to do?  I feel like it's telling me --- go send this buffer
yourself!

I also don't know how to start a dedicated process.  (Sometimes I want
two REPLs.  You know, you can get never get enough.)

I would bet all of this and more is available, but I don't even know
which book to read.  Would you point me in the right direction?

I would also be interested in a command that restarts the REPL afresh
and reloads my buffer --- sort of like keyboard's [F5] of the IDLE.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can I do about this?

2022-08-29 Thread Mark Bourne

gene heskett wrote:

On 8/29/22 12:50, Mark Bourne wrote:

Roel Schroeven wrote:

Op 29/08/2022 om 2:55 schreef gene heskett:

On 8/28/22 19:39, Peter J. Holzer wrote:

On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This 
is me,

trying to make
pronterface, inside a venv: When the package manager version will 
only run

the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at 
all.
 From the package-managers install in 
/usr/share/doc/printrun-common/ I

copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt

You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it 
either.
I found a way to autostart it on reboots and octoprint seems happy 
with it
I agree with Peter: it doesn't look as if you are invoking the pip3 
in the venv. Just making the venv-directory the current directory 
doesn't activate it.


As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3

Does that show the pip3 installed in the venv? Or the system-wide 
one? If it's not the pip3 in the venv, well, then that's the problem 
(or at least part of the problem). Solution: first check whether the 
venv really contains 'pip3' (as opposed to eg. just 'pip'): list the 
contents of the bin subdirectory of the venv. If not, use 'pip' or 
whatever instead. Then to make sure you use the one in the venv, 
either activate the venv or explicitly specify the path when invoking 
pip/pip3 (and likewise for python/python3).


So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv


I think this first line should probably be:

$ source {path_to_venv}/bin/activate  # activate the venv

i.e. with `activate` rather than `pip3`?


$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

That got me to showstopper #2: (lengthy warniing)

(venv) gene@rock64:~/printrun/Printrun$ ./venv/bin/pip3 install -r 
requirements.txt
Ignoring pyobjc-framework-Cocoa: markers 'sys_platform == "darwin"' 
don't match your environment
Ignoring pyreadline: markers 'sys_platform == "win32"' don't match your 
environment
Requirement already satisfied: pyserial>=3.0 in 
./venv/lib/python3.10/site-packages (from -r requirements.txt (line 1)) 
(3.5)

Collecting wxPython==4.1.0
   Using cached wxPython-4.1.0.tar.gz (65.8 MB)
   Preparing metadata (setup.py) ... done
Collecting numpy>=1.8.2
   Using cached 
numpy-1.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 
MB)
Requirement already satisfied: pyglet>=1.1 in 
./venv/lib/python3.10/site-packages (from -r requirements.txt (line 4)) 
(1.5.26)

Collecting cffi
   Using cached 
cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 
(449 kB)

Collecting cairocffi
   Using cached cairocffi-1.3.0.tar.gz (88 kB)
   Preparing metadata (setup.py) ... done
Collecting cairosvg>=1.0.9
   Using cached CairoSVG-2.5.2-py3-none-any.whl (45 kB)
Collecting psutil>=2.1
   Using cached psutil-5.9.1-cp310-cp310-linux_aarch64.whl
Collecting lxml>=2.9.1
   Using cached 
lxml-4.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl 
(6.6 MB)

Collecting appdirs>=1.4.0
   Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting dbus-python>=1.2.0
   Using cached dbus-python-1.2.18.tar.gz (578 kB)
   Preparing metadata (setup.py) ... done
Collecting pillow
   Using cached Pillow-9.2.0-cp310-cp310-manylinux_2_28_aarch64.whl (3.1 
MB)

Collecting six
   Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycparser
   Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting cssselect2
   Using cached cssselect2-0.6.0-py3-none-any.whl (15 kB)
Collecting tinycss2
   Using cached tinycss2-1.1.1-py3-none-any.whl (21 kB)
Collecting defusedxml
   Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: webencodings in 
./venv/lib/python3.10/site-packages (from 
cssselect2->cairosvg>=1.0.9->-r requirements.txt (line 7)) (0.5.1)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is 
not installed.
Using legacy 'setup.py install' for cairocffi, since package 'wheel' is 
not installed.
Using legacy 'setup.py install' for dbus-python, since package 'wheel' 
is not installed.
Installing collected packages: dbus-python, appdirs, tinycss2, six, 
pycparser, psutil, pillow, numpy, lxml, defusedxml, wxPython, 
cssselect2, cffi, cairocffi, cairosvg

   Running setup.py install for dbus-python ... error
   error: subprocess-exited-with-error

   × Running setup.py install for dbus-python did not run successfully.
   │ exit code: 1
   ╰─> [166 lines of output]
   running in

Re: Coffee

2022-08-29 Thread Dan Stromberg
On Mon, Aug 29, 2022 at 1:10 PM Meredith Montgomery 
wrote:

> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
> > |Python's obviously a great tool for all kinds of programming things,
> > |and I would say if you're only gonna use one programming
> > |language in your live, Python will probably the right one.
> > Brian Kernighan
> >
> >   I transcribed this from the recent video
> >   "Coffee with Brian Kernighan".
>
> Sounds reasonable.  I have been learning Python bit by bit simply
> because there seems to be no other way to talk to university people.
> But somehow I am so in love with Lisp that it makes me sort of blind
> because sometimes I feel more productive in Python simply because I'm
> always using it.  When I can write Lisp, I do it, but often I feel like
> I'm a role-playing TCP Slow Start or something like that.
>

ISTR hearing that Python and Lisp are pretty similar semantically - not
because Python copied it, but because similar thinking went into the design
of each.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can I do about this?

2022-08-29 Thread gene heskett

On 8/29/22 15:12, Peter J. Holzer wrote:

On 2022-08-29 13:43:18 -0400, gene heskett wrote:

On 8/29/22 12:50, Mark Bourne wrote:

Roel Schroeven wrote:

$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt

That got me to showstopper #2: (lengthy warniing)


[...]

   checking for dbus-1 >= 1.8... no
   configure: error: Package requirements (dbus-1 >= 1.8) were not met:

   No package 'dbus-1' found

Since this message comes from configure, it is probably looking
for the development version of the dbus library here.

 apt search dbus-1

reveals (among other things):

 libdbus-1-dev/jammy 1.12.20-2ubuntu4 amd64
   simple interprocess messaging system (development headers)

(this is on Ubuntu, so the version number is probably different, but the
package name should be the same as on Debian.)

So you invoke

 apt install libdbus-1-dev

and try again. At which point you will probably discove another missing
library. Rinse and repeat.
You left out the wash, ;) The next missing dev was a gtk thingy, but 
search only returned
one .dev. One for spice-gtk, and that pulled in around 100 more 
packages, and now its stuck
on wxPython for about 35 minutes and, way into swap, like several 
hundred megs &
growing. I even went to its keyboard and shut down chromium to give it 
more play
room. Didn't seem to help though. But it hasn't errored, and swap is 
going  down a
meg here and there. Pounding that poor, cheap sd card all to hell I 
expect. At some point,
I'll unpack a startech usb3-sata cable and try an SSD. But I'll not 
disturb this just yet.


Works well on an r-pi4b where I can build linuxcnc in half an hour from 
the git pull. I
run a 3/4 ton, 80 yo Sheldon lathe with linuxcnc just to see if I could 
do it, first on an rpi3b.
Had to build my own realtime kernel and figure out how to install it 
because I wanted to
do it on a pi, got black holed on their forum. The amazing part is that 
the tarball to install

it is only 28 megs uncompressed.

Ideally the README should mention such dependencies, but since the exact
names of the packages depend on the distribution, it will often be vague
unless you happen to use the same distribution as the developer.
Your forgot to mention that each packager is working in his own sound 
proof booth, so
each comes up with a somewhat different way to pound that square peg 
into a 7 point hole.

;o)>

It was obviously going to take hours so I took a nap and 4 hours later 
it had left out a
few things but kept on going until it hit another showstopper while 
building wxPython-4.1.

At which point it spit out 2600 some lines of backtrace.

Ending with this:
 In file included from 
../../../../sip/cpp/sip_glcanvaswxGLContext.cpp:10:
  ../../../../sip/cpp/sipAPI_glcanvas.h:865:198: error: 
‘wxGLCanvasName’ was not declared in this scope; did you mean ‘wxGLCanvas’?
    865 | wxGLCanvas(wxWindow *parent, const wxGLAttributes 
&dispAttrs, wxWindowID id=wxID_ANY, const wxPoint 
&pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, 
const wxString &name=wxGLCanvasName, const wxPalette &palette=wxNullPalette)

| ^~
| wxGLCanvas

  Waf: Leaving directory 
`/tmp/pip-install-1myz6noi/wxpython_5fdcad39f0c544599dd49fdd522391f2/build/waf/3.1/gtk3'

  Build failed
   -> task in '_glcanvas' failed with exit status 1 (run with -v to 
display more information)
   -> task in '_glcanvas' failed with exit status 1 (run with -v to 
display more information)
   -> task in '_glcanvas' failed with exit status 1 (run with -v to 
display more information)
   -> task in '_glcanvas' failed with exit status 1 (run with -v to 
display more information)
  Command '"/home/gene/printrun/Printrun/venv/bin/python3" 
/tmp/pip-install-1myz6noi/wxpython_5fdcad39f0c544599dd49fdd522391f2/bin/waf-2.0.19 
--wx_config=/tmp/pip-install-1myz6noi/wxpython_5fdcad39f0c544599dd49fdd522391f2/build/wxbld/gtk3/wx-config 
--gtk3 --python="/home/gene/printrun/Printrun/venv/bin/python3" 
--out=build/waf/3.1/gtk3 configure build ' failed with exit code 1.

  Finished command: build_py (100m40.712s)
  Finished command: build (171m37.482s)
  Command '"/home/gene/printrun/Printrun/venv/bin/python3" -u 
build.py build' failed with exit code 1.

  [end of output]

  note: This error originates from a subprocess, and is likely not a 
problem with pip.

error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wxPython

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Now, I have the unpacked tarball of wxPython-4.2.0 sitting in 
/home/gene/src.


Where would I mv it to to substituted for the 4.1 since 4.1 isn't quite 
ready for prime time?


I changed the 1 to a 2 in requirements.txt, but that exited in a few 
seconds after it
downloaded another copy of the

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Jach Feng
Mark Bourne 在 2022年8月29日 星期一下午6:40:59 [UTC+8] 的信中寫道:
> Jach Feng wrote: 
> > Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道: 
> >> On Mon, 29 Aug 2022 at 15:54, Jach Feng  wrote: 
> >>> 
> >>> Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: 
>  On 8/27/22 7:42 AM, Mark Bourne wrote: 
> > Jach Feng wrote: 
> >> I have two files: test.py and test2.py 
> >> --test.py-- 
> >> x = 2 
> >> def foo(): 
> >> print(x) 
> >> foo() 
> >> 
> >> x = 3 
> >> foo() 
> >> 
> >> --test2.py-- 
> >> from test import * 
> >> x = 4 
> >> foo() 
> >> 
> >> - 
> >> Run test.py under Winows8.1, I get the expected result: 
> >> e:\MyDocument>py test.py 
> >> 2 
> >> 3 
> >> 
> >> But when run test2.py, the result is not my expected 2,3,4:-( 
> >> e:\MyDocument>py test2.py 
> >> 2 
> >> 3 
> >> 3 
> >> 
> >> What to do? 
> > 
> > `from test import *` does not link the names in `test2` to those in 
> > `test`. It just binds objects bound to names in `test` to the same 
> > names in `test2`. A bit like doing: 
> > 
> > import test 
> > x = test.x 
> > foo = test.foo 
> > del test 
> > 
> > Subsequently assigning a different object to `x` in one module does 
> > not affect the object assigned to `x` in the other module. So `x = 4` 
> > in `test2.py` does not affect the object assigned to `x` in `test.py` 
> > - that's still `3`. If you want to do that, you need to import `test` 
> > and assign to `test.x`, for example: 
> > 
> > import test 
> > test.x = 4 
> > test.foo() 
> > 
>  Yes, fundamental issue is that the statement 
>  
>  from x import y 
>  
>  makes a binding in this module to the object CURRECTLY bound to x.y to 
>  the name y, but if x.y gets rebound, this module does not track the 
>  changes. 
>  
>  You can mutate the object x.y and see the changes, but not rebind it. 
>  
>  If you need to see rebindings, you can't use the "from x import y" form, 
>  or at a minimum do it as: 
>  
>  
>  import x 
>  
>  from x import y 
>  
>  then later to get rebindings to x.y do a 
>  
>  y = x.y 
>  
>  to rebind to the current x.y object. 
>  
>  -- 
>  Richard Damon 
> >>> Yes, an extra "import x" will solve my problem too! Sometimes I am 
> >>> wondering why "from x import y" hides x? hum...can't figure out the 
> >>> reason:-) 
> >>> 
> >> "from x import y" doesn't hide x - it just grabs y. Python does what 
> >> you tell it to. :) 
> >> 
> >> ChrisA 
> > But I had heard people say that "from x import y" did import the whole x 
> > module into memory, just as "import x" did, not "grabs y" only. Is this 
> > correct?
> `from x import y` does import the whole module x into memory, and adds 
> it to `sys.modules`. But it only binds the name `y` in the namespace of 
> module doing the import (and it binds it to the value of `x.y` at the 
> time the import is done - it doesn't magically keep them in sync if one 
> or the other is later reassigned). 
> 
> The point about the whole module being imported is that you don't save 
> any memory by using `from x import y` to avoid importing some very large 
> object `z` from `x`. Those other large objects might be needed by 
> functions which have been imported (e.g. your `foo` function still needs 
> `x` even if you haven't imported `x` - so it still needs to be loaded 
> into memory) or might be imported and used by other modules importing 
> `x`, so they still have to be loaded when any part of `x` is imported - 
> they just don't have to be bound to names in the importing module's 
> namespace. 
> 
> As Richard mentioned, if `x.y` is a mutable object (such as a list) you 
> can still mutate that object (e.g. add/remove items) and those changes 
> will be seen in both modules. That's because both are still bound to 
> the same object and you're mutating that existing object. If you assign 
> a new list to either, that won't be seen by the other. 
> 
> -- 
> Mark.
When using dot notation to change variable, no matter if 'x.y' is a mutable or 
immutable object, the change
will be seen in both modules except those early bindings.

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


venv questions

2022-08-29 Thread gene heskett

Greetings all;

The command to setup a venv, "python -m venv venv" has no man page that 
I have

found.

So I'm guessing that one of the venv's is the name of the one being 
created. Probably

argv(3) in c parlance.

What I am thinking about is setting up two venv's more or less named for 
the printer

that copy of octoprint will administer,

So how about some tutorial on creating the venv?

But that might create another problem. how to differentiate the servers, 
both of which
will want to use localhost:5000 to serve up their web pages we run 
things with.


Suggested solutions?

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
 -Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must
first make the law respectable. - Louis D. Brandeis
Genes Web page 
--
https://mail.python.org/mailman/listinfo/python-list


Re: venv questions

2022-08-29 Thread Chris Angelico
On Tue, 30 Aug 2022 at 12:59, gene heskett  wrote:
>
> Greetings all;
>
> The command to setup a venv, "python -m venv venv" has no man page that
> I have
> found.
>

$ python3 -m venv --help
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
[--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]
ENV_DIR [ENV_DIR ...]

Creates virtual Python environments in one or more target directories.

positional arguments:
  ENV_DIR   A directory to create the environment in.

(chomp all the explanation of options)

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


Running two separate servers (was Re: venv questions)

2022-08-29 Thread Chris Angelico
On Tue, 30 Aug 2022 at 12:59, gene heskett  wrote:
>
> But that might create another problem. how to differentiate the servers,
> both of which
> will want to use localhost:5000 to serve up their web pages we run
> things with.
>
> Suggested solutions?

This is nothing to do with venvs, so I'm forking the thread.

By far the easiest way to differentiate them is to NOT have them both
on localhost:5000. Depending on how you invoke the servers, you should
be able to find a way to configure one (or both) of them to a
different port; common methods include a "--port" argument, setting
the PORT environment variable, and poking in the code to find the
number 5000 and changing it to some other value.

(Less common methods include poking in ctypes to find the number 5000
and changing it to some other value. Mentioned only because I realise
the alternative interpretation of my previous comment.)

Another method would be to change the "localhost" part. The standard
for IP addresses is that 127.x.y.z means localhost, regardless of what
x, y, and z are; so you could have one of them bind to 127.0.0.2 and
the other to 127.0.0.3, which you could then use in your browser the
same way (http://127.0.0.2:5000/ and http://127.0.0.3:5000/
respectively).

But if you can't change anything else, you'll have to make the two
processes cooperate in some way, or worst case, just make sure you
shut one down before you start the other up.

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


Re: on GNU EMACS's python-mode, loading entire buffer

2022-08-29 Thread Meredith Montgomery
Paul Rubin  writes:

> Meredith Montgomery  writes:
>> Now in 27.1, things are different.  I say C-c C-c and it tells me to
>> start the process with C-c C-p.  I mean --- is that the most polite
>> thing to do?  I feel like it's telling me --- go send this buffer
>> yourself!
>
> Hmm, I noticed that too, but I thought it was a change in python-mode
> itself.  I just got used to it.  I didn't bother trying to chase it down.

These little conveniences are so important. :-)

> To start a new process, try C-u C-c C-p .

Oh, thank you!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread dn
On 30/08/2022 06.45, Peter J. Holzer wrote:

> The module is imported but it isn't bound to any name in the current
> (global) namespace (obviously there must be some variable bound to it, but
> that's probably a local variable in the importer and it isn't called
> `x`). Then the object bound to the name `y` in the loaed module is bound
> to the name `y` in the current namespace.


Correct!

Build module.py as:
***
CONSTANT = 1

def func():
pass
***

then in the terminal:
***
Python 3.9.13 (main, May 18 2022, 00:00:00)
[GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from module import func as f
>>> locals()
{'__name__': '__main__', '__doc__': None, '__package__': None,
'__loader__': , '__spec__':
None, '__annotations__': {}, '__builtins__': , 'f': }
>>> f

>>> f.CONSTANT
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'function' object has no attribute 'CONSTANT'
>>> module.CONSTANT
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'module' is not defined

# no mention of module and no access to CONSTANT

>>> import module as m
>>> locals()
{'__name__': '__main__', '__doc__': None, '__package__': None,
'__loader__': , '__spec__':
None, '__annotations__': {}, '__builtins__': , 'f': , 'm': }
>>> m

>>> m.func

>>> m.CONSTANT
1
>>> module
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'module' is not defined

# name module is bound as m, and not available as module

>>> import module
>>> locals()
{'__name__': '__main__', '__doc__': None, '__package__': None,
'__loader__': , '__spec__':
None, '__annotations__': {}, '__builtins__': , 'f': , 'm': , 'module':
}
>>> module.func

>>> module.CONSTANT
1
>>> module


# now it is available
# also notice how the function (func) now has three
'names'/access-methods but all lead to the same location
***

-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list