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

Dependencies installed, but main.py throws errors #2

Open
Kabouik opened this issue Jun 1, 2020 · 5 comments
Open

Dependencies installed, but main.py throws errors #2

Kabouik opened this issue Jun 1, 2020 · 5 comments

Comments

@Kabouik
Copy link

Kabouik commented Jun 1, 2020

I installed asciimatics and keyboard using pip, ncurses is installed, but I can't run main.py regardless of the version of Python I use:

nemo@Sailfish nnn]$ devel-su pip install asciimatics
Password: 
Collecting asciimatics
  Downloading asciimatics-1.11.0-py2.py3-none-any.whl (96 kB)
     |████████████████████████████████| 96 kB 1.4 MB/s 
Requirement already satisfied: future in /usr/lib/python3.8/site-packages (from asciimatics) (0.18.2)
Requirement already satisfied: Pillow>=2.7.0 in /usr/lib/python3.8/site-packages (from asciimatics) (5.4.1)
Collecting pyfiglet>=0.7.2
  Downloading pyfiglet-0.8.post1-py2.py3-none-any.whl (865 kB)
     |████████████████████████████████| 865 kB 2.9 MB/s 
Collecting wcwidth
  Downloading wcwidth-0.1.9-py2.py3-none-any.whl (19 kB)
Installing collected packages: pyfiglet, wcwidth, asciimatics
Successfully installed asciimatics-1.11.0 pyfiglet-0.8.post1 wcwidth-0.1.9
[nemo@Sailfish nnn]$ devel-su pip install keyboard   
Password: 
Collecting keyboard
  Downloading keyboard-0.13.5-py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 828 kB/s 
Installing collected packages: keyboard
Successfully installed keyboard-0.13.5
[nemo@Sailfish term-tris]$ python main.py 
Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from asciimatics.screen import Screen
ImportError: No module named asciimatics.screen
[nemo@Sailfish term-tris]$ 
[nemo@Sailfish term-tris]$ python3 main.py 
Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from asciimatics.screen import Screen
  File "/usr/lib/python3.8/site-packages/asciimatics/screen.py", line 2152, in <module>
    import curses
  File "/usr/lib/python3.8/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
[nemo@Sailfish term-tris]$ 

I tried as root, but got the same errors. Any ideas? Is it possible my version of ncurses is too old? I only have 6.1 available.

@Kabouik Kabouik changed the title Dependencies install, but main.py throws errors Dependencies installed, but main.py throws errors Jun 1, 2020
@jquast
Copy link

jquast commented Jun 8, 2020

However your python was installed, by package or manually, It did not include or link with ncurses.

If you manually compile python, the configure script makes a report of modules that will not be built because ncurses/curses.h was not found, or perhaps, by manually compiling it, it will be found.

best wishes

@Kabouik
Copy link
Author

Kabouik commented Jun 8, 2020

Thanks for your answer. You are absolutely right, the repository version of python3 I initially had was built without ncurses, and this led to other applications failing to run, like glances for instance. However, I later found a community version which fixes that dependency and I could confirm that glances would then correctly run, but I am still getting the same issue in term-tris so I am not sure why it is not picking the updated python version like glances did.

@jquast
Copy link

jquast commented Jun 8, 2020

You have more than one version of python installed, and term-tris was installed through the bad one. Try using the “which” command to locate the bad one,

which python
which pip
devel-su which python
devel-su which pip
which term-tris
which glances

Etc. when you find the location of the bad python interpreter, you can call into the pip module to uninstall term-this from it, and use the good python interpreter to install term-tris

/usr/local/bad/python -m pip uninstall term-tris

/usr/local/good/python -m pip install term-tris

@Kabouik
Copy link
Author

Kabouik commented Jun 8, 2020

Oh, maybe that is where the issue is then. I didn't install term-tris, I just cloned the repository and was trying to run python3 main.py after installing asciimatics and keyboard using pip.

I did try installing term-tris using pip before, but no matching version was found, which is why I tried cloning and running the executable. Perhaps there is no version compatible with arm devices?

@jquast
Copy link

jquast commented Jun 8, 2020

You are right that term-tris is not on pypi, it is missing setup.py, too, so, the way you are running is fine.

but it should work fine on arm cpu as far as I can tell, anyway I’ve reached the end of my support contract lol, best wishes and good luck, “Tetris 99” is free on Nintendo switch with a Nintendo online account, I highly suggest that one, lol!

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

2 participants