Post Ai5jPcBiNYarLMd6XY by tomjennings@tldr.nettime.org
(DIR) More posts by tomjennings@tldr.nettime.org
(DIR) Post #Ai5eejhoD9pLES24kS by tomjennings@tldr.nettime.org
2024-05-20T18:04:19Z
0 likes, 0 repeats
Can anyone point me to an overview or description of wtf python is doing with pip vs. system-installed? on debian trixie.I use gcloud for my static websites, and the google gsutil uses an external program, crcmod, to generate checksums.crcmod needs to be installed via pip, but all of my python is installed via the debian system. They two are not compatible apparently.I'm obviously not a python programmer.I won't ask why there's parallel ecosystems... is there a way out of this mess?
(DIR) Post #Ai5f4QYK2nltMKqUcq by williampietri@sfba.social
2024-05-20T18:08:55Z
0 likes, 0 repeats
@tomjennings I think of them as complimentary. Typically I'll use poetry to create an environment for a specific project, which falls back on the system libraries for more general stuff. IIRC, the poetry docs are pretty good, so that might be a good start for you?
(DIR) Post #Ai5f4yNsG9cGHmDd3o by phf@mastodon.sdf.org
2024-05-20T18:08:58Z
0 likes, 0 repeats
@tomjennings I am not a Python expert either but it seems to me that the "safe" approach is to use neither apt nor pip directly but to set up a "virtual environment" and install everything you need into that via a "special pip" that comes with "venv"? Can't really put a tutorial here but ... this might help? https://docs.python.org/3/library/venv.html
(DIR) Post #Ai5fcFhMuE0ZXeCpMW by tomjennings@tldr.nettime.org
2024-05-20T18:15:04Z
0 likes, 0 repeats
@phf @williampietri I'm trying to work with an existing installation of Google's gsutils, and adding the complexity of a another environment to or container solve a problem I already don't understand probably won't help me. When I rtfm pip it tells me how to use it; what's missing is context, why does pip exist and how is it incompatible with python stuff installed via apt. I guess that's the question I asked poorly.
(DIR) Post #Ai5g3S1BD5eBZKRSJk by phf@mastodon.sdf.org
2024-05-20T18:19:55Z
0 likes, 0 repeats
@tomjennings @williampietri I am sorry, I interpreted it as "Can I avoid this cleanly somehow?" and that's what I replied to. If that crcmod is not available via apt and if the existing gsutils cannot be replaced with one from pip, then you can only try to "mix and match" the two and hope for the best. But that's probably something neither side will be very happy with. Sadly I have nothing better to offer, this Python stuff is messy. 😢 1/2
(DIR) Post #Ai5gsXyunWCophkNcG by viq@social.hackerspace.pl
2024-05-20T18:28:57Z
0 likes, 0 repeats
@tomjenningsCheck out pipx, it does some magic to install cleanly python commands to make them available to rest of system
(DIR) Post #Ai5gtwzdI5TQh7kgJU by tomjennings@tldr.nettime.org
2024-05-20T18:29:28Z
0 likes, 0 repeats
@phf Ahh OK. Now I understand the basic problem. That's a huge help.It's probably insoluble for me then; I'm not spending the time to untangle THAT problem!As it is, gsutil does a checksum calc that "works" but is exceedingly slow, so updates that would take ~60 seconds (shell script) take 15+ minutes. So I'm not dead in the water, just up shit creek with a small paddle.Thanks for the explanation!
(DIR) Post #Ai5gzBy72WMoaWXYZ6 by viq@social.hackerspace.pl
2024-05-20T18:29:54Z
0 likes, 0 repeats
@tomjenningsCheck out pipx, it does some magic to install cleanly python commands to make them available to rest of system@phf
(DIR) Post #Ai5h478GRqiH2KdTEW by sabogato@sunbeam.city
2024-05-20T18:31:17Z
0 likes, 0 repeats
@tomjennings I'd assume that it shouldn't matter who installs crcmod if it is in your PATH. Could you not install this package? 1.7 is the latest version according to PyPIhttps://packages.debian.org/trixie/python/python3-crcmod
(DIR) Post #Ai5hcXakZxU6weNLuK by kishcom@kish.social
2024-05-20T18:37:30Z
0 likes, 0 repeats
@tomjennings I hate fighting with the system-installed version of python (and I tend to break things there).I use ASDF-VM to isolate whatever version of Python (and a venv to further isolate pip packages too!). It's a great tool.
(DIR) Post #Ai5iStX6FPHU3JdGsK by tomjennings@tldr.nettime.org
2024-05-20T18:46:58Z
0 likes, 0 repeats
@sabogato THIS! Right -- I was hung up on the google error message and not thinking ahead that it's simply a missing executable. I thought I was looking for some python package or something.apt install python3-crcmodsolved the problem. Interestingly, it's still not in my path (crcmod, or python3-crcmod) but gsutil finds it.THANK YOU!!
(DIR) Post #Ai5jPbf6KoVPiDN3ho by viq@social.hackerspace.pl
2024-05-20T18:32:49Z
0 likes, 0 repeats
@tomjenningsThough only as that user, and probably requires full shell to load the variables that set the `$PATH` properly.On the other hand, do you know whether gsutil is in python? If so, you could probably ditch the system version, and install that and crcmod in same environment using e.g. poetry.@phf
(DIR) Post #Ai5jPcBiNYarLMd6XY by tomjennings@tldr.nettime.org
2024-05-20T18:57:35Z
0 likes, 0 repeats
@viq @phf I'm fairly sure the google cloud tools are all python.Lol, a million years ago, when python and perl were both new, i was deciding between them which I'd use, when in python 2 they changed the way that integer arithmetic worked. That made me choose perl. (Also, less rationally, the weird shortcut-y text format indent stuff reminded me too much of FORTRAN's position-dependent stuff, the character/token stream stuff so lovely, pushed me over too.)
(DIR) Post #Ai5rjBs8jGZb9TJq1Q by sabogato@sunbeam.city
2024-05-20T20:30:46Z
0 likes, 0 repeats
@tomjennings out of curiosity I checked. gsutil is importing the crcmod Python package not calling a command called crcmod. I don't think there is a crcmod command. I made the wrong assumption that gsutil was trying to call a executable.Anyway, I'm happy I was able to help.
(DIR) Post #Ai5vINfZ9v8NjouRP6 by tomjennings@tldr.nettime.org
2024-05-20T21:10:46Z
0 likes, 0 repeats
@sabogato Oh! Wow thanks doubly then! Ok I will have to investigate gsutil. It behooves me to know more about it.
(DIR) Post #Ai5vL0fB9UfzFoyvvk by tomjennings@tldr.nettime.org
2024-05-20T21:11:14Z
0 likes, 0 repeats
@sabogato Oh look! Two wrongs made a right.
(DIR) Post #Ai6zXfXdaSYQUBhqbY by viq@social.hackerspace.pl
2024-05-21T09:32:59Z
0 likes, 0 repeats
@tomjenningsSo you could get poetry installed, either from packages or via pipx, and then set up a project with your tools in placehttps://python-poetry.org/docs/basic-usage/@phf