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

Can't import CYLP #1

Open
mdavis-xyz opened this issue Oct 8, 2022 · 0 comments
Open

Can't import CYLP #1

mdavis-xyz opened this issue Oct 8, 2022 · 0 comments

Comments

@mdavis-xyz
Copy link

I'm trying to pull the docker image and then run the sample problem for the docs.

Steps to reproduce:

Dockerfile:

FROM coinor/cylp
RUN apt-get update 

COPY mwe.py ./
RUN python3 mwe.py

mwe.py

from CyLP.cy import CyClpSimplex
s = CyClpSimplex()
s.readMps('../input/netlib/adlittle.mps')
s.initialSolve()

Build with docker build .

Expected behavior

Docker builds sucessfully, which includes running mwe.py, which solves a sample problem.

Actual behavior

Docker build fails.

Step 5/11 : RUN python3 mwe.py
 ---> Running in 2e683a4a1f37
Traceback (most recent call last):
  File "mwe.py", line 1, in <module>
    from CyLP.cy import CyClpSimplex
ModuleNotFoundError: No module named 'CyLP'
The command '/bin/sh -c python3 mwe.py' returned a non-zero code: 1

If I change the case to cylp (different to the docs) then I get a different import error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/cbc/CyLP/cylp/cy/__init__.py", line 1, in <module>
    from .CyCoinIndexedVector import CyCoinIndexedVector
ModuleNotFoundError: No module named 'cylp.cy.CyCoinIndexedVector'

Can you please show what the contents of myscript.py was in the example, so I can see how it differs from the cylp example?

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

1 participant