macro128 / pdm-conda

A PDM plugin to resolve/install/uninstall project dependencies with Conda
33 stars 1 forks source link

`pdm init` fails with `[VirtualenvCreateError]: Can't resolve python interpreter` #37

Closed suhail-singh closed 2 months ago

suhail-singh commented 2 months ago

After installing pdm-conda via

pdm self add pdm-conda

pdm init fails. When the below commands are run:

cd /tmp
mkdir -p foo && cd foo
pdm init

The following failure is observed:

Creating a pyproject.toml for PDM...
STATUS: Downloading cpython@3.12.3
Successfully installed cpython@3.12.3
Version: 3.12.3
Executable: /home/${USER}/.rye/py/cpython@3.12.3/bin/python3
ERROR: Failed to install Python /home/${USER}/.rye/py/cpython@3.12.3/bin/python3: Could not find a version matching version='3.12.3/bin/python3', implementation=/home/${USER}/.rye/py/cpython
[VirtualenvCreateError]: Can't resolve python interpreter /home/${USER}/.rye/py/cpython@3.12.3/bin/python3

The very same minimal example succeeds as soon as pdm-conda is uninstalled via:

pdm self remove pdm-conda
suhail-singh commented 2 months ago

@macro128 installing pdm-conda results in pdm init failing. Am I doing something wrong?

macro128 commented 2 months ago

Hi! Sorry for the delay, if you want to use conda/mamba with the plugin then you should try using pdm init --conda-runner conda/mamba. However it is failing when you use the command without flags, I'll fix that problem and include it in the next version.

macro128 commented 2 months ago

Hi! Apart from using --conda-runner flag to use conda related environment, using pdm init was fixed on v0.18.1