Re: ModuleNotFoundError: No module named 'Paramiko'

2024-04-08 Thread Keith Thompson via Python-list
Thomas Passin  writes:
> On 4/8/2024 2:01 PM, Dietmar Schwertberger via Python-list wrote:
>> To be sure, you can always go the the directory of the Python
>> interpreter and open a cmd window there.
>> (By entering 'cmd' into the explorer address bar.)
>> Then enter 'python.exe -mpip install paramiko'.
>> This way you can be sure that you're not running a pip.exe that
>> belongs to another Python interpreter.
>
> This is not quite right. The best name of the Python executable may or
> may not be "python.exe".  The command line needs a space after the
> "-m":

No, the option and its argument can be bundled.  "-mpip" is equivalent
to "-m pip".  (The space might make it clearer for human readers.)

[...]

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: bring back nntp library to python3

2024-08-14 Thread Keith Thompson via Python-list
"test"  writes:
> why is the nntp library deprecated in recent python versions? they
> clearly lost touch

nntplib is not vanishing into thin air.  It's just not going to be part
of a default Python installation.  (It's not there in Python 3.13.0rc1.)

In my opinion the use of the word "deprecated" is misleading.

$ python3
Python 3.12.4 (main, Jun 27 2024, 13:53:59) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nntplib
:1: DeprecationWarning: 'nntplib' is deprecated and slated for removal 
in Python 3.13
>>>
$ 



The rationale for removing nntplib and other modules from the default
installation is explained in PEP 0594 .

"""
Back in the early days of Python, the interpreter came with a large
set of useful modules. This was often referred to as “batteries
included” philosophy and was one of the cornerstones to Python’s success
story. Users didn’t have to figure out how to download and install
separate packages in order to write a simple web server or parse email.

Times have changed. With the introduction of PyPI (née Cheeseshop),
setuptools, and later pip, it became simple and straightforward to
download and install packages. Nowadays Python has a rich and vibrant
ecosystem of third-party packages. It’s pretty much standard to either
install packages from PyPI or use one of the many Python or Linux
distributions.

[...]

The nntplib module implements the client side of the Network News
Transfer Protocol (nntp). News groups used to be a dominant platform for
online discussions. Over the last two decades, news has been slowly but
steadily replaced with mailing lists and web-based discussion
platforms. Twisted is also planning to deprecate NNTP support and pynntp
hasn’t seen any activity since 2014. This is a good indicator that the
public interest in NNTP support is declining.

The nntplib tests have been the cause of additional work in the recent
past. Python only contains the client side of NNTP, so the tests connect
to external news servers. The servers are sometimes unavailable, too
slow, or do not work correctly over IPv6. The situation causes flaky
test runs on buildbots.
"""

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: new here

2024-08-25 Thread Keith Thompson via Python-list
Lawrence D'Oliveiro  writes:
> On 23 Aug 2024 03:43:15 GMT, rbowman wrote:
>> I am confused by the cross-over to Python-list. I only read/post to
>> comp.lang.python. Is that echoed to Python-list or vice versa?
>
> This has been happening, without asking our permission, for years.

The comp.lang.python newsgroup and the Python-list mailing list
are bidirectionally gatewayed.  Both are public.  Why is that a
problem for you?  Whose permission do you think is needed?

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

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ListAdmin: Is list/archive working correctly?

2024-08-31 Thread Keith Thompson via Python-list
Ethan Furman  writes:
> On 8/30/24 15:28, dn via Python-list wrote:
>> The OP was @Gilmeh Serda (from an invalid email address). That appears in 
>> the email thread
>>
>> @Stefan Ram has had two contributions quoted, but no such original-message 
>> has appeared in the thread.
>
> I can't speak about the archives, but I can say that Stefan's posts
> are discarded automatically since they are opposed to their words
> showing up on the list.

I'm posting this on the comp.lang.python Usenet newsgroup.

Stefan Ram's posts to comp.lang.python include several header lines,
including "X-No-Archive: Yes".  I presume the software that copies
comp.lang.python posts to python-list pays attention to some of those
header lines.  (I personally think it's silly to impose this kind of
restriction.  The Usenet group and the mailing list are both public.)

Lawrence D'Oliveiro adds the string "(Posting On Python-List
Prohibited)" to the subject on his articles, for reasons he has
declined to discuss.  I don't know whether the software recognizes
that.

Can someone who manages the list software discuss the exact
rules?  I suggest that those rules should be documented on
.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Process.start

2024-09-03 Thread Keith Thompson via Python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> marc nicole  wrote or quoted:
>>Thanks for the reply, Here's the code I tested for the debug:
>>print("executed")
>>but neither "Hello World" or "Executed" are displayed in the console which
>
>   It shouldn't spit out "Executed" 'cause there's a lowercase
>   "e" in the mix. Talk about sweating the small stuff! 
>
>   That 'if __name__ == "__main__"' jazz? It's barking up the wrong
>   tree here, just muddying the waters. I'd 86 that clause for now.
>
>   In your start() function call, you're rockin' "do_something()",
>   but the actual function's defined as "do_Something()" with a
>   capital "S". Python's all about that case sensitivity.
>
>   Dropping that "exit(0)" bomb right after firing up the process?
>   That's like bailing on a gnarly wave before you even catch it.
>   It might pull the plug on the main process before the kid process
>   has a chance to strut its stuff.
>
>   Those "ghello" and "fhello" functions? They're just chillin'
>   there, not pulling their weight!
[...]

Stefan, you've recently started using a lot of slang in your posts.
I suggest that this is counterproductive.  For me, it makes your
posts more difficult to read.  I can imagine that it would be even
more difficult for readers whose first language is not English.

You also indent your own new text, which is exactly the opposite of
common Usenet conventions.  (You've been doing this for a long time.)

Please consider prioritizing your readers' convenience over whatever
benefit you derive from your unconventional posting style.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bug in 3.12.5

2024-09-20 Thread Keith Thompson via Python-list
Martin Nilsson  writes:
> The attached program doesn’t work in 3.12.5, but in 3.9 it worked.

Attachments don't show up either on the mailing list or the newsgroup.

Try again with the program inline in your post (if it's not too long).

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-01 Thread Keith Thompson via Python-list
2qdxy4rzwzuui...@potatochowder.com writes:
[...]
> In Common Lisp, you can write integers as #nnR[digits], where nn is the
> decimal representation of the base (possibly without a leading zero),
> the # and the R are literal characters, and the digits are written in
> the intended base.  So the input #16f is read as the integer 65535.

Typo: You meant #16R, not #16f.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RE Version of OpenSSl ?

2025-02-09 Thread Keith Thompson via Python-list
vincent.vandevy...@oqapy.eu writes:
>> In case this helps you find the correct package to install:
>> 
>> $ python3 -c "if True:
>> > import ssl
>> > print('Ok.')
>> > "
>> Ok.
>> 
>> $ cat /etc/lsb-release
>> DISTRIB_ID=Ubuntu
>> DISTRIB_RELEASE=24.04
>> DISTRIB_CODENAME=noble
>> DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
>> 
>> $ apt list --installed | grep ssl
>> 
>> WARNING: apt does not have a stable CLI interface. Use with caution in
>> scripts.
>> 
>> libssl-dev/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
>> [installed]
>> libssl3t64/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
>> [installed,automatic]
>> libxmlsec1t64-openssl/noble,now 1.2.39-5build2 amd64 [installed,automatic]
>> openssl/noble-updates,noble-security,now 3.0.13-0ubuntu3.4 amd64
>> [installed,automatic]
>> ssl-cert/noble,noble,now 1.1.2ubuntu1 all [installed,automatic]
>
> Thanks Jason, I have near the same result of you.
> I need to explain the context.
> I'm on a new machine with a fresh install of Ubuntu 24.04 wich embed Python 
> 3.12.3, no problem with that.
>
> As I'm maintainer of some Python modules published on PyPI, I've the
> habit of testing my modules in different virtual environments. For now
> Python 3.11, 3.12 and 3.13.
>
> So, I've maybe found a solution:
>
> I've create in my home a dir named /opt, download into it the latest version 
> of openssl-1.1.1 and uncompress it.(*)
> -
> $ cd opt/openssl-1.1.1w
> $ ./config && make && make test
> $ mkdir $HOME/opt/lib
> $ mv $HOME/opt/openssl-1.1.1w/libcrypto.so.1.1 $HOME/opt/lib/
> $ mv $HOME/opt/openssl-1.1.1w/libssl.so.1.1 $HOME/opt/lib/
> $ export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH
> --
> And rerun the compilation of 3.12.9 without problem with openssl.
>
> (*) https://openssl-library.org/source/old/1.1.1/index.html

OpenSSL 1.1.1 is pretty old, released in 2018 if I'm not mistaken.

An environment on Ubuntu 24.04 with OpenSSL 1.1.1 libraries is a bit
unusual.  If your goal is to ensure that you can build Python with the
oldest OpenSSL it claims to support, what you're doing makes sense.  But
if you have libssl-dev already installed and your Python build complains
"Python requires a OpenSSL 1.1.1 or newer", then something weird is
going on, and it's probably worth tracking it down.  The best solution
*should* be to install the current libssl-dev package from the package
manager, not to build an old version of OpenSSL from source.

I've built Python-3.12.9 from source on Ubuntu-22.04 with no problems
(I have libssl-dev installed).

To be clear, what is the output of "dpkg -l libssl-dev" on your Ubuntu
24.04 system?  If you get something similar to this:

```
$ dpkg -l libssl-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name VersionArchitecture Description
+++--==--
ii  libssl-dev:amd64 3.3.1-2ubuntu2 amd64Secure Sockets Layer toolkit - 
development files
```

then I don't understand why you'd get the "Python requires a OpenSSL
1.1.1 or newer" message.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tools to help with text mode (i.e. non-GUI) input

2025-01-17 Thread Keith Thompson via Python-list
Alan Gauld  writes:
> On 15/01/2025 00:41, Keith Thompson via Python-list wrote:
>> Alan Gauld  writes:
>>> On 11/01/2025 14:28, Chris Green via Python-list wrote:
>>>> I'm looking for Python packages that can help with text mode input,
>>>
>>> The standard package for this is curses which comes as part
>>> of the standard library on *nix distros.
>> 
>> The thing about curses (which may or may not be a problem) is that, by
>> design, it takes over the whole screen.  If you want to do simpler text
>> manipulations (showing a dismissible message, showing bold text, etc.)
>> without interfering with existing text, curses can't do it, at least not
>> easily.
>
> It's not that difficult to use the terminfo codes directly. But
> that won't give access to things like lists of default values, mouse
> control etc that the OP wanted. But for simple text characteristics
> and moving the cursor around terminfo works ok even if a bit tedious.
>
> Here is "hello world" in bold...
>
> import curses
> curses.setupterm()
> bold = curses.tigetstr('bold').decode('ascii')
> normal = curses.tigetstr('sgr0').decode('ascii')
>
> print(bold, 'Hello world', normal)

Cool -- but I think you want:

print(bold, 'Hello world', normal, sep='')

> Whilst you can position the cursor etc it very quickly
> becomes easier to just use full blown curses.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tools to help with text mode (i.e. non-GUI) input

2025-01-17 Thread Keith Thompson via Python-list
Alan Gauld  writes:
> On 11/01/2025 14:28, Chris Green via Python-list wrote:
>> I'm looking for Python packages that can help with text mode input,
>
> The standard package for this is curses which comes as part
> of the standard library on *nix distros.

The thing about curses (which may or may not be a problem) is that, by
design, it takes over the whole screen.  If you want to do simpler text
manipulations (showing a dismissible message, showing bold text, etc.)
without interfering with existing text, curses can't do it, at least not
easily.

If your terminal supports it, your current screen contents can be
restored after the application finishes (curses enables the "alternate
screen" and then restores the primary screen on exit).

There don't seem to be a lot of good solutions for doing curses-like
text manipulation without taking over the entire screen.

[...]

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Version of OpenSSl ?

2025-02-09 Thread Keith Thompson via Python-list
vincent.vandevy...@oqapy.eu writes:
> Hi,
>
> Trying to compile Python-3.12.9 on Ubuntu-24.04
>
> The compilation is complete without errors but I have this message:
> 
> The necessary bits to build these optional modules were not found:
> _hashlib  _ssl  nis
> To find the necessary bits, look in configure.ac and config.log.
>
> Could not build the ssl module!
> Python requires a OpenSSL 1.1.1 or newer
> 
>
> But I have a more newer version:
>
> ---
> $ openssl version
> OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
> ---

You have the openssl command, but do you have the openssl development
libraries?

For Ubuntu, you need to install the libssl-dev package.
`dpkg -l libssl-dev` will tell you whether you have it.
If you don't, `sudo apt-get install libssl-dev` will install it.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Building CPython from source, stripping executable

2025-02-11 Thread Keith Thompson via Python-list
I'm building CPython 3.14.0a5 from source on Ubuntu 22.04.5.

Is there some way to specify that the python3.14 executable should
be stripped?  (Stripping reduces the size of the executable from
33M to 5.8M.)

Of course I can run "strip" manually after installing, but I'm
looking for a way to do it as part of the build.

For a lot of software packages, invoking "make install-strip"
rather than "make install" does this, but CPython's generated
Makefile doesn't include this target.

Diving into the Makefile, I see this:

# Option to install to strip binaries
STRIPFLAG=-s

but STRIPFLAG is used only if PYTHONFRAMEWORKDIR is set, which
seems to be Mac-specific.

The Makefile also has:

INSTALL=/usr/bin/install -c

(The "-c" option is ignored by the GNU Coreutils install command.)
I tried setting INSTALL to "install -s", and the installation
failed because it tried to strip Python scripts as well as the
python3.14 executable:

install -s -m 644 ./Tools/gdb/libpython.py python-gdb.py
strip: python-gdb.py: file format not recognized
install: strip process terminated abnormally
make: *** [Makefile:1117: python-gdb.py] Error 1

Is there a straightforward way to strip executables during installation?

If not, I'll run "strip" manually for now and submit an issue on
 suggesting adding an
"install-strip" target to the Makefile.

I don't think this is a new issue in 3.14.0a5; that's just where
I happened to run into it.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pip installs to unexpected place

2025-04-15 Thread Keith Thompson via Python-list
rbowman  writes:
> On Mon, 14 Apr 2025 09:55:09 -0400, Thomas Passin wrote:
>> Pip doesn't know about the environment it runs in. It seems to me that
>> you didn't active the venv before you installed using pip. So nothing
>> would have gotten installed into the venv. So where is the venv that you
>> set up? I usually put them into ~/venv. For example, a venv named "gf4"
>> is at ~/venv/gf4.
>
> Are you sure about that?

Sure about what?

>  activate has
>
>
> VIRTUAL_ENV="/home/rbowman/work/python/weather"
> export VIRTUAL_ENV
[...]

The activate script is created when you create the venv (using something
like `python3 -m venv /path/to/new/venv`), and it's customized with the
location of the venv.

If Thomas creates a venv in ~/venv/gf4, that's what will appear in his
venv's active script (with the ~ expanded to the path of his home
directory).

(I'm relatively new at this.  Please let me know if I've gotten any of
the details wrong.)

[...]

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pip installs to unexpected place

2025-04-14 Thread Keith Thompson via Python-list
Thomas Passin  writes:
[...]
> To activate a venv, you have to source its activate script, which is
> in the venv. First you have to mark it as executable.  Then you source
> it -
>
> source ~/venv/gf4/bin/activate
[...]

No, you don't have to (and probably shouldn't) mark the script as
executable.

Making a script executable (chmod +x) is required before *executing* it,
but when you *source* a script (using "source" or "."), your current
shell reads it and evaluates its content.

Making the active script executable introdues the risk that you'll
accidentally execute it rather than sourcing it.  If you do that, it
will probably set up the environment in a new shell process which then
immediately terminates.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: backslash in triple quoted string

2025-05-12 Thread Keith Thompson via Python-list
Left Right  writes:
> Then it just means that the grammar lies. The two claims are mutually
> exclusive, so either one is a lie or the other or both.
[...]

A couple of points.

First, the convention in this and most other Usenet newsgroups
is to write new text *below* any quoted text.  This is known as
"bottom-posting".  The alternative, "top-posting" is common in
email in some environments, but tends to cause confusion on Usenet.
It's also a good idea to trim any quoted text that's not relevant to
your followup.  See most of the other followups in this newsgroup,
including this one, for examples.  Even if you happen to prefer
top-posting, I suggest trying to follow the existing conventions
observed by the vast majority of participants here.

Second, the word "lie" is far more harsh than what I presume
you meant to say.  For me, and I think for most people, the word
"lie" implies a deliberate intent to deceive.  I don't think you
actually believe that the authors of the documentation you're
complaining about deliberately inserted false information with the
goal of deceiving readers.  If you want to say that the grammar
is incorrect, or contains an error, that's something that can be
discussed reasonably.  If you say that it "lies", you're making a
claim of malice and making assumptions about someone else's state
of mind with no real basis.  Perhaps that's not what the word "lie"
means to you, but I suggest that it explains the harsh reaction to
your initial statement.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: backslash in triple quoted string

2025-05-12 Thread Keith Thompson via Python-list
Left Right  writes:
>> Second, the word "lie" is far more harsh than what I presume
>> you meant to say.  For me, and I think for most people, the word
>> "lie" implies a deliberate intent to deceive.
>
> No, it doesn't. Consider Joseph Conrand's Heart of Darkness,

No, thank you.

I am trying to help you to understand how people are reacting to
your posts.  I suggested that saying that the grammar is incorrect
or contains an error would have expressed exactly what you intended
without triggering hostile reactions, which I'm assuming you
don't want.

[...]
> English literature lessons aside, even if you believe what you believe
> about the meaning of the word, you could at least try to find the
> irony, that was the larger goal, than to immediately presume you are
> being attacked, and start retaliating instead of looking into the
> problem.

I'm not aware that I have been attacked or that I have retaliated.
(No need to explain why you might think I have.)

One more thing: your Usenet or email client probably adds an
attribution line above any quoted text.  I urge you to leave it
in place.  It makes the discussion easier to follow, especially for
those of us who read the comp.lang.python Usenet newsgroup rather
than the mailing list.

I do not intend to reply further.

-- 
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
-- 
https://mail.python.org/mailman/listinfo/python-list