Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'kitty.update_check' #1406

Closed
blueyed opened this issue Feb 23, 2019 · 6 comments
Closed

ModuleNotFoundError: No module named 'kitty.update_check' #1406

blueyed opened this issue Feb 23, 2019 · 6 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Feb 23, 2019

When using the method described at https://github.com/kovidgoyal/kitty/blob/e44b331cc3048c0d921e83ab836dbc6167d82e50/docs/build.rst#install-and-run-from-source to run kitty from source (python .) it displays this error/warning:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/bin/../lib/kitty/__main__.py", line 117, in <module>
    main()
  File "/usr/bin/../lib/kitty/__main__.py", line 108, in main
    namespaced(['+', first_arg[1:]] + sys.argv[2:])
  File "/usr/bin/../lib/kitty/__main__.py", line 68, in namespaced
    func(args[1:])
  File "/usr/bin/../lib/kitty/__main__.py", line 27, in runpy
    exec(args[1])
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'kitty.update_check'
[054 07:54:28.731077] Failed to process update check data '', with error: invalid literal for int() with base 10: ''
@Luflosi
Copy link
Contributor

Luflosi commented Feb 23, 2019

This is probably the same error as described in #1352.

@kovidgoyal
Copy link
Owner

Indeed, you likely have a kitty on your path already that points to a different one than the built from source one. Remove that or change it to point to the correct kitty and you will be fine.

@blueyed
Copy link
Contributor Author

blueyed commented Feb 23, 2019

I have this wrapper - shouldn't it work?

#!/usr/bin/env python3
import runpy
import sys

kitty_path = '/home/user/Vcs/kitty'

# try:
#     sys.path.insert(0, kitty_path)
#     from kitty.constants import kitty_exe  # noqa: E402
#     kitty_exe.ans = __file__
# except ImportError:
#     pass

runpy.run_path(kitty_path, run_name='__main__')

kitty '+runpy' 'from kitty.update_check import *' appears to work with it.

@kovidgoyal
Copy link
Owner

Remember that the PATH you see inside a shell is not going to
necessarily be the PATH that kitty sees, because any changes to the PATH
you make inside shell startup scripts will not be seen by kitty.

@blueyed
Copy link
Contributor Author

blueyed commented Feb 23, 2019

Hmm.. I am running python . (which also triggers it) from the same shell.
I've initially seen this when using my wrapper, checked the docs, and tried the python . mentioned there with the same result.
But it is a good hint for furhter investigation - although it appears to be more related to Python's sys.path than the shell's $PATH I assume.

blueyed added a commit to blueyed/kitty that referenced this issue Feb 23, 2019
@blueyed
Copy link
Contributor Author

blueyed commented Feb 23, 2019

kitty_exe() returned /usr/bin/kitty once, but the local one later.
Appears to be due to using a set there.
#1408 should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants