-
Notifications
You must be signed in to change notification settings - Fork 6
Cannot install for Python 3.12 #35
Comments
Did you try making an environment with python 3.11 to test your own theory? also, what platform are you on? |
Yeah we don’t publish wheels for 3.12 yet. There’s no particular reason, I just didn’t touch the project since it came about. I can try later and hope it works without any changes. |
Yes, I did. And it works.
I was using pyvalhalla under Python 3.11 for a year, but Archlinux updated to 3.12 recently.
I disagree with the first part of the sentence. There is a very good reason to support 3.12 as it is the latest stable Python version, which was just included into Ubuntu 24.04 LTS. As for the second part, I can perfectly understand if you don't have time for this project (anymore).
Thank you. |
that’s not what I was referring to. I meant that there no reason why we didn’t publish wheels for that yet other than not touching the project for a while, there was no other need to. anyways, we’ll try soon. I’m on Manjaro, their arch mirrors should update soon as well then, but so far we’re on 3.11. |
at least it worked for linux. we'll see now if mac/win also works. then I'll publish them for 3.12. |
it won't fix for now, see #37 for reasoning |
Is there an update to this? Or at least a way for the Linux users to access the fixed version? |
to respond quickly, a way you can access them yourself is to build from https://github.com/valhalla/valhalla with python bindings on. To make things even simpler, you can just swap the static libraries that you build with a current pyvalhalla install. Just need to make sure that the python in CMakeList is pathed to a version of python 3.12 |
First of all, thank you for the quick reply. However, I am still unsure what to do.
This seems to be the main Valhalla project. Is it really necessary to build everything if I only want to use the Python bindings? Seems like overkill.
... so I still need to build everything?
For someone mainly working with Python, this is majorly confusing. Going by the Valhalla docu, these are steps I would take:
Not sure WHAT it installs (and if only into build or sneaking somewhere else as well) and what of it I actually need. Generating Python bindings seems to be the default in the CMakeList.txt, but I can't find where to specify the Python version to use (although there is only one installed). Then...? I still have a working pyvalhalla installation in an old virtual Python environment. I think it's only referenced in |
You can turn off a bunch of stuff that you don't need yes through the CMakeList parameters. I also found it a bit tricky to make it choose the right python environment so I manually set it.
When you copied over the .so did you rename it to be the same as in the valhalla folder in site packages. it sounds like you're very close to having it right. EDIT: the reason I say to use the existing ones for pyvalhalla instead of the python bindings ones is because it didn't work out the box for me. I think that the maker for this repo probably encountered and fixed various issues and modified things a little possibly |
Good to know. I will have a closer look at the options in CMakeLists, but without intimate knowledge of valhalla I doubt it will make much sense to me. Probably faster to let it built stuff than trying to understand why it builds stuff.
Shouldn't be a problem for me, I only have Python 3.12 installed.
So far, I haven't built anything, just copied three folders over from the old virtual environment into the new one to see what happens. So no renaming (yet). I wanted to wait for confirmation if the steps are going into the right direction before building. |
the python bindings will build into here (for reference)
You can turn these two off as I believe they are basically making routing tiles and the http routing service I think (if I'm not mistaken).. maybe you may even like to use these.
I would recommend trying to build it and learning by trial and error really, nothing to lose. I suspect that If it goes wrong, delete the build folder and try and figure out where it all went wrong, and build again EDIT: also |
Yep for now you need to build valhalla yourself. You can just pass the target to CMake, so it will only build what's necessary:
Also, if you want to install it into a virtual environment, it should be sufficient to activate that env in your shell when configuring the build:
|
For future reference, this is what I did and seemed to work:
In the meantime, copy pyvalhalla.libs, pyvalhalla-3.2.0.dist-info and valhalla directories from old virtual environment into new one. After building has finished, copy build/src/bindings/python/valhalla/python_valhalla.cpython-312-x86_64-linux-gnu.so to the virtual environment lib/python3.12/site-packages/valhalla/. The old .so file can be deleted. I had slight issues with imports, so I replaced
and
(exactly as in the new Valhalla Python files). There were some other differences in the Valhalla Python files, for example, config.get_config() has lost the verbose argument. Therefore, I am using the old Python files with the modified imports, which works for my purposes. Sidenote: cmake does not know target argument |
Thank you for posting back the steps to build the 3.12 bindings. Its been on my list of look into that as well. (Though for me I need Windows build). But good to have a more details set of steps. |
I use poetry, but I think the problem is with the Python version (3.12), as I cannot install with pip either.
The text was updated successfully, but these errors were encountered: