Launch IPython directly from package, instead of from path#307
Merged
stefanv merged 1 commit intoscientific-python:mainfrom Feb 6, 2026
Merged
Launch IPython directly from package, instead of from path#307stefanv merged 1 commit intoscientific-python:mainfrom
stefanv merged 1 commit intoscientific-python:mainfrom
Conversation
It happens, sometimes, that an install from a different version of Python is on the path. That leads to some unexepected and hard to debug issues.
lucascolley
approved these changes
Feb 6, 2026
Contributor
There was a problem hiding this comment.
thanks Stefan, tested with SciPy:
diff --git a/pixi.toml b/pixi.toml
index dbe3e87d0d..adb339bd20 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -143,9 +143,13 @@ features = ["build-deps", "run-deps", "test-deps", "scipy-openblas"]
### Default dependencies (included in all environments) ###
[dependencies]
-spin = "*"
+# spin = "*"
python = "*"
+[pypi-dependencies]
+spin.git = "https://github.com/stefanv/spin.git"
+spin.branch = "ipython-use-sys-exec"scipy on 🎋 main [🔨] is 📦 v1.18.0.dev0 via 🐍 via 🧚 v0.63.2 took 33s
❯ pixi ls spin
Name Version Build Size Kind Source
spin 0.16rc0.dev0 pypi git+https://github.com/stefanv/spin.git?branch=ipython-use-sys-exec#8106c9966eb286e62c7d3756399bc50bf881c7d5
scipy on 🎋 main [🔨] is 📦 v1.18.0.dev0 via 🐍 via 🧚 v0.63.2 took 2s
❯ pixi run ipython
✨ Pixi task (build in build): spin build --setup-args=-Dblas=blas --setup-args=-Dlapack=lapack --setup-args=-Duse-g77-abi=true: (Build SciPy (default settings))
$ meson compile -j 8 -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ninja -C /Users/lucascolley/ghq/github.com/scipy/scipy/build -j 8
ninja: Entering directory `/Users/lucascolley/ghq/github.com/scipy/scipy/build'
[2/356] Generating subprojects/highs/highs/HConfig.h with a custom command
$ meson install --only-changed -C build --destdir ../build-install --tags=runtime,python-runtime,tests,devel --skip-subprojects
✨ Pixi task (ipython in ipython): spin ipython --no-build: (Launch IPython)
$ export PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
💻 Launching IPython with PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
$ /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/ipython/bin/python3.14 -P -m IPython --ignore-cwd
Python 3.14.2 | packaged by conda-forge | (main, Dec 6 2025, 11:34:40) [Clang 20.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.8.0 -- An enhanced Interactive Python. Type '?' for help.
Tip: You can use `%hist` to view history, see the options with `%history?`
In [1]: import scipy
In [2]: scipy.show_config()
/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages/scipy/__config__.py:166: UserWarning: Install `pyyaml` for better output
warnings.warn("Install `pyyaml` for better output", stacklevel=1)
{
"Compilers": {
"c": {
"name": "clang",
"linker": "ld64",
"version": "19.1.7",
"commands": "/Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ccache, arm64-apple-darwin20.0.0-clang",
Member
Author
|
Thanks for testing, @lucascolley! This has been driving me insane, since my local setup someone has Python injected from the wrong place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It happens, sometimes, that an install from a different version of Python is on the path. That leads to some unexepected and hard to debug issues.
This uses the
-Pflag which requires Python 3.11 (EOL for 3.10 is June 2026).