Using C_INCLUDE_PATH to install Python packages
I tried to install my datasette-bplist plugin today in a fresh Python 3.10 virtual environment on macOS and got this error: Thanks to StackOverflow I figured out a workaround.
105 posts tagged “python”.
I tried to install my datasette-bplist plugin today in a fresh Python 3.10 virtual environment on macOS and got this error: Thanks to StackOverflow I figured out a workaround.
I was getting this intermittent error running my Datasette test suite: OSError: Errno 24 Too many open files To figure out what was going on, I used the package and its method.
Today I learned how to use the Python trace module to output every single executed line of Python code in a program - useful for figuring out exactly when a crash or infinite loop happens.
Pyodide provides "Python with the scientific stack, compiled to WebAssembly" - it's an incredible project which lets you run a full working Jupyter notebook, complete with complex packages such as…
I wanted to upgrade my git-history installation to a new alpha version. doesn't work for that, because it upgrades to the most recent stable version - but I wanted the alpha.
I wanted to produce the following output from a command-line tool: But I wanted to do it from a streaming iterator - without first buffering the entire output in an in-memory Python list and calling…
I've been trying to get my head around ColBERT. ColBERT is a fast and accurate retrieval model, enabling scalable BERT-based search over large text collections in tens of milliseconds.
Users were reporting the following error using to import some CSV files: csv.Error: field larger than field limit (131072) It turns out the Python standard library CSV module enforces a default field…
This issue by Parand Darugar pointed out that Datasette doesn't currently run on Linux systems with FIPS enabled, due to the way it uses MD5 hashes. I hadn't heard of FIPS before.
I was getting the following warning for one of my Python test suites: I also saw a deprecation warning elsewhere for my usage of .
David Beazley on Twitter said: I think 95% of the problems once solved by a metaclass can be solved by instead This inspired me to finally learn how to use it!
I've long wanted to run some kind of large language model on my own computer. Now that I have a M2 MacBook Pro I'm even more keen to find interesting ways to keep all of those CPU cores busy.
https://www.w3.org/History/1991-WWW-NeXT/Implementation/ It's served up as a browseable Apache directory listing, but that's not the most delightful way to browse code - clicking a link to a file…
uses a cache to avoid downloading packages again: The command can be used to find the location of that cache on your system: Wheels are cached in - in a nested set of folders based on a hash, for…
OpenAI released an API for ChatGPT yesterday. It's 1/10th of the price of the model! Their official openai Python package has been upgraded to add support for it (in this commit).
I had a bug that was only showing up in CI against Python 3.8. I used the following pattern with pyenv to quickly run the tests against that specific version.
A quick recipe I figured out today, for running the tests for a project against multiple Python versions. The key command option is .
Carelessly including the output of in an HTML page can lead to an XSS hole, thanks to the following: Jinja has a function that avoids this in - the (simplified) implementation looks like this: Which…
Today Carlton told me about the interact command in the Python debugger. Here's how to use it with (but it works anywhere else where you find yourself in a session).
I decided to implement a custom Jinja template block tag for my datasette-render-markdown plugin. I wanted the tag to work like this: A basic Jinja extension After some fiddling around with GitHub…