[arch-general] Problem with reflector
Hi all, I'm trying to install reflector to manage pacman mirrors. Upon install, everything seems to be working, but actually running the reflector command says that the python file. The PKGBUILD installs the file to the system python, but the python binary that is higher in the path is the one installed by asdf-vm, which uses pyenv in the background. Because this has its own directory, the file is not installed to this location, so when the reflector command invokes python, it invokes the one installed by asdf-vm, which obviously cannot find the file Any ideas on how to fix this? Thanks, Yash Karandikar
I have not fully understood your situation, but can you not just change the PATH environment variable?
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
On 3/7/20 10:53 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
This has nothing to do with reflector, you will as a general rule of thumb break *all* python software by using a venv as the default python. You should only be using venvs when manually activated for a given project, limited to the shell in which you are using the project. -- Eli Schwartz Bug Wrangler and Trusted User
On Sat, Mar 7, 2020, 9:57 PM Eli Schwartz via arch-general < arch-general@archlinux.org> wrote:
On 3/7/20 10:53 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
This has nothing to do with reflector, you will as a general rule of thumb break *all* python software by using a venv as the default python.
You should only be using venvs when manually activated for a given project, limited to the shell in which you are using the project.
-- Eli Schwartz Bug Wrangler and Trusted User
I don't think you're understanding, it's not a venv. It is simply an alternative python installation (similar to Anaconda Python) that lets me manage my python versions.
On 3/7/20 11:49 PM, karx via arch-general wrote:
I don't think you're understanding, it's not a venv. It is simply an alternative python installation (similar to Anaconda Python) that lets me manage my python versions.
I don't know or care what asdf-vm is, but the difference between an alternative python interpreter and a venv running on the system python interpreter is entirely academic. At the end of the day, you're running an interpreter which is siloed away from the system python environment, and then you're enabling it by default, which... breaks the default python. Although, if you're just interested in running additional python versions other than the /usr/bin/python3.8 binary currently provided by Arch, then... you really should not be overriding the "python" binary at all. Just install a python3.7 program or whatever, and invoke it as `python3.7`. -- Eli Schwartz Bug Wrangler and Trusted User
On 3/7/20 9:53 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
You could just change PATH for the one terminal with an 'export PATH=/usr/bin:$PATH' That wouldn't affect PATH for any other sessions... Yaro
On Sat, Mar 7, 2020, 9:59 PM Yaro Kasear <yaro@marupa.net> wrote:
On 3/7/20 9:53 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
You could just change PATH for the one terminal with an 'export PATH=/usr/bin:$PATH'
That wouldn't affect PATH for any other sessions...
Yaro
Thanks for your reply. If I put this in a bash script, will it reset once the script is done running?
On 3/7/20 10:51 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:59 PM Yaro Kasear <yaro@marupa.net> wrote:
On 3/7/20 9:53 PM, karx via arch-general wrote:
On Sat, Mar 7, 2020, 9:50 PM Neven Sajko <nsajko@gmail.com> wrote:
I have not fully understood your situation, but can you not just change the PATH environment variable?
No. I need python for other projects, and would much rather use a version management system rather than risk messing up the system python. Basically, what I am asking is, can I get reflector to work with pyenv?
You could just change PATH for the one terminal with an 'export PATH=/usr/bin:$PATH'
That wouldn't affect PATH for any other sessions...
Yaro
Thanks for your reply. If I put this in a bash script, will it reset once the script is done running?
I suspect it will if you drop the 'export' directive and just set PATH without it. I'd strongly recommend testing it until it works for you. Yaro
On 3/7/20 11:53 PM, Yaro Kasear wrote:
Thanks for your reply. If I put this in a bash script, will it reset once the script is done running?
I suspect it will if you drop the 'export' directive and just set PATH without it.
I'd strongly recommend testing it until it works for you.
But the "PATH" environment variable already has the export attribute on it, so it is exported either way. Furthermore, I'm bewildered w.r.t. what is the question/goal here? If you set some variable in a script, it will never modify the environment of the *parent process*, only the script itself, and child processes started by the script. Have I completely misunderstood the question? -- Eli Schwartz Bug Wrangler and Trusted User
On 3/7/20 11:21 PM, Eli Schwartz via arch-general wrote:
On 3/7/20 11:53 PM, Yaro Kasear wrote:
Thanks for your reply. If I put this in a bash script, will it reset once the script is done running?
I suspect it will if you drop the 'export' directive and just set PATH without it.
I'd strongly recommend testing it until it works for you. But the "PATH" environment variable already has the export attribute on it, so it is exported either way.
Furthermore, I'm bewildered w.r.t. what is the question/goal here? If you set some variable in a script, it will never modify the environment of the *parent process*, only the script itself, and child processes started by the script.
Have I completely misunderstood the question?
If they are having trouble invoking Reflector, a simple two-line script to change PATH just for the script and an instance of Reflector is all they would need. I won't comment as to the unconventional setup they have for their system, though. I personally wouldn't change my PATH like that, but this isn't about what *I* am doing. Yaro
On 3/8/20 12:29 AM, Yaro Kasear wrote:
On 3/7/20 11:21 PM, Eli Schwartz via arch-general wrote:
On 3/7/20 11:53 PM, Yaro Kasear wrote:
Thanks for your reply. If I put this in a bash script, will it reset once the script is done running?
I suspect it will if you drop the 'export' directive and just set PATH without it.
I'd strongly recommend testing it until it works for you. But the "PATH" environment variable already has the export attribute on it, so it is exported either way.
Furthermore, I'm bewildered w.r.t. what is the question/goal here? If you set some variable in a script, it will never modify the environment of the *parent process*, only the script itself, and child processes started by the script.
Have I completely misunderstood the question?
If they are having trouble invoking Reflector, a simple two-line script to change PATH just for the script and an instance of Reflector is all they would need. I won't comment as to the unconventional setup they have for their system, though. I personally wouldn't change my PATH like that, but this isn't about what *I* am doing.
Then if it is just about the wrapper script, as I said -- "export" builtin or no "export" builtin, it won't change anything if the env var has been previously marked as exported in the past. And it needs to be marked as exported regardless, or running the "reflector" command won't see the modified env var. -- Eli Schwartz Bug Wrangler and Trusted User
participants (4)
-
Eli Schwartz
-
karx
-
Neven Sajko
-
Yaro Kasear