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

ImportError: No module named MAMEToolkit.sf_environment #2

Closed
loretoparisi opened this issue Nov 5, 2018 · 7 comments
Closed

ImportError: No module named MAMEToolkit.sf_environment #2

loretoparisi opened this issue Nov 5, 2018 · 7 comments

Comments

@loretoparisi
Copy link

Hello, just installed on macOS:

$ sudo -H pip install MAMEToolkit
Password:
Collecting MAMEToolkit
  Downloading https://files.pythonhosted.org/packages/db/ad/dfa33e9ec2e96001f73b99b528af06fe32f39722a27123393f034bc4d038/MAMEToolkit-1.0.1.tar.gz (59.9MB)
    100% |████████████████████████████████| 59.9MB 60kB/s 
Building wheels for collected packages: MAMEToolkit
  Running setup.py bdist_wheel for MAMEToolkit ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/39/f7/7e/d0b7f5568ba6535eb224fa2238f6f061d814b89909e70b6656
Successfully built MAMEToolkit
Installing collected packages: MAMEToolkit
Successfully installed MAMEToolkit-1.0.1
ip-192-168-1-103:~ loretoparisi$ python
Python 2.7.15 (default, May 10 2018, 18:56:10) 
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> from MAMEToolkit.sf_environment import Environment
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named MAMEToolkit.sf_environment

And therefore tried virtualenv:

$ virtualenv venv
New python executable in /Users/loretoparisi/Documents/Projects/AI/games/venv/bin/python
Installing setuptools, pip, wheel...done.
ip-192-168-1-103:games loretoparisi$ . venv/bin/activate
(venv) ip-192-168-1-103:games loretoparisi$ pip install MAMEToolkit
Collecting MAMEToolkit
  Downloading https://files.pythonhosted.org/packages/db/ad/dfa33e9ec2e96001f73b99b528af06fe32f39722a27123393f034bc4d038/MAMEToolkit-1.0.1.tar.gz (59.9MB)
    100% |████████████████████████████████| 59.9MB 133kB/s 
Building wheels for collected packages: MAMEToolkit
  Running setup.py bdist_wheel for MAMEToolkit ... done
  Stored in directory: /Users/loretoparisi/Library/Caches/pip/wheels/39/f7/7e/d0b7f5568ba6535eb224fa2238f6f061d814b89909e70b6656
Successfully built MAMEToolkit
Installing collected packages: MAMEToolkit
Successfully installed MAMEToolkit-1.0.1
(venv) ip-192-168-1-103:games loretoparisi$ python
Python 2.7.10 (default, Aug 17 2018, 17:41:52) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from MAMEToolkit.sf_environment import Environment
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/loretoparisi/Documents/Projects/AI/games/venv/lib/python2.7/site-packages/MAMEToolkit/__init__.py", line 1, in <module>
    from MAMEToolkit import emulator
  File "/Users/loretoparisi/Documents/Projects/AI/games/venv/lib/python2.7/site-packages/MAMEToolkit/emulator/__init__.py", line 2, in <module>
    from MAMEToolkit.emulator.Emulator import Emulator, list_actions, see_games, run_cheat_debugger
  File "/Users/loretoparisi/Documents/Projects/AI/games/venv/lib/python2.7/site-packages/MAMEToolkit/emulator/Emulator.py", line 59
    pipes_path = f"{os.path.dirname(os.path.abspath(__file__))}/mame/pipes"
                                                                          ^
SyntaxError: invalid syntax
@M-J-Murray
Copy link
Owner

Unfortunately the library can only be installed on Linux systems. The frame data is passed from the emulator to the library using linux fifo pipes.

@loretoparisi
Copy link
Author

@M-J-Murray ah so! Wonder if it would works with a docker-ized version of MAME like DAME...

@kyuhyoung
Copy link

>>> import MAMEToolkit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kevin/.local/lib/python3.5/site-packages/MAMEToolkit/__init__.py", line 1, in <module>
    from MAMEToolkit import emulator
  File "/home/kevin/.local/lib/python3.5/site-packages/MAMEToolkit/emulator/__init__.py", line 2, in <module>
    from MAMEToolkit.emulator.Emulator import Emulator, list_actions, see_games, run_cheat_debugger
  File "/home/kevin/.local/lib/python3.5/site-packages/MAMEToolkit/emulator/Emulator.py", line 59
    pipes_path = f"{os.path.dirname(os.path.abspath(__file__))}/mame/pipes"
                                                                          ^
SyntaxError: invalid syntax

Same error.
Ubuntu 16.04.

@M-J-Murray
Copy link
Owner

Which version of Python are you running? I should probably state this only works on python 3.6+

@kyuhyoung
Copy link

Which version of Python are you running? I should probably state this only works on python 3.6+

Mine was 3.5.
With python 3.6, the above error does not occur anymore. Thanks.

@loretoparisi
Copy link
Author

@M-J-Murray so to recap, it would work in docker with python 3.6. Where you aware of the dockerized MAME version (DAME)? Thanks

@M-J-Murray
Copy link
Owner

I was not aware of the dockerized version of mame. The problem is not caused by mame. The library itself uses Linux fifo pipes. I will have to find another mechanism similar to fifo pipes that works on every OS.

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