Closed gerazov closed 2 years ago
Do you have any other modules installed that might be using the tldr
namespace? What's the output from doing pip3 list
?
What are the contents of doing cat /usr/bin/tldr
?
I guess it's something with the environment - I can't reproduce on my other machine.
$ cat /usr/bin/tldr
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from tldr import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli())
Does /usr/bin/python
point at your python3 installation?
It seems so:
$ which python
/usr/bin/python
$ ll /usr/bin/python
lrwxrwxrwx 1 root root 7 дек 19 00:53 /usr/bin/python -> python3*
$ ll /usr/bin/python3
lrwxrwxrwx 1 root root 10 дек 19 00:53 /usr/bin/python3 -> python3.10*
I wonder if the *
at the end of the symlink is messing anything up? Does /usr/bin/python --version
print out 3.10? And if you do /usr/bin/python
, can do you run import tldr
at all in the repl?
Really, my only thought at this point on what the error could be is that /usr/bin/python
that's referenced in the script above is divorced in some way from where pip3 has installed stuff.
You're right - it does work in the REPL:
$ /usr/bin/python --version
Python 3.10.1
$ /usr/bin/python
Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tldr
>>>
Hm, what is /usr/bin/tldr.py
? I think that might be the problem, where /usr/bin/tldr
is then looking at /usr/bin/tldr.py
to import from, but it's not the tldr that you installed via pip3
, and so fails?
Hmm, seems Python2 code in /usr/bin/tldr.py
- removed it and now it works :+1:
Thanks :pray:
Awesome tool :sunglasses:
I'm getting an import error on a fresh install - am I missing some dependencies?