You are not logged in.
Pages: 1
Hi all,
First post. Longtime fan of Arch Linux.
Whenever I try to run programs (as mentioned), suchas: bleachbit reflector, youtube-dl ; errors occur. I'll try to illustrate the best I can.
1. Typing whereis for programs:
bleachbit: /usr/bin/bleachbit /usr/share/bleachbit
youtube-dl: /usr/bin/youtube-dl
reflector: /usr/bin/reflector2. Trying to run these programs in two ways (via command).
cd /usr/bin
python bleachbit
output:
Traceback (most recent call last):
File "bleachbit", line 41, in <module>
import gtk
ImportError: No module named gtkthen just, bleachbit
output:
/usr/bin/bleachbit: line 25: $'\nLauncher\n': command not found
/usr/bin/bleachbit: line 29: import: command not found
/usr/bin/bleachbit: line 30: import: command not found
/usr/bin/bleachbit: line 32: syntax error near unexpected token `('
/usr/bin/bleachbit: line 32: `if 'posix' == os.name and os.path.isdir('/usr/share/bleachbit'):'Next, running youtube-dl
python youtube-dl
output:
File "youtube-dl", line 209
u'TEST'.encode(pref)
^
SyntaxError: invalid syntaxAgain just, youtube-dl
output:
/usr/bin/youtube-dl: line 4: syntax error near unexpected token `('
/usr/bin/youtube-dl: line 4: `__authors__ = ('Finally. Reflector
python reflector --help
output seems fine...
however, reflector --help
output:
/usr/bin/reflector: line 3: import: command not found
/usr/bin/reflector: line 6: syntax error: unexpected end of fileIn addition, I looked over the 'pacman Tips' in this ArchWiki, which then lead to listing installed packages; there for reference.
Obviously, I'm completely lost and have (for several days) looked over these forums as well as other sources. Unfortunately, I haven't been able to find any solution(s).
Any help would be appreciated.
Basic System Info:
Arch Linux x86_64 (dual architecture)
Kernel: 3.4.4-2-ARCH
DE: Xfce , Openbox
WM: Slim
Last edited by midfingr (2012-06-27 22:41:57)
Offline
The reason you're getting different errors is that some of these programmes use python2 and some use python3. python should be symlinked to python3. So
python bleachbitwould be expected to fail. Does
python2 bleachbitwork?
reflector is using python3 anyway so
python reflectorshould work.
So my guess is that the issue is one of why python isn't being used when you just run bleachbit or reflector without specifying (the appropriate version of) python.
Just to check. Do you have coreutils installed? I don't see how you could not have, though.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Is your system up to date?
Offline
Hi,
Thanks for the replies. Very much appreciated.
@cfr
Yes. Running the commands you specified work (with all I mentioned), thank you
And yes, coreutils are installed. I did suspect it was some sort of python ; mix up(?), however, I've no clue as to why this happened. At least I can run the commands as long as I cd /usr/bin
@Terminator
Yes, as far as I know, the system is up to date i.e. pacman -Syu and checked installed packages with yaourt.
Offline
Have a look at the shebangs of those programs. Do they say /usr/bin/python or /usr/bin/python2?
Offline
Have a look at the shebangs of those programs. Do they say /usr/bin/python or /usr/bin/python2?
Hi, Runiq
Yes they do.
youtube-dl:
#!/usr/bin/env python2bleachbit:
#!/usr/bin/env python2reflector:
#!/usr/bin/env python3The best I could do was to make a smlink for each, then alias in bashrc for the commands. However, I guess reflector is a lost cause now(?); as Xyne indicated on the forums.
Offline
Do you have the same issue in a clean user account?
What does printenv give?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
However, I guess reflector is a lost cause now(?); as Xyne indicated on the forums.
I just did a search but I'm clueless. What's happened to reflector?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Perhaps midfingr was referring to this old thread:
https://bbs.archlinux.org/viewtopic.php?id=115660
However the current reflector on in the repos is fine. Its the new python3 rewrite.
Offline
Perhaps midfingr was referring to this old thread:
https://bbs.archlinux.org/viewtopic.php?id=115660
However the current reflector on in the repos is fine. Its the new python3 rewrite.
Thanks. That was my impression, too. (I found a different thread announcing the rewrite.) And reflector seemed to be working OK. But I figured things do change quickly sometimes... ![]()
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Do you have the same issue in a clean user account?
What does printenv give?
Hi, cfr
Apologies for mis-reading the old thread concerning reflector
I haven't tried the commands as a with a new user acc. However, I ran them in tty as root and lo & behold, they worked... without adding python(2) before the command.
Here is the printenv:
XDG_DATA_HOME=/home/midfingr/.local/share
GPG_AGENT_INFO=/home/midfingr/.cache/keyring-xxxxx/gpg:0:1
GLADE_PIXMAP_PATH=:
TERM=xterm
SHELL=/bin/bash
XDG_MENU_PREFIX=xfce-
XDG_SESSION_COOKIE=xxxxxxx
WINDOWID=56623108
GNOME_KEYRING_CONTROL=/home/midfingr/.cache/keyring-xxxxx
GTK_MODULES=canberra-gtk-module
USER=midfingr
GLADE_MODULE_PATH=:
SSH_AUTH_SOCK=/home/midfingr/.cache/keyring-xxxxx/ssh
SESSION_MANAGER=local/madmid:@/tmp/.ICE-unix/7184,unix/madmid:/tmp/.ICE-unix/7184
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_CONFIG_DIRS=/etc/xdg:/etc/xdg
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl
MAIL=/var/mail/midfingr
DESKTOP_SESSION=xfce
PWD=/home/midfingr
JAVA_HOME=/usr/lib/jvm/java-7-openjdk/jre
GNOME_KEYRING_PID=7189
LANG=en_US.UTF-8
HOME=/home/midfingr
SHLVL=2
XDG_CONFIG_HOME=/home/midfingr/.config
XDG_CACHE_HOME=/home/midfingr/.cache
LOGNAME=midfingr
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-xxxxxxx
DISPLAY=:0.0
GLADE_CATALOG_PATH=:
J2REDIR=/usr/lib/jvm/java-7-openjdk/jre
G_BROKEN_FILENAMES=1
COLORTERM=Terminal
XAUTHORITY=/home/midfingr/.Xauthority
_=/usr/bin/printenvOffline
If you do
export PATH=/usr/bin:/bin:/usr/sbin:/sbindoes that help?
If so, look for anything suspicious under /usr/local.
Does it work as your regular user from a tty? Or only root?
Try a clean non-privileged user or temporarily replace your personal config files with defaults.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
If you do
export PATH=/usr/bin:/bin:/usr/sbin:/sbindoes that help?
If so, look for anything suspicious under /usr/local.
Does it work as your regular user from a tty? Or only root?
Try a clean non-privileged user or temporarily replace your personal config files with defaults.
Hi cfr
Thank you so much for your invaluable help.
Yes!
The export command worked and everything ran as expected (i.e. no need to smlink or python...). Also. I ran, in console mode, the commands under my account, everything was fine (minus bleachbit -- gui version only). I'll make a backup of my configs and try everything again.
As far as /usr/local nothing appears out of the ordinary. Unless those folders aren't supposed to be there.
Here is the output:
total 44K
drwxr-xr-x 11 root root 4.0K Jun 20 05:31 ./
drwxr-xr-x 9 root root 4.0K Jun 11 19:36 ../
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 bin/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 etc/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 games/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 include/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 lib/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 man/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 sbin/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 share/
drwxr-xr-x 2 root root 4.0K Jun 20 05:31 src/Offline
I would expect that there is something like a custom/old python executable in /usr/local/bin. A possible workaround is changing your path so that /usr/local/bin and /usr/local/sbin are at the end of your path. AFAIK, if you have an executable in multiple folders, then the first one that is found is used.
Offline
I was thinking the same - an old python under /usr/local/bin.
It could also be a module or modules under /usr/local/lib, perhaps?
I don't think that reverting to default configs will help since it looks like a problem under /usr/local. Terminator suggested a work around but a better option would be solving the underlying issue. Look under /usr/local/bin, /usr/local/lib/... etc.
EDIT: Then again, if that's the issue, why would it work logged in as you from a console? Is PATH set differently then?
Last edited by cfr (2012-06-29 22:47:27)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Hi Terminator, crf
I checked all folders and files under: /usr/local and found nothing, with the exception of a link in 'share' to the 'man' folder. Other than that they are empty. I looked through both as root in console, using ls -la and sudo thunar (gui) + show hidden.
So the path env switch (export PATH=/usr/bin:/bin:/usr/sbin:/sbin) does allow me to run the programs as normal. Did I miss something while installing?
Thank you so much again for the help. ![]()
Offline
Hi Terminator, crf
I checked all folders and files under: /usr/local and found nothing, with the exception of a link in 'share' to the 'man' folder. Other than that they are empty. I looked through both as root in console, using ls -la and sudo thunar (gui) + show hidden.
So the path env switch (export PATH=/usr/bin:/bin:/usr/sbin:/sbin) does allow me to run the programs as normal. Did I miss something while installing?
Maybe you missed something but it isn't obvious how anything you might have missed would affect this. At least, not to me. There are many much more knowledgeable people around here so somebody may enlighten this thread at some point. ![]()
Just to be clear. If you try to run reflector, say, in your own user account from a terminal emulator, you get errors.
If you first issue
export PATH=/usr/bin:/bin:/usr/sbin:/sbinthen it works?
So the only difference between the two cases should be the value of path. In the problematic case, it is
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perlBut if that's true, it looks as if there would have to be something under /usr/local/bin messing things up as nothing else is different.
But there is nothing under /usr/local/bin or /usr/local/sbin or, in fact, anything interesting under /usr/local at all.
Is that correct so far?
Moreover, if you switch to a console, log in as yourself and run reflector, it also works without your needing to do anything special such as setting PATH. What does
echo $PATHgive when you are logged in at the console (when reflector works OK)?
It also seems weird that it works OK for root since I think /usr/local is in root's PATH by default. (I'm not sure about this because I think I changed it for security reasons on my system.)
What do
which python
which python2
ls -l /usr/bin/python*give when you are logged in ordinarily as you and using a terminal emulator (i.e. when you get errors)?
Last edited by cfr (2012-06-30 02:32:59)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Maybe you missed something but it isn't obvious how anything you might have missed would affect this. At least, not to me. There are many much more knowledgeable people around here so somebody may enlighten this thread at some point.
Just to be clear. If you try to run reflector, say, in your own user account from a terminal emulator, you get errors.
If you first issue
export PATH=/usr/bin:/bin:/usr/sbin:/sbinthen it works?
So the only difference between the two cases should be the value of path. In the problematic case, it is
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perlBut if that's true, it looks as if there would have to be something under /usr/local/bin messing things up as nothing else is different.
But there is nothing under /usr/local/bin or /usr/local/sbin or, in fact, anything interesting under /usr/local at all.
Is that correct so far?
Apologies for not being clear. After issuing the above command, it has worked ever since. The was no need to run it again. So to clarify, running the code once and only once,
export PATH=/usr/bin:/bin:/usr/sbin:/sbinseems to have fixed the problem.
Moreover, if you switch to a console, log in as yourself and run reflector, it also works without your needing to do anything special such as setting PATH. What does
echo $PATHgive when you are logged in at the console (when reflector works OK)?
It also seems weird that it works OK for root since I think /usr/local is in root's PATH by default. (I'm not sure about this because I think I changed it for security reasons on my system.)
What do
which python which python2 ls -l /usr/bin/python*give when you are logged in ordinarily as you and using a terminal emulator (i.e. when you get errors)?
Issuing:
sudo reflector -c %own% -f 4 > mirrorlistworks fine, only the 'mirrorlist' is placed in my home directory...
echo $PATH -- shows:
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perlAs for ..
which python:
/usr/bin/pythonwhich python2:
/usr/bin/python2List for python directories:
lrwxrwxrwx 1 root root 7 Apr 23 19:27 /usr/bin/python -> python3*
lrwxrwxrwx 1 root root 9 Apr 23 20:02 /usr/bin/python2 -> python2.7*
-rwxr-xr-x 1 root root 6.2K Apr 23 20:02 /usr/bin/python2.7*
-rwxr-xr-x 1 root root 1.6K Apr 23 20:02 /usr/bin/python2.7-config*
lrwxrwxrwx 1 root root 16 Apr 23 20:02 /usr/bin/python2-config -> python2.7-config*
-rwxr-xr-x 3 root root 11K Apr 23 19:27 /usr/bin/python3*
-rwxr-xr-x 3 root root 11K Apr 23 19:27 /usr/bin/python3.2*
lrwxrwxrwx 1 root root 18 Apr 23 19:27 /usr/bin/python3.2-config -> python3.2mu-config*
-rwxr-xr-x 3 root root 11K Apr 23 19:27 /usr/bin/python3.2mu*
-rwxr-xr-x 1 root root 1.8K Apr 23 19:27 /usr/bin/python3.2mu-config*
lrwxrwxrwx 1 root root 16 Apr 23 19:27 /usr/bin/python3-config -> python3.2-config*
-rwxr-xr-x 1 root root 893 Dec 22 2011 /usr/bin/python3-mako-render*
lrwxrwxrwx 1 root root 14 Apr 23 19:27 /usr/bin/python-config -> python3-config*All I can say is that it's defenitely strange. I also checked my bashrc and there are no aliases for those programs as I removed them to be sure they worked. (i.e. bleachbit, reflector, youtube-dl).
Offline
OK. Well, I'm glad it worked even though I don't understand why it would keep working. I'd expect it to work until you start a new shell but not afterwards...
Where did you expect reflector to write the mirrorlist? Were you *in* your home directory at the time? If so, that's the expected behaviour unless you've aliased sudo or altered the defaults.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Yes. I expected the mirrorlist to be written to the home directory. Normally, I would have to su in /etc/pacman.d for the 'real' mirrorlist.
Speaking of pacman. I looked over the config (pacman.conf) and noticed [multilib] had a # beside it .. oops; I uncommented the url, but not the option. Sigh. Maybe that was the problem all along?
In any case. Thank you! I guess we can mark this as solved or semi-solved?
Offline
I would be kind of surprised if that caused this problem. Especially since I doubt any of these programmes need anything from multilib.
I dislike the mystery but I think I'll have to live with it - hard to diagnose a problem which no longer seems to exist! Mark away as you see fit - it is your issue so you have the honour of deciding how solved it is... ![]()
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
To be honest, I don't want to be bothersome. However, if you don't mind leaving this thread open, I would like to find out why the problem seemed to solve itself. In reading through other forums, the export path should be in bashrc or /etc/profile in order to be consistent. (?)
Here is the /etc/profile output:
# /etc/profile
#Set our umask
umask 022
# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH
# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -r "$profile" && . "$profile"
done
unset profile
fi
# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
. /etc/bash.bashrc
fi
# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP
# Man is much better than us at figuring this out
unset MANPATHOffline
Your PATH wasn't really incorrect. I basically told you to change it to a non-default which excluded /usr/local. My thinking was that you might have a stale/custom python under /usr/local which was getting executed rather than the standard versions. When changing the path worked, I assumed that was indeed the case.
But apparently not since you don't have anything at all under /usr/local. But in that case, the instructions I gave for changing PATH ought not to have made a blind bit of difference. They shouldn't have caused any issues but they shouldn't have helped either.
That's what I don't get.
Plus, changing your PATH like this should only work until you start a new shell. It shouldn't be a "one-time" fix!
EDIT: /etc/profile looks default to me. You could try checking the stuff it calls but I don't think you will find much enlightenment this way as your PATH wasn't incorrect in the first place....
Last edited by cfr (2012-07-02 21:49:17)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
I'm with you on this so far. Except, I'm not sure how to check for what the profile might be calling ; if that's if I understand you correctly.
I did make a new user account, but everything worked just fine. This lead me back to setting up Xfce. Where I did get tripped up and don't fully understand is the Wiki section: https://wiki.archlinux.org/index.php/Xfce#Running_Xfce , specifically with the --with-ck-launch, ConsoleKit and the temporary workaround. I can't see how that would affect the profile in /etc, but I'm trying to re-trace my steps.
edit a longshot, but here are the first lines of the slim.conf file.
# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path /bin:/usr/bin:/usr/local/bin
default_xserver /usr/bin/X
.....Last edited by midfingr (2012-07-04 19:51:51)
Offline
Well part of what /etc/profile does is to source files under /etc/profile.d and /etc/bash.bashrc.
But I don't think any of this is the problem.
As you tell it:
1) problems as described
2) export PATH=/usr/bin:/bin:/usr/sbin:/sbin
3) problems solved
4) solution persists in new shell (and after reboot? logout and login?)
But your original path was correct. The only thing which could have gone wrong that I know of would be if you had a stale something under /usr/local/bin, for example. But you say there's nothing there so it is not that. Also, if there was something there, the problem should recur on reboot/re-login/new shell etc.
So I just don't see how the sequence is possible. I don't see how my suggestion *could* have helped. It shouldn't have!
I don't think the slim.conf file is connected with this. Your PATH wasn't wrong.
I think all that the wiki is telling you is not to use --with-ck-launch if you are using SLIM. Since you are, just have
exec startxfce4as your last line. [Note: I use neither SLIM not xfce - at least, I don't have xfce installed in arch.]
If you can't reproduce the problem, I think it will be hard to figure out what went wrong.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Pages: 1