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

Issue running pyvroom #85

Open
murali731 opened this issue Jul 24, 2023 · 16 comments
Open

Issue running pyvroom #85

murali731 opened this issue Jul 24, 2023 · 16 comments

Comments

@murali731
Copy link

Hi, I tried running the example code given in the documentation but encountered errors. Please let me know how to resolve this.

Find below the Python code I have used.


import vroom

problem_instance = vroom.Input()

problem_instance.set_durations_matrix(
profile="car",
matrix_input = [[0, 2104, 197, 1299],
[2103, 0, 2255, 3152],
[197, 2256, 0, 1102],
[1299, 3153, 1102, 0]],
)

problem_instance.add_vehicle([vroom.Vehicle(47, start=0, end=0),
vroom.Vehicle(48, start=2, end=2)])

problem_instance.add_job([vroom.Job(1414, location=0),
vroom.Job(1515, location=1),
vroom.Job(1616, location=2),
vroom.Job(1717, location=3)])

solution = problem_instance.solve(exploration_level=5, nb_threads=4)

print('Done')


I tried running the same code with different versions of Python.

Error with Python version 3.7.1

C:\Project\venvs\work_1\Scripts\python.exe C:\Project\practice_work\vrp_vroom\test.py
Traceback (most recent call last):
File "C:\Project\practice_work\vrp_vroom\test.py", line 1, in
import vroom
File "C:\Project\venvs\work_1\lib\site-packages\vroom_init_.py", line 14, in
from .input.input import Input
File "C:\Project\venvs\work_1\lib\site-packages\vroom\input\input.py", line 6, in
from numpy.typing import ArrayLike
ModuleNotFoundError: No module named 'numpy.typing'

Error with Python version 3.8.10:

C:\Project\venvs\work_2\Scripts\python.exe C:\Project\practice_work\vrp_vroom\test.py
Traceback (most recent call last):
File "C:\Project\practice_work\vrp_vroom\test.py", line 5, in
problem_instance.set_durations_matrix(
File "C:\Project\venvs\work_2\lib\site-packages\vroom\input\input.py", line 283, in set_durations_matrix
matrix_input = _vroom.Matrix(numpy.asarray(matrix_input, dtype="uint32"))
RuntimeError: Incompatible buffer format!

Operating system: Windows 10, 64-bit

@jonathf
Copy link
Collaborator

jonathf commented Jul 25, 2023

Do you mind updating and reporting the version of Numpy? I suspect it is out of date?

@jfulem
Copy link

jfulem commented Oct 11, 2023

I have the same issue. Numpy version 1.26.0, pyvroom 1.13.3. Win 11, 64-bit. I'm using python 3.10.11.

@jfulem
Copy link

jfulem commented Oct 12, 2023

@jcoupey, please, can you help me with this issue specific to Win OS?

@jonathf
Copy link
Collaborator

jonathf commented Oct 12, 2023

There are two different errors here. Are you saying that you are getting the error equal to 3.7 or 3.8?

@jfulem
Copy link

jfulem commented Oct 12, 2023

Yes

set_durations_matrix
matrix_input = _vroom.Matrix(numpy.asarray(matrix_input, dtype="uint32"))
RuntimeError: Incompatible buffer format!

@jonathf
Copy link
Collaborator

jonathf commented Oct 13, 2023

I can't reproduce so I'm not completly sure, but I suspect that the underlying data types are mismatching.

I've made a experimental release for 1.13.4-dev1 which you can try out where I replace uint32 with generic unsigned integer.

Let me know if that solves the issue.

@jfulem
Copy link

jfulem commented Oct 13, 2023

Can I install via pip?

@jonathf
Copy link
Collaborator

jonathf commented Oct 13, 2023

yes. pip install pyvroom==1.13.4.dev1.

@jfulem
Copy link

jfulem commented Oct 13, 2023

Hmm, I'm getting still this:
matrix_input = _vroom.Matrix(numpy.asarray(matrix_input, dtype="u4"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Incompatible buffer format!

@jfulem
Copy link

jfulem commented Oct 13, 2023

And @jonathf you can't reproduce on windows 11? Which python? I tried
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]

@jonathf
Copy link
Collaborator

jonathf commented Oct 13, 2023

That is unfortunate. I don't have a windows machine.

@nilsnolde, any chance you have time to try diagnose this issue?

@jfulem
Copy link

jfulem commented Oct 13, 2023

@jonathf on Ubuntu 20.04 or 22.04 it works with no issues. But we want to support Windows as well :-(.

@nilsnolde
Copy link
Collaborator

I’m currently taking a bit of distance to unpaid work for the rest of the year tbh. That is to say, you can contact me on [email protected] @jfulem if you want commercial support on this. At some point we’ll deal with this too, but that’s well into next year.

@nilsnolde
Copy link
Collaborator

Fwiw, the tests should probably run on windows as well. For FOSS it’s not counting towards GitHub limits @jonathf. OSX should mostly be fine when Linux is ok since the tool chains are so similar, but win is a very different STL.

@jfulem
Copy link

jfulem commented Oct 13, 2023

@nilsnolde OK, fair enough. I don't need commercial support.

@jonathf
Copy link
Collaborator

jonathf commented Oct 16, 2023

@nilsnolde, very understandable.

Yeah, activating the tests for windows should be done. We chose against it when we started as I didn't want to use up vrooms entired budget, but that isn't as much of an issue anymore as the activity is now much lower. I'll get to that one of these days.

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