[contestms] Re: Issue with python+numpy and cms v1.2

  • From: Stefano Maggiolo <s.maggiolo@xxxxxxxxx>
  • To: contestms <contestms@xxxxxxxxxxxxx>
  • Date: Mon, 10 Apr 2017 22:31:57 +0100

Ok, thanks. How I would proceed: change keep_sandbox to true, find the
sandbox where it is not working, try to execute the isolate command
manually, see if it still fails. If so, look at the mapped directories, and
try to see if numpy is in one of these or not. Redo adding the required
directory to the arguments.

Or maybe it's an entirely different issue. :(

On 10 April 2017 at 20:11, Claudio Alvarez <calvarez1@xxxxxxxxxxx> wrote:

Thank you Stefano. I am using Ubuntu Server 16.04 LTS, everything vanilla,
with no virtual environments for Python.
I will continue to tinker with this and see what happens. I will share my
solution if I manage to get numpy working.

------------------------------
*Claudio Alvarez Gómez, Ph.D.*
Profesor Asistente, Ciencias de la Computación
Facultad de Ingeniería y Ciencias Aplicadas
Universidad de los Andes
Av. Mons. Álvaro del Portillo 12.455
Las Condes, Santiago, Chile
Teléfono: +562 2618 1323
http://www.uandes.cl

On Sun, Apr 9, 2017 at 2:01 AM, Stefano Maggiolo <s.maggiolo@xxxxxxxxx>
wrote:

It works for me - maybe the reason is that you use a virtualenv for
running CMS, and you installed numpy only there? The libraries visibile to
the submission are those installed in the system, which might be a
different set than those available to CMS.

Another possibility is that your distribution requires a different
"allowed path". What distro are you using?

On 5 April 2017 at 19:18, Claudio Alvarez <calvarez1@xxxxxxxxxxx> wrote:

Hi all,

I just ran a contest in which Python was allowed, and a student of mine
submitted code that included numpy. Execution failed because Python was
unable to find numpy when running within isolate:

[stderr.txt]
Traceback (most recent call last):
  File "M2A1.py", line 7, in <module>
ImportError: No module named numpy

[submitted program]
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 04 15:33:22 2017

@author: lab108
"""
from numpy import math

-----

Compilation commands are as follows:
/usr/bin/python2 -m py_compile M2A1.py
/bin/mv M2A1.pyc M2A1

I have installed numpy and scipy in all servers with pip, however, I
still get the same error!
Is this error somehow related to the compilation command?

Thanks for any help.

Best,

------------------------------
*Claudio Alvarez Gómez, Ph.D.*
Profesor Asistente, Ciencias de la Computación
Facultad de Ingeniería y Ciencias Aplicadas
Universidad de los Andes
Av. Mons. Álvaro del Portillo 12.455
Las Condes, Santiago, Chile
Teléfono: +562 2618 1323
http://www.uandes.cl




Other related posts: