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

Installation problem: No module named 'retro._retro' #12

Closed
Andrew-music opened this issue Apr 6, 2018 · 6 comments
Closed

Installation problem: No module named 'retro._retro' #12

Andrew-music opened this issue Apr 6, 2018 · 6 comments

Comments

@Andrew-music
Copy link

Andrew-music commented Apr 6, 2018

Issue summary

I'm trying to install this on an iMac (High Sierra). I've set up python 3.5 and a virtual environment, and followed the instructions to install lua5.1 and the binary for the project. All was well until I tried to use it! When I'm in the project directory and type import retro to python I get back the error below. I do have a retro folder, but retro._retro, which isn't anywhere in the installation.

$ python3
Python 3.5.0 (v3.5.0:374f501f4567, Sep 12 2015, 11:00:19)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import retro
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Workdisk/retro-master/retro/__init__.py", line 8, in <module>
    from retro._retro import Movie, RetroEmulator, core_path, data_path as _data_path
ImportError: No module named 'retro._retro'
>>>

A discord user suggested I cd to the parent directory first (cd ..), but that only changed the error.

>>> import retro
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/retro/__init__.py", line 8, in <module>
    from retro._retro import Movie, RetroEmulator, core_path, data_path as _data_path
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/retro/_retro.cpython-35m-darwin.so, 2): Symbol not found: __PyThreadState_UncheckedGet
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/retro/_retro.cpython-35m-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/retro/_retro.cpython-35m-darwin.so

System information

  • MacOS High Sierra 10.13.3
  • Python 3.5.0
  • Gym Retro binary for python 3.5 as downloaded on April 5, 2018
@cwgreene
Copy link
Contributor

cwgreene commented Apr 6, 2018

Question, what happens if you are not in the project directory?

@Andrew-music
Copy link
Author

From other directories, I get the same error as the second attempt above, after the cd .. - the ImportError: dlopen(... one.

@cwgreene
Copy link
Contributor

cwgreene commented Apr 6, 2018

Sorry, didn't see that. My bad!

The issue for the first error is caused by python looking at the source directory to resolve the retro import (which will not contain _retro, as it's a shared object that gets built and placed elsewhere). As you have seen, moving directories resolves that issue.

Once past the first issue, you're hitting this one:

cython/cython#1880

To confirm, you ran pip install -e . inside the directory. What happens in that directory if you run python3.5 setup.py install?

EDIT:
Which versions of python do you have installed on your machine?

@endrift
Copy link
Contributor

endrift commented Apr 6, 2018

What did you use to install Python 3.5? The builders use miniconda.

@Andrew-music
Copy link
Author

That was a great idea. I deleted my existing Python installs (not the native 2.7 version on the Mac, though) and installed a fresh Anaconda with Python 3.6. Then I downloaded the binary for that version from the document page, and I can import retro and run the list of games. So this may have been down to a confused Python installation, solved by just trashing everything and starting over. Thanks for the help! I think this particular issue can be considered closed.

@endrift endrift closed this as completed Apr 8, 2018
@jimhoggey
Copy link

i have the same problem gym retori is not found when running the randome agent python.
i ran the python3.5 setup.py install command but that did not work but python3.6 setup.py install did do something.

/EGG-INFO
copying gym_retro.egg-info/top_level.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.12-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
retro.pycache.init.cpython-36: module references file
retro.pycache._retro.cpython-36: module references file
retro.data.pycache.init.cpython-36: module references file
creating dist
creating 'dist/gym_retro-0.6.0.dev45+g5af5926-py3.6-macosx-10.12-x86_64.egg' and adding 'build/bdist.macosx-10.12-x86_64/egg' to it
removing 'build/bdist.macosx-10.12-x86_64/egg' (and everything under it)
Processing gym_retro-0.6.0.dev45+g5af5926-py3.6-macosx-10.12-x86_64.egg
creating /usr/local/lib/python3.6/site-packages/gym_retro-0.6.0.dev45+g5af5926-py3.6-macosx-10.12-x86_64.egg
Extracting gym_retro-0.6.0.dev45+g5af5926-py3.6-macosx-10.12-x86_64.egg to /usr/local/lib/python3.6/site-packages
Adding gym-retro 0.6.0.dev45+g5af5926 to easy-install.pth file

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

4 participants