Comments (12)
The plan we currently have:
- Support the global config entry `target_pixi_environment_directory = "/home/user/path/to/dir"
- Then installing an environment will directly install it in to
/home/user/path/to/dir/package_name-{pwd hash}/env/default
- Symlink the dir to the
.pixi
in the project. But only when possible, e.g. this doesn't work on windows. - Add it to the
pixi info
output. - Add clear documentation when to use this feature and when this is bad practice.
from pixi.
to make a Pixi env show up among Python environments that I can use as notebook kernels, I need to manually symlink it to the directory with my Conda environments.
this should not be necessary. You can chose .pixi/envs/default/bin/python
as your interpreter with the "select interpreter" menu. Then - if you have ipykernel
installed - the VSC jupyter extension can pick that up and work without symlinking.
I agree that this would be a great feature for the other reasons mentioned above, though.
from pixi.
Then installing an environment will directly install it in to
/home/user/path/to/dir/package_name-{pwd hash}/env/default
/home/user/path/to/dir/package_name
is this supposed to be project.name
from pixi.toml
@ruben-arts ?
from pixi.
That is an very interesting idea! We should discuss this. I love the idea for the faster disks.
from pixi.
This may also help to resolve #777.
in some cases you can then even use hardlinks for your packages instead of copies
Would be so much helpful if this could be implemented.
from pixi.
You get the ncurses issue (#234) when trying to run pixi in a VSCode devcontainer on macOS. When this is solved, we could also properly using devcontainers. My current workaround:
.devcontainer/devcontainer.json
// https://github.com/prefix-dev/pixi/issues/997
"postCreateCommand": "mkdir -p /tmp/pixienv && ln -s /tmp/pixienv .pixi && pixi run postinstall && git config --global --add safe.directory ${containerWorkspaceFolder} && pixi run pre-commit-install",
This is not optimal because then the macOS installation wouldn't work (unless /tmp/pixienv
exists locally too, otherwise i get os error 17
)
EDIT:
This seems to be a better solution
"mounts": ["source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume"],
"postCreateCommand": "sudo chown vscode .pixi && pixi run postinstall && git config --global --add safe.directory ${containerWorkspaceFolder} && pixi run pre-commit-install",
from pixi.
I remember reading some concerns about activating symlinked environments. Something about some old compiled libraries resolving their own location in the wrong way or something like that. Pixi would have to resolve the symlink before activating/running/opening a shell, and that should be enough, I think?
Edit, here they are:
from pixi.
This would also help with two other issues I have:
-
I want to use Pixi envs in VS Code, the same way I use Conda envs. To make a Pixi env show up among Python environments that I can use as notebook kernels, I need to manually symlink it to the directory with my Conda environments. It would be nice if the Pixi env was automatically put there instead and symlinked from my project directory.
Just one note: It would be nice to have readable env names, so please don't usesha-of-$PWD
suggested above. My suggestion would be to symlink.pixi/envs/default -> /path/to/envs/<pixi-project-name>
and symlink non-default envs, e.g..pixi/envs/dev -> /path/to/envs/dev@<pixi-project-name>
. Of course the problem is that there might already be an existing environment with the name equal to current Pixi project name, but that could simply result in an error indicating that either the exisitng env or the Pixi project name should be renamed, or perhaps it could automatically add a short suffix to the env name. -
On the HPC platform I use, there is a scratch partition with no backup and much larger quota, and we are asked to put our environments there. I've tried moving the rattler cache to the scratch partition, but the files from there are then copied to my pixi envs, taking up the quota on the default partition and getting unnecessarily backed up. If Pixi envs were also on the scratch partition, the files would be hardlinked from the rattler cache, saving disk space.
from pixi.
Sounds great!
from pixi.
@0xbe7a Yep, that is the idea. I would love to support some kind of full path things but that would make the path to long.
from pixi.
to make a Pixi env show up among Python environments that I can use as notebook kernels, I need to manually symlink it to the directory with my Conda environments.
this should not be necessary. You can chose
.pixi/envs/default/bin/python
as your interpreter with the "select interpreter" menu. Then - if you haveipykernel
installed - the VSC jupyter extension can pick that up and work without symlinking.I agree that this would be a great feature for the other reasons mentioned above, though.
Thanks for the tip! It works as a workaround, but it's a bit cumbersome when I have more than one pixi env in a project and want to switch between them. E.g. with .pixi/envs
containing prod
and dev
, I don't see prod
and dev
in the list of Python environments, and I have to type/paste the interpreter path (.pixi/envs/prod/bin/python
or .pixi/envs/dev/bin/python
), and only then select the environment.
Am I correct in thinking that microsoft/vscode-python#22978 will make it easier?
from pixi.
Am I correct in thinking that microsoft/vscode-python#22978 will make it easier?
yes, that should make it easier. i also thought that it might be interesting to implement some pixi detection in the jupyter plugin, i.e., that vscode can pixi add ipykernel
if it's not available yet
from pixi.
Related Issues (20)
- Add pixi version to system requirements HOT 4
- Regression from 0.25.0 -> 0.28.2 HOT 4
- Can a toml file built on Windows be reconstructed on Linux? HOT 5
- Python GDAL Import Error in PyCharm after Micromamba and Pixi Installation HOT 1
- Option '--color always' is not working as expected. HOT 1
- Error loading conda environment with Pixi in PyCharm
- Add support to use different `pypi-options` for different environments HOT 4
- run deactivate.d scripts for global installed tools HOT 9
- `conda-pypi-map = { }` doesn't work in offline HOT 2
- allow choosing prefer repodata format HOT 1
- Environment with old versions for NumPy/Numba fails to resolve HOT 1
- Regression with pixi 0.28.x HOT 5
- Escaping shell substitution with `pixi run` requires multiple layers of quoting HOT 1
- add option to byte-compile python at install time HOT 1
- Invalid peer certificate with `--tls-no-verify` HOT 10
- Supporting `uv` configuration HOT 4
- conda-pypi-map misleading error, issues with numpy HOT 4
- pixi list --locked updates the lockfile
- Cannot `pixi run` tools installed in path with spaces HOT 2
- Search does not return existing conda-forge packages and pixi add complains about "no candidates found" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi.