Skip to content

Commit

Permalink
Allow orjson to work when pip-installed locally (~/.local).
Browse files Browse the repository at this point in the history
Depending on the pybind11 version, this works - or doesn't. There's a
long back story here:

	pybind/pybind11#4473
  • Loading branch information
gsmecher committed Feb 24, 2023
1 parent ff69001 commit 648978f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions py/preamble.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import inspect
import sys
import os
import sysconfig
import site


# Although upstream pybind11 allows user sites (check site.ENABLE_USER_SITE),
# older versions did not.
ver = sysconfig.get_python_version()
sys.path.append(os.path.expanduser(f"~/.local/lib/python{ver}/site-packages"))


def describe(registry, request):
'''
Expand Down

0 comments on commit 648978f

Please sign in to comment.