openai / go-vncdriver

Fast VNC driver
MIT License
123 stars 60 forks source link

[Errno 2] No such file or directory #25

Open katk0smos opened 7 years ago

katk0smos commented 7 years ago

Trying to install universe on a raspberry pi 3 model b, but it wouldn't install. So I try compiling from source. It gave the same error, so here it is. I installed golang's official armV6 binary from the golang site for linux. I'm running Raspbian (Based on Debian) Pixel from November 2016, if that helps. I've tried debugging the error, but obviously no progress was made, since I'm posting this.

EDIT: Forgot to add that I couldn't install libjpeg-turbo8-dev from my repos, but I could install libjpeg8-dev. Really not sure how that could affect anything, but it didn't change the error message whatsoever.

Env info:

export GOPATH='/home/pi/go-vncdriver/.build'
export CGO_CFLAGS='-I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7'
export CGO_LDFLAGS='//usr/lib/arm-linux-gnueabihf/libjpeg.so -L/usr/lib -lpython2.7'
export GO15VENDOREXPERIMENT='1'

Running build with OpenGL rendering.
Building with OpenGL: GOPATH=/home/pi/go-vncdriver/.build go build -buildmode=c-shared -o go_vncdriver.so github.com/openai/go-vncdriver. (Set GO_VNCDRIVER_NOGL to build without OpenGL.)
Traceback (most recent call last):
  File "build.py", line 121, in <module>
    main()
  File "build.py", line 20, in main
    build()
  File "build.py", line 112, in build
    if not build_gl():
  File "build.py", line 100, in build_gl
    return not subprocess.call(cmd.split())
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
tlbtlbtlb commented 7 years ago

The error "No such file or directory" is from the go compiler (named go). Presumably running go version at the command prompt would also say go: command not found. So however you installed go, it didn't work.

katk0smos commented 7 years ago
$ go version
go version go1.8 linux/arm

It's installed from the official linux arm binary, to /usr/local/go. I don't see where the problem could be coming from.

EDIT:

sudo go version
sudo: go: command not found

Since I'm running both the universe install and the go-vncdriver install with sudo, that would most likely affect the search directory. I could possibly do sudo -i and see if that makes a difference after exporting the go installation paths and all that.

katk0smos commented 7 years ago

NOTE: I'm testing that universe is working using the example test script from the README.md file.

Running with sudo -i seems to have fixed the issue with universe, but now twisted is spitting out errors. It gave an error about txaio not being installed, so I installed that with pip install txaio. Ran the universe example test script from the readme again, and it spat out this.

$ python universe-test.py 
Traceback (most recent call last):
  File "universe-test.py", line 2, in <module>
    import universe  # register the universe environments
  File "/home/pi/universe/universe/__init__.py", line 22, in <module>
    from universe import error, envs
  File "/home/pi/universe/universe/envs/__init__.py", line 1, in <module>
    import universe.envs.vnc_env
  File "/home/pi/universe/universe/envs/vnc_env.py", line 9, in <module>
    from universe import error, pyprofile, rewarder, spaces, twisty, vectorized, vncdriver
  File "/home/pi/universe/universe/rewarder/__init__.py", line 1, in <module>
    from universe.rewarder.rewarder_session import RewarderSession
  File "/home/pi/universe/universe/rewarder/rewarder_session.py", line 8, in <module>
    from twisted.internet import defer, endpoints
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/endpoints.py", line 52, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_sslverify.py", line 38, in <module>
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
katk0smos commented 7 years ago

Technically though, the problem with go-vncdriver was solved, and these problems are coming from universe. Should I post an issue on the universe github page, or can this remain open here, since both universe and this are made by you wonderful people?

tlbtlbtlb commented 7 years ago

The last bug is a problem with Twisted. You can probably reproduce with python -c 'from twisted.internet import defer, endpoints'. It's most likely an incompatible version of OpenSSL. pip install --upgrade OpenSSL might possibly fix it.

katk0smos commented 7 years ago

I fixed the problem. Ran into another which was with the python module backports.ssl_match_hostname not being installed, so I fixed that. Now I'm running into problems with docker. Yes it's installed. (sudo apt-get install docker) But, there is no command called docker. I may be missing something, but here's a log.

$ docker ps
bash: docker: command not found

Also, trying to run the example script results in this.

$ sudo python universe-test.py 
[2017-02-04 12:29:40,213] Making new env: flashgames.DuskDrive-v0
[2017-02-04 12:29:40,239] Writing logs to file: /tmp/universe-11044.log
Traceback (most recent call last):
  File "universe-test.py", line 5, in <module>
    env.configure(remotes=1)  # automatically creates a local docker container
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/pi/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/pi/universe/universe/wrappers/render.py", line 18, in _configure
    super(Render, self)._configure(**kwargs)
  File "/home/pi/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/pi/universe/universe/wrappers/throttle.py", line 27, in _configure
    super(Throttle, self)._configure(**kwargs)
  File "/home/pi/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/pi/universe/universe/envs/vnc_env.py", line 199, in _configure
    use_recorder_ports=record,
  File "/home/pi/universe/universe/remotes/build.py", line 19, in build
    n=n,
  File "/home/pi/universe/universe/remotes/docker_remote.py", line 44, in __init__
    self._assigner = PortAssigner(reuse=reuse)
  File "/home/pi/universe/universe/remotes/docker_remote.py", line 162, in __init__
    self.client, self.info = get_client()
  File "/home/pi/universe/universe/remotes/docker_remote.py", line 156, in get_client
    return docker.Client(base_url=host, version=client_api_version), info
AttributeError: 'module' object has no attribute 'Client'

Also, the python module is actually pyopenssl, instead of OpenSSL

tlbtlbtlb commented 7 years ago

apt-get install docker is some GNOME UI component. You need apt-get install docker.io. It may not be available for ARM without some experimental kernel components. At any rate, you won't be able to execute the docker containers on an ARM machine because they contain intel binaries. The agent side should work on ARM, but not the environments. So you'll need an Intel box on the same LAN to run the docker remotes.

katk0smos commented 7 years ago

That's a coincidence. I actually just searched the raspberry pi's default repos for docker, and started installing docker.io. Thanks for the info. And even after installing docker.io, I'm still getting the same error. Could that still be due to the intel binaries not being present?

tlbtlbtlb commented 7 years ago

This:

    return docker.Client(base_url=host, version=client_api_version), info
AttributeError: 'module' object has no attribute 'Client'

must mean that Python has a bad docker module installed. It should be this one: https://pypi.python.org/pypi/docker-py/1.10.3. If you don't use the Universe install scripts, it's easy to end up with this one instead: https://pypi.python.org/pypi/docker/2.1.0

katk0smos commented 7 years ago

I seriously feel like I may have completely screwed up the python and/or pip installation on this raspberry pi.

$ sudo pip install docker-py
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead

EDIT: Same error for anything pip related. Sudo or not.

EDIT 2:

$ python version
python: can't open file 'version': [Errno 2] No such file or directory

EDIT 3: Scratch all of the above. Fixed it using this. Anyways, just found out that Universe actually does rely on docker, not docker-py. Wierd.

katk0smos commented 7 years ago

So since my pip is working again, and my universe install relies on docker and not docker-py, what do I do to fix the error?

tlbtlbtlb commented 7 years ago
pip uninstall docker
pip install docker-py

On Fri, Feb 17, 2017 at 4:33 PM, TheWaffleDimension < notifications@github.com> wrote:

So since my pip is working again, and my universe install relies on docker and not docker-py, what do I do to fix the error?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openai/go-vncdriver/issues/25#issuecomment-280803954, or mute the thread https://github.com/notifications/unsubscribe-auth/AANZdD27mDmDBS-o4xAvtW58R3fZWSLBks5rdjxLgaJpZM4MD4yF .

-- Trevor Blackwell tlb@openai.com 650 776 7870

katk0smos commented 7 years ago

It gives out an error. I ran those commands multiple times.

$ python universe-test.py 
Traceback (most recent call last):
  File "universe-test.py", line 2, in <module>
    import universe  # register the universe environments
  File "/home/pi/universe/universe/__init__.py", line 22, in <module>
    from universe import error, envs
  File "/home/pi/universe/universe/envs/__init__.py", line 1, in <module>
    import universe.envs.vnc_env
  File "/home/pi/universe/universe/envs/vnc_env.py", line 10, in <module>
    from universe import remotes as remotes_module
  File "/home/pi/universe/universe/remotes/__init__.py", line 3, in <module>
    from universe.remotes.docker_remote import DockerManager
  File "/home/pi/universe/universe/remotes/docker_remote.py", line 12, in <module>
    import docker
ImportError: No module named docker
tlbtlbtlb commented 7 years ago

When you ran pip install docker-py, what did it print? If it doesn't install, you should ask the docker-py people at https://github.com/docker/docker-py/issues

katk0smos commented 7 years ago

It installed correctly. I tried another reinstall out of frustration and it worked.. except that the version is 1.15, and I need 1.18... I'll look to see if I can build docker for arm myself.

EDIT: Sorry about not providing a log, but I can't do it now, either. I'm away from the raspberry pi, and I don't have port 22 forwarded on my network for any of my machines.