Skip to content

Issue running pyvroom #85

@murali731

Description

@murali731

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions