floross/docker-readthedocs

Build fails with python3

p3trus opened this issue · 6 comments

The build process fails when the build environment is changed to python3.

I get the following error

[rtd-command-info] start-time: 2018-10-30T11:10:38.801231, end-time: 2018-10-30T11:10:38.813137, duration: 0, exit-code: -1
python3.5 -mvirtualenv --no-site-packages --no-download /app/user_builds/traceshader/envs/latest
Traceback (most recent call last):
  File "/app/readthedocs/doc_builder/environments.py", line 150, in run
    env=environment,
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Hi @p3trus, are you trying to build python3 project? Is the code open?

Yes I tried to build a python3 project. I will try to create a small testcase to see if It is reproducible. MIt may take me a due to timeconstraints.

I can confirm this error.

Is there a solution to this?
I think my problem mainly involves the install of a python3 package, pydna, which is problematic.

You can resolve this issue if you base the docker image on one off the readthedocs build images in
https://hub.docker.com/r/readthedocs/build/ .
I think I tried the 3.0 image.

Currently its based on debian:stretch-slim

Hi,
I changed

#FROM debian:stretch-slim
FROM readthedocs/build:3.0
docker-compose down
docker-compose up

I set up my project with cpython 3.x (project is python3).

This gives me an error when building:

Traceback (most recent call last):
  File "/app/readthedocs/doc_builder/environments.py", line 150, in run
    env=environment,
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Which is a bit weird as it should by python3...

When i use cpython2.x interpreter for env (in the readthedocs admin page)

Collecting pypandoc (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/71/81/00184643e5a10a456b4118fc12c96780823adb8ed974eb2289f29703b29b/pypandoc-1.4.tar.gz
Collecting pydna (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/67/f2/552bd375666bb3e2ff4b3ec418ed2d5bbe1140847075d7c2d682435153c8/pydna-2.0.3.zip
    Complete output from command python setup.py egg_info:
    warning: pypandoc module not found, could not convert Markdown to RST
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ISii8l/pydna/setup.py", line 20, in <module>
        with open("README.md", encoding="utf-8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ISii8l/pydna/
You are using pip version 9.0.3, however version 19.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command. 

I added specifically added pypandoc to the the requirements of my project, but still it complains it doesn't find it.
The encoding problem is because it is python3 code and python2 code...

So I'm a bit stuck. What am I doing wrong?