-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Checklist
- I added a descriptive title
- I searched open reports and couldn't find a duplicate
What happened?
Issue Overview
I am using conda-pack on Google Colab to compress and extract virtual environments. However, when I compress the environment, the expected conda-unpack file is not generated in the bin folder. The following log output is observed:
- 2025-03-28 19:28:20 [TempCondaEnv.set_env_var] 🔹 LD_LIBRARY_PATH : ['/content/CEnv/app/kohya_env/contents/lib', '/usr/local/lib', '/usr/local/nvidia/lib', '/usr/local/nvidia/lib64']
- 2025-03-28 19:28:20 [TempCondaEnv.check_conda_unpack] ❌ conda-unpack NOT found in the environment.
Steps to Reproduce
1. I create a temporary conda environment using my TempCondaEnv class and install conda-pack via pip inside that environment.
2. Although the LD_LIBRARY_PATH is set correctly, the conda-unpack file is missing from the bin folder.
Code Attachment
Below is the complete code for the TempCondaEnv class that I am using:
`import subprocess
import sys
from pathlib import Path
def create_temp_venv(env_path, python_version="3.10"):
print(f"Creating conda environment at: {env_path}")
cmd = ["conda", "create", "-y", "-p", str(env_path), f"python={python_version}"]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print("Error creating conda environment:")
print(result.stderr)
sys.exit(1)
else:
print("Conda environment created successfully.")
def install_conda_pack(env_path):
print(f"Installing conda-pack in environment: {env_path}")
cmd = ["conda", "run", "-p", str(env_path), "pip", "install", "conda-pack"]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print("Error installing conda-pack:")
print(result.stderr)
sys.exit(1)
else:
print("conda-pack installed successfully.")
def check_conda_unpack(env_path):
conda_unpack_path = Path(env_path) / "bin" / "conda-unpack"
if conda_unpack_path.exists():
print("conda-unpack is available at:", conda_unpack_path)
else:
print("conda-unpack NOT found in the environment.")
if name == "main":
temp_env = Path("/tmp/temp_venv")
if temp_env.exists():
print(f"Removing existing environment at: {temp_env}")
subprocess.run(["rm", "-rf", str(temp_env)])
create_temp_venv(temp_env)
install_conda_pack(temp_env)
check_conda_unpack(temp_env) `
Question
• Based on the code and logs provided, why is conda-unpack not generated as expected when running conda-pack?
• Does the use of options like --include conda-unpack or --dest-prefix affect the generation of conda-unpack, or are there other factors at play?
Any insights or suggestions would be greatly appreciated. Thank you!
Additional Context
No response