Re: Correct module for site customization of path

2024-11-01 Thread Tim Johnson via Python-list
On 11/1/24 08:32, dieter.mau...@online.de wrote: ... After the recent upgrades I had to install youtube_dl with pipx for the new python version. When I ran the script which imported youtube_dl, I got an import error as it appears the path to the module was not in sys.path I see at several

Re: Correct module for site customization of path

2024-11-01 Thread Dieter Maurer via Python-list
> ... >After the recent upgrades I had to install youtube_dl with pipx for the >new python version. >When I ran the script which imported youtube_dl, I got an import error >as it appears the path to the module >was not in sys.path I see at several options: * install `

Correct module for site customization of path

2024-10-31 Thread Tim Johnson via Python-list
I ran the script which imported youtube_dl, I got an import error as it appears the path to the module was not in sys.path. For me,  it was a simple matter of appending the path for youtube_dl to sys.path, however, I would prefer to not have to do an append at every script using it. There is a

Changing path to python in pip.exe, ipython.exe, etc

2024-04-25 Thread Olivier B. via Python-list
I am building a python work environment where - i build python from sources - install pip with the wheel bundled with python - then install things with pip, like Jupyter That environment is then deployed on various machines, at various installation folders. One issue I encounter, is the path

Re: path to python in venv

2023-09-27 Thread Thomas Passin via Python-list
reating symbolic links and that is all done for you. The thing you need to appreciate is that when you create a venv with a command like this: -m venv path/to/venv this will all link back to whatever version of Python you used in place of . If you invoked it with python3, on Linux you will

Re: path to python in venv

2023-09-27 Thread Peter J. Holzer via Python-list
On 2023-09-27 20:32:25 -, Jon Ribbens via Python-list wrote: > On 2023-09-27, Larry Martell wrote: > > On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via > > Python-list wrote: > >> On 2023-09-27, Larry Martell wrote: > >> > lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> >

Re: path to python in venv

2023-09-27 Thread dn via Python-list
On 28/09/2023 09.32, Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But

Re: path to python in venv

2023-09-27 Thread Jon Ribbens via Python-list
On 2023-09-27, Larry Martell wrote: > On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list > wrote: >> On 2023-09-27, Larry Martell wrote: >> > I was under the impression that in a venv the python used would be in >> > the venv's bin dir. But in my venvs I see this in the bin dirs: >> > >

Re: path to python in venv

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 13:46, Larry Martell via Python-list wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin dirs:

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
thon-list > Sent: 27 сентября 2023 г. 22:48 > To: Jon Ribbens > Cc: python-list@python.org > Subject: Re: path to python in venv > > > > On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list > > wrote: > > > > > > On 2023-09-27, Larry Ma

RE: path to python in venv

2023-09-27 Thread Niktar Lirik via Python-list
Hi Larry, You could just create venv with option '—copies' For example: python -m venv -–copies .venv From: Larry Martell via Python-list Sent: 27 сентября 2023 г. 22:48 To: Jon Ribbens Cc: python-list@python.org Subject: Re: path to python in venv On Wed, Sep 27, 2023 at 12:42 PM J

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: > > On 2023-09-27, Larry Martell wrote: > > I was under the impression that in a venv the python used would be in > > the venv's bin dir. But in my venvs I see this in the bin dirs: > > > > lrwxrwxrwx 1 larrymartell larrymartell

Re: path to python in venv

2023-09-27 Thread Jon Ribbens via Python-list
On 2023-09-27, Larry Martell wrote: > I was under the impression that in a venv the python used would be in > the venv's bin dir. But in my venvs I see this in the bin dirs: > > lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> python3 > lrwxrwxrwx 1 larrymartell larrymartell 16

path to python in venv

2023-09-27 Thread Larry Martell via Python-list
I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin dirs: lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> python3 lrwxrwxrwx 1 larrymartell larrymartell 16 Sep 27 11:21 python3 -> /usr/bin/python3 Goo

Re: File system path annotations

2023-06-19 Thread Thomas Passin via Python-list
will slowly gravitate to path objects only. I read a lot on Python and, frankly, I don't see this happening. People on the Internet keep using /str/ as their path representation choice. Presumably, programmers don't feel the need to bother with a complex solution if the simplest opti

Re: File system path annotations

2023-06-19 Thread Roel Schroeven via Python-list
Op 19/06/2023 om 11:44 schreef Peter Slížik: Thank you, Roel. You've answered all my questions. > [PEP 519]: ...as that can be represented with typing.Union[str, bytes, os.PathLike] easily enough and the hope is users > will slowly gravitate to path objects only. I read a lot on

Re: File system path annotations

2023-06-19 Thread Peter Slížik via Python-list
Thank you, Roel. You've answered all my questions. > [PEP 519]: ...as that can be represented with typing.Union[str, bytes, os.PathLike] easily enough and the hope is users > will slowly gravitate to path objects only. I read a lot on Python and, frankly, I don't see this happ

Re: File system path annotations

2023-06-19 Thread Roel Schroeven via Python-list
ration to providing a generic typing.PathLike class which would allow for e.g. typing.PathLike[str] to specify a type hint for a path object which returned a string representation. > While potentially beneficial, the usefulness was deemed too small to bother adding the type hint class. > &g

File system path annotations

2023-06-19 Thread Peter Slížik via Python-list
Hello, what is the preferred way of annotating file system paths? This StackOverflow answer (and a few others) recommend using the str | os.PathLike union. However, byte arrays can be used as paths too, and including them would make the annotation

Re: Does os.path relpath produce an incorrect relative path?

2023-05-27 Thread BlindAnagram
On 26/05/2023 16:42, Eryk Sun wrote: On 5/26/23, cactus wrote: Surprisingly (for me at least) the alternative provided by the pathlib module 'relative_to' method doesn't provide for full relative path computation. I was expecting this would offer everything that os.path offers

Re: Does os.path relpath produce an incorrect relative path?

2023-05-26 Thread Eryk Sun
On 5/26/23, cactus wrote: > > Surprisingly (for me at least) the alternative provided by the pathlib > module 'relative_to' method doesn't provide for full relative path > computation. I was expecting this would offer everything that os.path > offers but it doesn&

Re: Does os.path relpath produce an incorrect relative path?

2023-05-26 Thread cactus
el_path = '..\\..\\..\\lib\\src' > >> > >> [snip] > >> > >> The first of these three results produces an incorrect relative path > >> because relpath does not strip off any non-directory tails before > >> comparing paths. > &g

Re: Does os.path relpath produce an incorrect relative path?

2023-05-25 Thread MRAB
On 2023-05-25 16:53, Eryk Sun wrote: On 5/25/23, BlindAnagram wrote: vcx_path = 'C:\\build.vs22\\lib\\lib.vcxproj' src_path = 'C:\\lib\\src\\' rel_path = '..\\..\\..\\lib\\src' [snip] The first of these three results produces an incorrect relative path because

Re: Does os.path relpath produce an incorrect relative path?

2023-05-25 Thread Greg Ewing via Python-list
On 25/05/23 7:49 pm, BlindAnagram wrote: The first of these three results produces an incorrect relative path because relpath does not strip off any non-directory tails before comparing paths. It has no way of knowing whether a pathname component is a directory or not. It's pure

Re: Does os.path relpath produce an incorrect relative path?

2023-05-25 Thread Eryk Sun
On 5/25/23, BlindAnagram wrote: > > vcx_path = 'C:\\build.vs22\\lib\\lib.vcxproj' > src_path = 'C:\\lib\\src\\' > rel_path = '..\\..\\..\\lib\\src' > > [snip] > > The first of these three results produces an incorrect relative path > b

Does os.path relpath produce an incorrect relative path?

2023-05-25 Thread BlindAnagram
x27;..\\..\\lib\\src' vcx_path = 'C:\\build.vs22\\lib\\lib.vcxproj' src_path = 'C:\\lib\\src\\' rel_path = '..\\..\\lib\\src' --- The first of these three results produces an incorrect relative path because relpath does not strip off any non-directory ta

Re: Find the path of a shell command

2022-10-17 Thread Grant Edwards
On 2022-10-15, Andreas Eder wrote: > On Mi 12 Okt 2022 at 05:00, Paulo da Silva > wrote: > >> The simple question: How do I find the full path of a shell command >> (linux), i.e. how do I obtain the corresponding of, for example, >> "type rm" in command lin

Re: Find the path of a shell command

2022-10-17 Thread Andreas Eder
On Mi 12 Okt 2022 at 05:00, Paulo da Silva wrote: > The simple question: How do I find the full path of a shell command > (linux), i.e. how do I obtain the corresponding of, for example, > "type rm" in command line? > > The reason: > I have python program that laun

Re: Find the path of a shell command [POSTPONED]

2022-10-16 Thread Peter J. Holzer
On 2022-10-16 17:21:03 +0100, Barry wrote: > > On 16 Oct 2022, at 04:53, Dan Stromberg wrote: > > > > On Wed, Oct 12, 2022 at 9:57 PM Cameron Simpson wrote: > > > >>> On 13Oct2022 03:25, Paulo da Silva > >>> wrote: > >>> There is another problem involved. The script, works fine except when >

Re: Find the path of a shell command [POSTPONED]

2022-10-16 Thread Barry
> On 16 Oct 2022, at 04:53, Dan Stromberg wrote: > > On Wed, Oct 12, 2022 at 9:57 PM Cameron Simpson wrote: > >>> On 13Oct2022 03:25, Paulo da Silva >>> wrote: >>> There is another problem involved. The script, works fine except when >>> launched by cron! Why? >> >> Record the script outpu

Re: Find the path of a shell command [POSTPONED]

2022-10-15 Thread Dan Stromberg
On Wed, Oct 12, 2022 at 9:57 PM Cameron Simpson wrote: > On 13Oct2022 03:25, Paulo da Silva > wrote: > >There is another problem involved. The script, works fine except when > >launched by cron! Why? > > Record the script output: > > # record all output > exec >/tmp/script.$$.out 2>&1

systemd Re: Find the path of a shell command

2022-10-14 Thread Weatherby,Gerard
Only the first one or two require more work. The rest are your copy-pastes from the last time you did one. Typically I only have to changed descriptions, the executable in the *service and the timing in the *timer. They’re lot more readable and flexible than the cronjobs. From: Python-list on

Re: Find the path of a shell command

2022-10-14 Thread Albert-Jan Roskam
On Oct 14, 2022 18:19, "Peter J. Holzer" wrote: On 2022-10-14 07:40:14 -0700, Dan Stromberg wrote: > Alternatively, you can "ps axfwwe" (on Linux) to see environment > variables, and check what the environment of cron (or similar) is.  It > is this environment (mostly) that

Re: Find the path of a shell command

2022-10-14 Thread Peter J. Holzer
On 2022-10-14 07:40:14 -0700, Dan Stromberg wrote: > Alternatively, you can "ps axfwwe" (on Linux) to see environment > variables, and check what the environment of cron (or similar) is. It > is this environment (mostly) that cronjobs will inherit. The simplest (and IMHO also most reliable) way t

Re: Find the path of a shell command

2022-10-14 Thread Dan Stromberg
On Wed, Oct 12, 2022 at 11:13 AM Paulo da Silva < p_d_a_s_i_l_v_a...@nonetnoaddress.pt> wrote: > Hi! > > The simple question: How do I find the full path of a shell command > (linux), i.e. how do I obtain the corresponding of, for example, > "type rm" in command

Re: Find the path of a shell command

2022-10-13 Thread Michael Torrie
On 10/11/22 22:00, Paulo da Silva wrote: > Hi! > > The simple question: How do I find the full path of a shell command > (linux), i.e. how do I obtain the corresponding of, for example, > "type rm" in command line? > > The reason: > I have python program tha

Re: Find the path of a shell command

2022-10-13 Thread Jon Ribbens via Python-list
t;>>>> wrote: >>>>>> Às 05:00 de 12/10/22, Paulo da Silva escreveu: >>>>>>> Hi! >>>>>>> >>>>>>> The simple question: How do I find the full path of a shell command >>>>>>> (linux), i.

Re: Find the path of a shell command

2022-10-13 Thread Eli the Bearded
In comp.lang.python, jkn wrote: > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: >> I'm afraid you will have to look for the command in every path listed in >> the PATH environment variable. > erm, or try 'which rm' ? It is so hilarious seeing t

Re: Find the path of a shell command

2022-10-13 Thread Mats Wichmann
On 10/12/22 14:51, Paulo da Silva wrote: Às 19:14 de 12/10/22, Jon Ribbens escreveu: On 2022-10-12, Paulo da Silva wrote: Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of

Re: Find the path of a shell command [POSTPONED]

2022-10-12 Thread Cameron Simpson
On 13Oct2022 03:25, Paulo da Silva wrote: There is another problem involved. The script, works fine except when launched by cron! Why? Record the script output: # record all output exec >/tmp/script.$$.out 2>&1 # dump the envionment env | sort # turn on execution tracing

Re: Find the path of a shell command [POSTPONED]

2022-10-12 Thread Paulo da Silva
Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It wo

Re: Find the path of a shell command

2022-10-12 Thread rbowman
On 10/12/22 09:06, Chris Green wrote: Michael F. Stemper wrote: On 12/10/2022 07.20, Chris Green wrote: jak wrote: Il 12/10/2022 09:40, jkn ha scritto: On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: I'm afraid you will have to look for the command in every path list

Re: Find the path of a shell command

2022-10-12 Thread Joe Pfeiffer
which rm >>>>> /usr/bin/rm >>>>> $ sudo which rm >>>>> /bin/rm >>>> >>>> Have some major Linux distributions not done usrmerge yet? For any that >>>> have, /bin is a symbolic link to /usr/bin > > The above e

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It works pretty well until it is invoked by cron! I suspect that for cron we need to specify the ful

Re: Find the path of a shell command

2022-10-12 Thread Peter J. Holzer
On 2022-10-12 21:51:39 +0100, Paulo da Silva wrote: > Às 19:14 de 12/10/22, Jon Ribbens escreveu: > > If you're using subprocess.run / subprocess.Popen then the computer is > > *already* searching PATH for you. > Yes, and it works out of cron. > > Your problem must

Re: Find the path of a shell command

2022-10-12 Thread Cameron Simpson
, /bin is a symbolic link to /usr/bin The above example may just be a different ordering in $PATH. I have immediate access to CentOS 7, Ubuntu 20, and Amazon Linux 2, and none of those have done that. Sorry, in fact they have done that - I misread your comment as being that they had symlinked

Re: Find the path of a shell command

2022-10-12 Thread Cameron Simpson
On 13Oct2022 08:50, Cameron Simpson wrote: On 12Oct2022 15:16, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: rm doesn't take that long. Why are you detaching them? [...] For remove filesystems, even a local to your LAN NAS, it can take quite a while. Of course I meant "remote" h

Re: Find the path of a shell command (shutil.which)

2022-10-12 Thread Eryk Sun
On 10/12/22, Weatherby,Gerard wrote: > > When no path is specified, the results of > os.environ()<https://docs.python.org/3/library/os.html#os.environ> are used, > returning either the “PATH” value or a fallback of > os.defpath<https://docs.python.org/3/library/o

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
On 2022-10-12, Jon Ribbens wrote: > On 2022-10-12, Paulo da Silva wrote: >> Às 19:14 de 12/10/22, Jon Ribbens escreveu: >>> On 2022-10-12, Paulo da Silva wrote: >>>> Às 05:00 de 12/10/22, Paulo da Silva escreveu: >>>>> Hi! >>>>> >&

Re: Find the path of a shell command

2022-10-12 Thread Cameron Simpson
On 12Oct2022 15:16, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: rm doesn't take that long. Why are you detaching them? For big things it takes quite a while. On slow discs it can take quite a while. For directory trees with many files it can take quite a while. For remove filesy

Re: Find the path of a shell command (shutil.which)

2022-10-12 Thread Weatherby,Gerard
Not going to do any good if it’s not on the PATH in the first place: https://docs.python.org/3/library/shutil.html shutil.which(cmd, mode=os.F_OK | os.X_OK, path=None) Return the path to an executable which would be run if the given cmd was called. If no cmd would be called, return None. mode

Re: Find the path of a shell command

2022-10-12 Thread Cameron Simpson
On 12Oct2022 17:49, Paulo da Silva wrote: Às 05:00 de 12/10/22, Paulo da Silva escreveu: I think that the the suggestion of searching the PATH env seems the best. I just want to note that you want to not just check for existence of the path, but that it is executable (permissionwise). You

Re: Find the path of a shell command

2022-10-12 Thread Thomas Passin
On 10/12/2022 12:00 AM, Paulo da Silva wrote: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It wo

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
On 2022-10-12, Paulo da Silva wrote: > Às 19:14 de 12/10/22, Jon Ribbens escreveu: >> On 2022-10-12, Paulo da Silva wrote: >>> Às 05:00 de 12/10/22, Paulo da Silva escreveu: >>>> Hi! >>>> >>>> The simple question: How do I find the full path

Re: Find the path of a shell command

2022-10-12 Thread Weatherby,Gerard
Some thoughts / notes: 1. On our Ubuntu-Server 20.04.3 based systems, /bin/rm and /usr/bin/rm are hard links to the same file. 2. Put the following in a bash script and run it from cron. Then you can see what your environment is. Mine has PATH=/usr/bin:/bin in it. #!/bin/bash env > /tmp/

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
Às 20:09 de 12/10/22, Antoon Pardon escreveu: Op 12/10/2022 om 18:49 schreef Paulo da Silva: Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type r

Re: Find the path of a shell command

2022-10-12 Thread jak
Il 12/10/2022 20:19, MRAB ha scritto: On 2022-10-12 06:11, jak wrote: Il 12/10/2022 06:00, Paulo da Silva ha scritto: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
when it's booted in single-user mode and /usr may >>> not be available. Also, the Filesystem Hierarchy Standard *requires* >>> it to be in /bin. >>> >>> Having said that, nothing requires it not to be elsewhere *as well*, >>> and in Ubuntu and other L

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
Às 19:14 de 12/10/22, Jon Ribbens escreveu: On 2022-10-12, Paulo da Silva wrote: Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in co

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
cron! I suspect that for cron we need to specify the full path. Probably you could use os.unlink[1] with no problem. No, because I need to launch several rm's that keep running after the script ends. rm doesn't take that long. Why are you detaching them? Because the use of "rm

Re: Find the path of a shell command

2022-10-12 Thread Grant Edwards
On 2022-10-12, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2022-10-12 at 17:43:18 +0100, Paulo da Silva > wrote: >> >> > Probably you could use os.unlink[1] with no problem. >> >> No, because I need to launch several rm's that keep running after the script

Re: Find the path of a shell command

2022-10-12 Thread 2QdxY4RzWzUUiLuE
for cron we need to specify > > > the full path. > > > > Probably you could use os.unlink[1] with no problem. > No, because I need to launch several rm's that keep running after the script > ends. rm doesn't take that long. Why are you detaching them? (I'm not

Re: Find the path of a shell command

2022-10-12 Thread Antoon Pardon
Op 12/10/2022 om 18:49 schreef Paulo da Silva: Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I h

Re: Find the path of a shell command

2022-10-12 Thread jkn
On Wednesday, October 12, 2022 at 12:07:36 PM UTC+1, jak wrote: > Il 12/10/2022 09:40, jkn ha scritto: > > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: > >> Il 12/10/2022 06:00, Paulo da Silva ha scritto: > >>> Hi! > >>> > >>

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
On 2022-10-12, Paulo da Silva wrote: > Às 05:00 de 12/10/22, Paulo da Silva escreveu: >> Hi! >> >> The simple question: How do I find the full path of a shell command >> (linux), i.e. how do I obtain the corresponding of, for example, >> "type rm" in

Re: Find the path of a shell command

2022-10-12 Thread MRAB
On 2022-10-12 06:11, jak wrote: Il 12/10/2022 06:00, Paulo da Silva ha scritto: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program tha

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
. Also, the Filesystem Hierarchy Standard *requires* >> it to be in /bin. >> >> Having said that, nothing requires it not to be elsewhere *as well*, >> and in Ubuntu and other Linux systems it is in /usr/bin too. And because >> PATH for non-root users will usually contain /

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
Às 17:22 de 12/10/22, Tilmann Hentze escreveu: Paulo da Silva schrieb: I have python program that launches a detached rm. It works pretty well until it is invoked by cron! I suspect that for cron we need to specify the full path. Probably you could use os.unlink[1] with no problem. No

Re: Find the path of a shell command

2022-10-12 Thread Joe Pfeiffer
g said that, nothing requires it not to be elsewhere *as well*, > and in Ubuntu and other Linux systems it is in /usr/bin too. And because > PATH for non-root users will usually contain /usr/bin before /bin (or > indeed may not contain /bin at all), 'command -v rm' or '

Re: Find the path of a shell command

2022-10-12 Thread Paulo da Silva
Às 05:00 de 12/10/22, Paulo da Silva escreveu: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It wo

Re: Find the path of a shell command

2022-10-12 Thread Michael F. Stemper
On 12/10/2022 07.20, Chris Green wrote: jak wrote: Il 12/10/2022 09:40, jkn ha scritto: On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: I'm afraid you will have to look for the command in every path listed in the PATH environment variable. erm, or try 'which r

Re: Find the path of a shell command

2022-10-12 Thread Chris Green
Michael F. Stemper wrote: > On 12/10/2022 07.20, Chris Green wrote: > > jak wrote: > >> Il 12/10/2022 09:40, jkn ha scritto: > >>> On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: > > >>>> I'm afraid you will have to look fo

Re: Find the path of a shell command

2022-10-12 Thread Jon Ribbens via Python-list
d other Linux systems it is in /usr/bin too. And because PATH for non-root users will usually contain /usr/bin before /bin (or indeed may not contain /bin at all), 'command -v rm' or 'which rm' will usually list the version of rm that is in /usr/bin. e.g. on Amazon Linux:

Re: Find the path of a shell command

2022-10-12 Thread jak
Il 12/10/2022 14:20, Chris Green ha scritto: jak wrote: Il 12/10/2022 09:40, jkn ha scritto: On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: Il 12/10/2022 06:00, Paulo da Silva ha scritto: Hi! The simple question: How do I find the full path of a shell command (linux), i.e

Re: Find the path of a shell command

2022-10-12 Thread Chris Green
jak wrote: > Il 12/10/2022 09:40, jkn ha scritto: > > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: > >> Il 12/10/2022 06:00, Paulo da Silva ha scritto: > >>> Hi! > >>> > >>> The simple question: How do I find the full path

Re: Find the path of a shell command

2022-10-12 Thread jak
Il 12/10/2022 09:40, jkn ha scritto: On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: Il 12/10/2022 06:00, Paulo da Silva ha scritto: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "ty

Re: Find the path of a shell command

2022-10-12 Thread jkn
On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: > Il 12/10/2022 06:00, Paulo da Silva ha scritto: > > Hi! > > > > The simple question: How do I find the full path of a shell command > > (linux), i.e. how do I obtain the corresponding of, for example

Re: Find the path of a shell command

2022-10-12 Thread jak
Il 12/10/2022 06:00, Paulo da Silva ha scritto: Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It wo

Find the path of a shell command

2022-10-12 Thread Paulo da Silva
Hi! The simple question: How do I find the full path of a shell command (linux), i.e. how do I obtain the corresponding of, for example, "type rm" in command line? The reason: I have python program that launches a detached rm. It works pretty well until it is invoked by cron! I su

Re: traceback Shows path to my python libraries

2022-06-21 Thread Dieter Maurer
jsch...@sbcglobal.net wrote at 2022-6-20 13:49 -0500: >I coded an application with a 64-bit executable using cython with the embed >option and gcc and I received a traceback showing the path to my python >installation. Is that normal or does that mean the application is going >o

traceback Shows path to my python libraries

2022-06-20 Thread jschwar
I coded an application with a 64-bit executable using cython with the embed option and gcc and I received a traceback showing the path to my python installation. Is that normal or does that mean the application is going outside of my executable to my python libraries? I want it portable so it if

Re: CWD + relative path + import name == resultant relative path?

2021-10-30 Thread Dieter Maurer
Dan Stromberg wrote at 2021-10-29 16:38 -0700: >Is there a predefined function somewhere that can accept the 3 things on >the LHS in the subject line, and give back a resultant relative path - >relative to the unchanged CWD? > >To illustrate, imagine: >1) You're sitting i

CWD + relative path + import name == resultant relative path?

2021-10-29 Thread Dan Stromberg
Is there a predefined function somewhere that can accept the 3 things on the LHS in the subject line, and give back a resultant relative path - relative to the unchanged CWD? To illustrate, imagine: 1) You're sitting in /home/foo/coolprog 2) You look up the AST for /home/foo/coolprog/a/b/c

Re: Python added to PATH, cannot be directly accessed, cannot install pip

2021-09-27 Thread Eryk Sun
On 9/27/21, Mats Wichmann wrote: > > pip, meanwhile, is not in the same directory as the python executable, > so even "adding python to PATH" doesn't solve the problem of running > pip. Invoke it like this instead: The installer's option to add Python to

Re: Python added to PATH, cannot be directly accessed, cannot install pip

2021-09-27 Thread Mats Wichmann
Execution Aliases." So for a week, I've been trying to add Python to PATH, so I can install get-pip.py to Python. I've added the exact file location for Python to Path in both User Variables and System Variables. I've executed Manage App Execution

Re: Python added to PATH, cannot be directly accessed, cannot install pip

2021-09-27 Thread Eryk Sun
On 9/27/21, Will wrote: > >I am using a Lenovo Laptop using Windows. I'm trying to install >get-pip.py The installer includes pip by default and has an option to update PATH for you, though the latter isn't enabled by default. Latest 64-bit release: https://www.py

Python added to PATH, cannot be directly accessed, cannot install pip

2021-09-27 Thread Will
r a week, I've been trying to add Python to PATH, so I can install get-pip.py to Python. I've added the exact file location for Python to Path in both User Variables and System Variables. I've executed Manage App Execution Aliases, turned off both App Installer python.exe

Re: module include path - /usr/local/lib/python3 vs /usr/local/lib/python3.9

2021-06-17 Thread Mats Wichmann
On 6/17/21 1:53 AM, Joachim Wuttke wrote: How to write a platform-independent CMake install command to install a Swig-generated Python module? The following brings us very close to a solution: ``` execute_process(     COMMAND "${Python3_EXECUTABLE}"     -c "from distutils import sysconfig as s

module include path - /usr/local/lib/python3 vs /usr/local/lib/python3.9

2021-06-17 Thread Joachim Wuttke
How to write a platform-independent CMake install command to install a Swig-generated Python module? The following brings us very close to a solution: ``` execute_process( COMMAND "${Python3_EXECUTABLE}" -c "from distutils import sysconfig as sc; print(sc.get_python_lib(prefix='',

Help me in setting the path in python program.

2021-06-07 Thread Maheshwari Gorle
I am using Google co lab. Guide me how to set the path. # Error: SwissEph file 'se13681s.se1' not found in PATH '/usr/share/ephe/' is coming, how to overcome this problem. pip install pyswisseph import swisseph as swe swe.set_ephe_path ('/usr/share/ephe') #

Re: compiling 3.7.0 from source with custom libffi path

2020-05-05 Thread yuri . yudhaswana
Hi, I dont have "lib64" in libffi, are you sure it is "lib64" or just "lib"? On Monday, 1 July 2019 21:32:46 UTC+9, tom...@gmail.com wrote: > On Monday, September 24, 2018 at 11:48:59 AM UTC+3, Fetchinson . wrote: > > I'm trying to compile python 3.7

Re: Profiler showing path dependency?

2020-03-26 Thread Chengcheng Xiang
Hi, Our tool can help with this: https://github.com/devopspp/pyliveupdate/blob/master/README.md#profiler. It can output a flamegraph and a per-path call summary. Feel free to check it out and let me know if there is any questions. -CC On Friday, March 13, 2020 at 4:52:51 PM UTC-7, Go Luhng

Re: Profiler showing path dependency?

2020-03-16 Thread Barry Scott
ou will see `main()` calling `foo()` and `qux()`, with each >> of them calling `bar()`. However, if you hover or click on `bar()`, >> you will see the global aggregate statistics for it. For example, the >> number of times it has been called, and their total time cost. &

Re: Profiler showing path dependency?

2020-03-16 Thread Marco Sulla
> number of times it has been called, and their total time cost. > > Is there a way to get a path-dependent profiler breakdown for `bar()`? > Specifically for this example, statistics for when it is called by > `foo()`, and separately statistics for when it is called by `qux()`.

Re: Profiler showing path dependency?

2020-03-14 Thread Dieter Maurer
eViz, you will see `main()` calling `foo()` and `qux()`, with each >of them calling `bar()`. However, if you hover or click on `bar()`, >you will see the global aggregate statistics for it. For example, the >number of times it has been called, and their total time cost. > >Is there a way

Profiler showing path dependency?

2020-03-13 Thread Go Luhng
them calling `bar()`. However, if you hover or click on `bar()`, you will see the global aggregate statistics for it. For example, the number of times it has been called, and their total time cost. Is there a way to get a path-dependent profiler breakdown for `bar()`? Specifically for this example

How to specify sqlite engine path in sqlalchemy using Zipapp

2020-01-16 Thread Abdur-Rahmaan Janhangeer
I don't know how to specify sqlalchemy's engine path for sqlite within zipapp. Using: engine = create_engine('sqlite:///{}'.format( os.path.join(dirp, 'db/items.db') )) i get unable to open database file I've rounded the problem with as

Re: Announcing config-path an OS independent configuration file paths

2019-09-30 Thread Paul Moore
read vs. save paths. > Required for XDG specification where a path of config folder is defined. > > On 1st run the config may be in a system directory which the user cannot > write to. > Saving a config file will go into the users config file. > On the 2nd run that users co

Re: Announcing config-path an OS independent configuration file paths

2019-09-30 Thread Barry Scott
> On 30 Sep 2019, at 14:17, Paul Moore wrote: > > How does this compare to the existing appdirs module on PyPI? > I did not know about appdirs. It does not seem to have separate read vs. save paths. Required for XDG specification where a path of config folder is defined. On

Re: Announcing config-path an OS independent configuration file paths

2019-09-30 Thread Paul Moore
How does this compare to the existing appdirs module on PyPI? On Mon, 30 Sep 2019 at 13:15, Barry Scott wrote: > > See https://pypi.org/project/config-path/ for documentation. > > Install using pip: > > python -m pip install config-path > > I write tools tha

  1   2   3   4   5   6   7   8   9   10   >