Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixi shell does not activate environment #3055

Open
2 tasks done
saydemr opened this issue Feb 3, 2025 · 24 comments
Open
2 tasks done

pixi shell does not activate environment #3055

saydemr opened this issue Feb 3, 2025 · 24 comments
Assignees

Comments

@saydemr
Copy link

saydemr commented Feb 3, 2025

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Run the following command on WSL, Ubuntu 24.04.

pixi shell -v

Problem occurs with any dependencies and any dependency types, yet an example pixi.toml file is as follows.

[project]
channels = ["conda-forge"]
description = "Add a short description here"
name = "go-to-next-line"
platforms = ["linux-64"]
version = "0.1.0"

[tasks]

[dependencies]
python = "==3.11"

output of pixi info

System
------------
       Pixi version: 0.40.3
           Platform: linux-64
   Virtual packages: __unix=0=0
                   : __linux=5.15.167.4=0
                   : __glibc=2.39=0
                   : __cuda=12.7=0
                   : __archspec=1=icelake
          Cache dir: /home/username/.cache/rattler/cache
       Auth storage: /home/username/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /home/username/.pixi/bin
    Environment dir: /home/username/.pixi/envs
       Manifest dir: /home/username/.pixi/manifests/pixi-global.toml

Project
------------
               Name: go-to-next-line
            Version: 0.1.0
      Manifest file: /home/username/go-to-next-line/pixi.toml
       Last updated: 03-02-2025 10:24:21

Environments
------------
        Environment: default
           Features: default
           Channels: conda-forge
   Dependency count: 1
       Dependencies: python
   Target platforms: linux-64

Other info that might be relevant:

username@sam:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble
username@sam:~$ uname -a
Linux sam 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
username@sam:~$
PS D:\winusr\Downloads> wsl --version
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4751
PS D:\winusr\Downloads>

Issue description

The output is as follows

username@sam:~/go-to-next-line$ pixi shell -v
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /home/username/go-to-next-line/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
 INFO pixi::lock_file::update: Environment 'default' is up-to-date with lock file hash
 INFO pixi::cli::shell: Starting shell: Bash(Bash)

After exiting with Ctrl+D, which python points to default installed python inside /usr/bin

username@sam:~/go-to-next-line$ which python
/usr/bin/python
username@sam:~/go-to-next-line$

The terminal does not hang as opposed to what we initially thought (thanks to maximmaxim345 see here). Even though terminal does not activate the environment and does not show the next line (go-to-next-line) username@sam:~/go-to-next-line$ what is typed in the terminal is executed by the shell.

For example, current state of the directory is as follows.

total 40
drwxr-xr-x  3 username username  4096 Feb  3 09:37 ./
drwxr-x--- 36 username username  4096 Feb  3 09:37 ../
-rw-r--r--  1 username username    83 Feb  3 09:37 .gitattributes
-rw-r--r--  1 username username    38 Feb  3 09:37 .gitignore
drwxr-xr-x  3 username username  4096 Feb  3 09:37 .pixi/
-rw-r--r--  1 username username 12500 Feb  3 09:41 pixi.lock
-rw-r--r--  1 username username   193 Feb  3 09:41 pixi.toml

After using pixi shell typing echo does not go to next line >> a.out and hitting return actually creates a file and appends the contents. This indicates that command does not hang but somehow environment is not activated properly after the command is executed.

username@sam:~/go-to-next-line$ ls -al
total 40
drwxr-xr-x  3 username username 4096 Feb  3 09:37 .
drwxr-x--- 36 username username 4096 Feb  3 09:50 ..
-rw-r--r--  1 username username 83 Feb  3 09:37 .gitattributes
-rw-r--r--  1 username  username 38 Feb  3 09:37 .gitignore
drwxr-xr-x  3 username  username  4096 Feb  3 09:37 .pixi
-rw-r--r--  1 username  username  12500 Feb  3 09:41 pixi.lock
-rw-r--r--  1 username  username    193 Feb  3 09:41 pixi.toml
username@sam:~/go-to-next-line$ pixi shell -v
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /home/username/go-to-next-line/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
 INFO pixi::lock_file::update: Environment 'default' is up-to-date with lock file hash
 INFO pixi::cli::shell: Starting shell: Bash(Bash)

here echo does not go to next line >> a.out is executed followed by Ctrl+D

username@sam:~/go-to-next-line$ ls -al
total 44
drwxr-xr-x  3 username username 4096 Feb  3 09:51 .
drwxr-x--- 36 username username 4096 Feb  3 09:51 ..
-rw-r--r--  1 username username 83 Feb  3 09:37 .gitattributes
-rw-r--r--  1 username username 38 Feb  3 09:37 .gitignore
drwxr-xr-x  3 username username 4096 Feb  3 09:37 .pixi
-rw-r--r--  1 username username 25 Feb  3 09:51 a.out
-rw-r--r--  1 username username 12500 Feb  3 09:41 pixi.lock
-rw-r--r--  1 username username 193 Feb  3 09:41 pixi.toml
username@sam:~/go-to-next-line$ cat a.out 
does not go to next line
username@sam:~/go-to-next-line$ 

Python path shows the one in usr/bin/python from which we understand that the environment is not activated properly.

username@sam:~/go-to-next-line$ which python
/usr/bin/python
username@sam:~/go-to-next-line$

Expected behavior

After executing pixi shell -v expected behavior should be as follows.

username@sam:~/go-to-next-line$ pixi shell
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /home/username/go-to-next-line/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
 INFO pixi::lock_file::update: Environment 'default' is up-to-date with lock file hash
 INFO pixi::cli::shell: Starting shell: Bash(Bash)
(go-to-next-line) username@sam:~/go-to-next-line$

where environment name is shown before the username and the present working directory, followed by $ indicating the user that environment is ready and terminal can take in the next command.

Further, which python should return

(go-to-next-line) username@sam:~/go-to-next-line$ which python
/home/usr/go-to-next-line/.pixi/envs/default/bin/python
(go-to-next-line) username@sam:~/go-to-next-line$
@saydemr saydemr changed the title pixi shell does not go to next line even though command returns succesfully pixi shell does not activate environment Feb 3, 2025
@nwpulverizer
Copy link

Hi I have this issue on Bazzite, except the echo does not go to next line >> a.out part does not execute. To be clear - I mean No file is produced when I do this.

@saydemr
Copy link
Author

saydemr commented Feb 4, 2025

Here is the recording of my experience. Video expires in two days. https://streamable.com/65qs9b

@ruben-arts if you have time to have a second look at it...

@Ehab-Ibrahim
Copy link

Having the same issue. Other details to add is that this only affects bash on my side. If I use fish or nu, then pixi shell works as expected. Also on bash, running eval "$(pixi shell-hook)" correctly activates the environment. This is on a RedHat 9 server.

This issue doesn't happen on my local Ubuntu 22.04 though.

@saydemr
Copy link
Author

saydemr commented Feb 10, 2025

eval "$(pixi shell-hook)" also works for me. I also use bash

@saydemr
Copy link
Author

saydemr commented Feb 14, 2025

Hey @wolfv, thanks for the effort in #3130 . I built pixi from source after checking out from aec153cef99870a54acc30470e97a3e86e70b415, the issue persists and here is the output. There is an additional line at the very end but environment still is not activated.

INFO pixi_manifest::discovery: Found manifest in directory: "/home/username/ssm", continuing further.
 INFO pixi_manifest::target: Adding pypi dependency: torchmetrics "==1.6.0"
 INFO pixi_manifest::target: Adding pypi dependency: lightning "~=2.4"
 INFO pixi_manifest::target: Adding pypi dependency: jaxtyping "*"
 INFO pixi_manifest::target: Adding pypi dependency: einops "*"
 INFO pixi_manifest::target: Adding pypi dependency: numpy "*"
 INFO pixi_manifest::target: Adding pypi dependency: scipy "*"
 INFO pixi_manifest::target: Adding pypi dependency: scikit-learn "*"
 INFO pixi_manifest::target: Adding pypi dependency: pandas "*"
 INFO pixi_manifest::target: Adding pypi dependency: matplotlib "*"
 INFO pixi_manifest::target: Adding pypi dependency: hydra-core "~=1.3"
 INFO pixi_manifest::target: Adding pypi dependency: hydra-submitit-launcher "*"
 INFO pixi_manifest::target: Adding pypi dependency: wandb "~=0.18"
 INFO pixi_manifest::target: Adding pypi dependency: tqdm "*"
 INFO pixi_manifest::target: Adding pypi dependency: rich "*"
 INFO pixi_manifest::target: Adding pypi dependency: ipython "*"
 INFO pixi_manifest::target: Adding pypi dependency: ipdb "*"
 INFO pixi_manifest::target: Adding pypi dependency: jupyterlab "*"
 INFO pixi_manifest::target: Adding pypi dependency: ipympl "*"
 INFO pixi_manifest::target: Adding pypi dependency: soundfile "*"
 INFO pixi_manifest::target: Adding pypi dependency: triton "*"
 INFO pixi_manifest::target: Adding pypi dependency: brainpy "*"
 INFO pixi_manifest::target: Adding pypi dependency: pygame "*"
DEBUG pixi_config: Loading config from /etc/pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/.config/pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/.pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/ssm/.pixi/config.toml
DEBUG pixi_config: Failed to load local config: /home/username/ssm/.pixi/config.toml (error: no file was found at /home/username/ssm/.pixi/config.toml)
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /home/username/ssm/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
DEBUG pixi::lock_file::update: Lock file contains source packages: ignore lock file hash and update the prefix
 INFO pixi::lock_file::update: Updating prefix
DEBUG pixi::environment::conda_prefix: updating prefix for 'default'
DEBUG pixi::rlimit: Increased RLIMIT_NOFILE to 1024
 INFO pixi::environment::conda_metadata: No update needed for the prefix file.
 INFO pixi::environment::conda_metadata: Verify history file exists: /home/username/ssm/.pixi/envs/default/conda-meta/history
 INFO pixi::lock_file::resolve::uv_resolution_context: uv keyring provider is disabled
DEBUG pixi::activation: Running activation script for Default
DEBUG uv_client::base_client: Using request timeout of 30s
DEBUG pixi::install_pypi: installing with python interpreter: cpython-3.12.8-linux-x86_64-gnu from /home/username/ssm/.pixi/envs/default
DEBUG uv_fs: Acquired lock for `.pixi/envs/default`
DEBUG pixi::install_pypi: Constructed site-packages with 164 packages
DEBUG pixi::install_pypi::utils: Requirement already satisfied (and up-to-date): ssm==0.1.0 (from file:///home/username/ssm)
 INFO pixi::install_pypi: 140 of 140 required packages are considered are installed and up-to-date
 INFO pixi::install_pypi: Nothing to do - finished in 28ms
DEBUG uv_fs: Released lock at `/tmp/uv-0d24d6f738ef97f2.lock`
DEBUG pixi::environment: Wrote environment file to: "/home/username/ssm/.pixi/envs/default/conda-meta/pixi"
DEBUG pixi::cli::shell: Pixi environment activation:
{"CONDA_PREFIX": "/home/username/ssm/.pixi/envs/default", "PIXI_PROJECT_VERSION": "0.1.0", "XML_CATALOG_FILES": "file:///home/username/ssm/.pixi/envs/default/etc/xml/catalog file:///etc/xml/catalog", "PIXI_ENVIRONMENT_NAME": "default", "PIXI_PROJECT_NAME": "ssm", "PIXI_ENVIRONMENT_PLATFORMS": "linux-64", "PATH": "/home/username/ssm/.pixi/envs/default/bin:/home/username/.pyenv/shims:/home/username/.pyenv/bin:/home/username/.cargo/bin:/home/username/.pyenv/bin:~/.pixi/bin:/usr/local/cuda-12.6/bin:/home/username/ic:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/WindowsApps/MicrosoftCorporationII.WindowsSubsystemForLinux_2.4.11.0_x64__8wekyb3d8bbwe:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/libnvvp:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/NVIDIA/CUDNN/v8.9/bin:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/texlive/2024/bin/windows:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/GitHub CLI/:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2024.3.2/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/winusr/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/winusr/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/winusr/AppData/Local/Microsoft/WindowsApps:/mnt/c/texlive/2024/bin/windows:/snap/bin", "PIXI_IN_SHELL": "1", "PIXI_PROMPT": "(ssm) ", "PIXI_PROJECT_MANIFEST": "/home/username/ssm/pyproject.toml", "PIXI_EXE": "/home/username/.cargo/bin/pixi", "CONDA_DEFAULT_ENV": "ssm", "PIXI_PROJECT_ROOT": "/home/username/ssm"}
DEBUG rattler_shell::shell: Guessing the current shell is bash. Parent process name: bash and args: []
 INFO pixi::cli::shell: Starting shell: Bash(Bash)
DEBUG pixi::cli::shell: Starting shell 'bash -l -i' with source command: ' . "/tmp/pixi_env_F1s.sh"'

@nick-ulle
Copy link

I'm also having this problem and @Ehab-Ibrahim's workaround also works for me.

Output of pixi info:

System
------------
       Pixi version: 0.41.4
           Platform: linux-64
   Virtual packages: __unix=0=0
                   : __linux=6.5.0=0
                   : __glibc=2.35=0
                   : __archspec=1=x86_64_v3
          Cache dir: /home/nulle/.cache/rattler/cache
       Auth storage: /home/nulle/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /home/nulle/.pixi/bin
    Environment dir: /home/nulle/.pixi/envs
       Manifest dir: /home/nulle/.pixi/manifests/pixi-global.toml

Project
------------
               Name: sandbox3
            Version: 0.1.0
      Manifest file: /home/nulle/sandbox3/pixi.toml
       Last updated: 24-02-2025 11:12:08

Environments
------------
        Environment: default
           Features: default
           Channels: conda-forge
   Dependency count: 1
       Dependencies: python
   Target platforms: linux-64

Output of lsb_release -a:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

@saydemr saydemr mentioned this issue Mar 7, 2025
2 tasks
@wolfv wolfv self-assigned this Mar 10, 2025
@wolfv
Copy link
Member

wolfv commented Mar 10, 2025

I tried to reproduce your issue today and didn't succeed, yet.

I tried: a very long $PS1, and a multi-line $PS1 - both worked fine.
I tried this in a clean Github codespace in bash, first with their colorful prompt, then with a clean short one. No dice.

Can you share whether you are using anything special such as "starship", multi-line prompt, colorful prompt?

Can you share the value of your $PS1?

I'll boot into Windows and try with WSL2 if I can recreate the issue there, too.

@saydemr
Copy link
Author

saydemr commented Mar 10, 2025

Hi @wolfv,

Here is the video of my experience once again: https://streamable.com/amdg80 . This is using default windows terminal, default wsl, no personal configurations at all.

username@sam:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

@wolfv
Copy link
Member

wolfv commented Mar 10, 2025

@saydemr - thanks for helping me! I am trying with a very similar configuration (Windows / WSL2).

Can you tell me exactly which Ubuntu version and which pixi version you are using? I'll try to match it perfectly as I couldn't recreate it yet.

I also tried a number of different pixi versions. Which one are you showing exactly in the video? (Might be something useful to log with -v in the future - reminder to self).

Lastly, does echo "=== DONE ===" print normally for you?

The below was a completely fresh Ubuntu 22.04.5 installation on WSL2. My locale is English-US.

Image

@wolfv
Copy link
Member

wolfv commented Mar 10, 2025

PS: running with -vvv prints even more debug information that may be useful.

@nick-ulle
Copy link

I don't think this is necessarily a Windows/WSL2 problem. I'm encountering this problem on a Linux server, no Windows involved. Sorry, I should've indicated that in my first comment.

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

Yes, I understand. I was hoping to reproduce easily on WSL though - no success yet.

@nick-ulle
Copy link

The $PS1 on the Linux server is:

\u\[\e[1;33m\]@\h \[\e[0;34m\]\W\[\e[m\] \$

@danx12
Copy link

danx12 commented Mar 11, 2025

I'm having the same issue using WSL.

Output of pixi info:

daniel@lab:~/Repos/pixi-test$ pixi info
System
------------
       Pixi version: 0.41.4
           Platform: linux-64
   Virtual packages: __unix=0=0
                   : __linux=5.15.167.4=0
                   : __glibc=2.35=0
                   : __cuda=12.5=0
                   : __archspec=1=skylake
          Cache dir: /home/daniel/.cache/rattler/cache
       Auth storage: /home/daniel/.rattler/credentials.json
   Config locations: /home/daniel/.config/pixi/config.toml

Global
------------
            Bin dir: /home/daniel/.pixi/bin
    Environment dir: /home/daniel/.pixi/envs
       Manifest dir: /home/daniel/.pixi/manifests/pixi-global.toml

Project
------------
               Name: pixi-test
            Version: 0.1.0
      Manifest file: /home/daniel/Repos/pixi-test/pixi.toml

Environments
------------
        Environment: default
           Features: default
           Channels: https://artifactory.intra.somecorp.com/artifactory/conda-it-conda-forge
   Dependency count: 0
   Target platforms: linux-64

My PS1:
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

@wolfv what can I else provide?

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

I have made some changes in this PR: #3321. In ~15 minutes there should be some artifacts that you could try to see if that helps with this issue. I still haven't been able to recreate the issue (I also tried a ubuntu:22.04 docker container).

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

The builds are now available at the bottom of this page: https://github.com/prefix-dev/pixi/actions/runs/13783534297?pr=3321

@Ehab-Ibrahim
Copy link

Ehab-Ibrahim commented Mar 11, 2025

I have an update. I introduced pixi to another user in my company, and it turns out that he didn't get stuck when running pixi shell on our server. This indicates that it must have something to do with my configuration. In my case, I finally found out what triggered the issue.

In my ~/.bash_profile, I run fish shell if I'm in an interactive shell:

if [[ $- = *i* ]]; then
  exec ~/.pixi/bin/fish
  # if [ -f ~/.bashrc ]; then
  # . ~/.bashrc
  # fi
fi

This was my workaround to set up fish as the default shell when I ssh to the server. If I comment this line, then pixi shell doesn't get stuck on bash.

I was able to reproduce this on my local Ubuntu 22.04 as well. I added ~/.pixi/bin/fish as the first line in my ~/.profile, and pixi shell got stuck.

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

Ok, that is a helpful hint. I am not sure we have a way to workaround starting fish in the bashrc ... - but I'll take a look and at least I can recreate this easily :)

@saydemr
Copy link
Author

saydemr commented Mar 11, 2025

Hi @wolfv

From windows side

PS C:\Users\winusr> wsl --version
WSL version: 2.4.11.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5716
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4890

I am on Ubuntu WSL 24.04.2, latest LTS release

username@sam:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble
username@sam:~$ uname -a
Linux sam 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

WSL system locale settings

username@sam:~$ localectl status
System Locale: LANG=C.UTF-8
    VC Keymap: (unset)
   X11 Layout: us
    X11 Model: pc105

Output of $PS1

username@sam:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

Lastly, does echo "=== DONE ===" print normally for you?

Image

I have made some changes in this PR: #3321. In ~15 minutes there should be some artifacts that you could try to see if that helps with this issue. I still haven't been able to recreate the issue (I also tried a ubuntu:22.04 docker container).

I have downloaded the artifact from the link you just provided and unzipped it. Therefore, pixi version is not relevant.

username@sam:~$ ll | grep pixi
-rwxr-xr-x  1 username username  104826808 Mar 11 08:31 pixi*
-rw-r--r--  1 username username   35535991 Mar 11 11:09 pixi-linux-x86_64-504ddeb50bf74669fcd682f6798ffabfb301a2c4.zip

and pixi info prints

username@sam:~$ ./pixi info
System
------------
       Pixi version: 0.42.1
           Platform: linux-64
   Virtual packages: __unix=0=0
                   : __linux=5.15.167.4=0
                   : __glibc=2.39=0
                   : __cuda=12.8=0
                   : __archspec=1=icelake
          Cache dir: /home/username/.cache/rattler/cache
       Auth storage: /home/username/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /home/username/.pixi/bin
    Environment dir: /home/username/.pixi/envs
       Manifest dir: /home/username/.pixi/manifests/pixi-global.toml
username@sam:~$ date
Tue Mar 11 11:41:56 CET 2025
username@sam:~$ ./pixi init once-again
✔ Created /home/username/once-again/pixi.toml
username@sam:~$ cd once-again/
username@sam:~/once-again$ pixi add python=3.12
Command 'pixi' not found, did you mean:
  command 'pixz' from deb pixz (1.0.7-2)
Try: sudo apt install <deb name>
username@sam:~/once-again$ ../pixi add python=3.12
✔ Added python=3.12
username@sam:~/once-again$ ../pixi shell -vvv
 INFO pixi_manifest::discovery: Found manifest in directory: "/home/username/once-again", continuing further.
DEBUG pixi_config: Loading config from /etc/pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/.config/pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/.pixi/config.toml
DEBUG pixi_config: Loading config from /home/username/once-again/.pixi/config.toml
DEBUG pixi_config: Failed to load local config: /home/username/once-again/.pixi/config.toml (error: no file was found at /home/username/once-again/.pixi/config.toml)
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /home/username/once-again/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
 INFO pixi::lock_file::virtual_packages: Required virtual packages of environment 'default': __glibc >=2.17,<3.0.a0
DEBUG pixi::lock_file::virtual_packages: Generic system virtual packages for env: 'default' : [__archspec: __archspec=1=icelake, __unix: __unix=0=0, __glibc: __glibc=2.39=0, __cuda: __cuda=12.8=0, __linux: __linux=5.15.167.4=0]
DEBUG pixi::lock_file::virtual_packages: Required virtual package: __glibc >=2.17,<3.0.a0 matches the system
 INFO pixi::lock_file::update: Updating prefix: '/home/username/once-again/.pixi/envs/default'
DEBUG pixi_utils::reqwest: Using s3_config: {}
 INFO rattler_networking::s3_middleware: Creating S3 middleware using {}
DEBUG pixi_utils::reqwest: s3_middleware: S3Middleware { s3: S3 { auth_storage: AuthenticationStorage { backends: [KeyringAuthenticationStorage { store_key: "rattler" }, FileStorage { path: "/home/username/.rattler/credentials.json", cache: RwLock { data: FileStorageCache { content: {} }, poisoned: false, .. } }, NetRcStorage { machines: {"api.wandb.ai": Machine { name: Some("api.wandb.ai"), login: Some("user"), password: Some(""), account: None }} }], cache: Mutex { data: {}, poisoned: false, .. } }, config: {}, expiration: 300s } }
DEBUG pixi::environment::conda_prefix: updating prefix for 'default'
DEBUG pixi::rlimit: Increased RLIMIT_NOFILE to 1024
 INFO pixi::environment::conda_metadata: No update needed for the prefix file.
 INFO pixi::environment::conda_metadata: Verify history file exists: /home/username/once-again/.pixi/envs/default/conda-meta/history
 INFO pixi::lock_file::resolve::uv_resolution_context: uv keyring provider is disabled
DEBUG pixi::activation: Running activation script for Default
DEBUG pixi::environment: Wrote environment file to: "/home/username/once-again/.pixi/envs/default/conda-meta/pixi"
DEBUG pixi::cli::shell: Pixi environment activation:
{"PIXI_PROJECT_NAME": "once-again", "PIXI_EXE": "/home/username/pixi", "PIXI_IN_SHELL": "1", "CONDA_PREFIX": "/home/username/once-again/.pixi/envs/default", "PIXI_PROJECT_ROOT": "/home/username/once-again", "PIXI_PROMPT": "(once-again) ", "PIXI_PROJECT_MANIFEST": "/home/username/once-again/pixi.toml", "PIXI_PROJECT_VERSION": "0.1.0", "PIXI_ENVIRONMENT_PLATFORMS": "linux-64", "CONDA_DEFAULT_ENV": "once-again", "PATH": "/home/username/once-again/.pixi/envs/default/bin:/usr/local/cuda-12.6/bin:/home/username/ic:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/WindowsApps/Microsoft.PowerShell_7.5.0.0_x64__8wekyb3d8bbwe:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/libnvvp:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA/CUDNN/v8.9/bin:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/texlive/2024/bin/windows:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/Program Files/GitHub CLI/:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2024.3.2/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/winusr/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/winusr/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/winusr/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/winusr/AppData/Local/Microsoft/WindowsApps:/mnt/c/texlive/2024/bin/windows:/snap/bin", "PIXI_ENVIRONMENT_NAME": "default"}
DEBUG rattler_shell::shell: Guessing the current shell is bash. Parent process name: bash and args: []
 INFO pixi::cli::shell: Starting shell: Bash(Bash)
DEBUG pixi::cli::shell: Starting shell 'bash -l -i' with source command: ' . "/tmp/pixi_env_un7.sh"'

I cannot stress enough that I do not use any other shell extensions whatsoever. I do not have fish, starship etc. and there is nothing inside .bashrc or .profile aside the defaults and bunch of aliases I use.

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

@saydemr I don't see anything surprising. I really tried this with different ubuntu versions on WSL yesterday. Maybe you can double check once more the exact contents of your .bash_profile / ~/.bashrc files. I'll try again on WSL later, and in the meantime will look at the fish in bashrc issue.

@saydemr
Copy link
Author

saydemr commented Mar 11, 2025

@wolfv now, solved. I sourced .bashrc from /etc/skel/.bashrc and problem disappears.

For me, the line causing a problem was a drive mount at the very end of .bashrc

wsl.exe -u root -e mount -t drvfs E: /mnt/fp -o metadata > /dev/null 2>&1

I still did not understand why this is a problem... Any guesses?

Issue can be closed if you do not have a fix from pixi side

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

Interesting. I wonder if it has to do with the redirect (> /dev/null 2>&1) ... will try to debug a bit more tomorrow!

@danx12
Copy link

danx12 commented Mar 11, 2025

I figured out what is making hang on my shell (WSL) this line:
wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit start

I need this so I can access my company's network from WSL.

@wolfv
Copy link
Member

wolfv commented Mar 11, 2025

@danx12 @saydemr - thank you. I can indeed recreate the issue on WSL like this.

I also tried poetry shell and it doesn't have the same issue, so there must be something we're doing wrong. I'll try to get to the bottom of this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants