-
Notifications
You must be signed in to change notification settings - Fork 958
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
Add support for managing Conda environments and packages #1703
Comments
This might be out of scope for us. I'm not sure about the long-term future, but definitely in the short term. Prefix.dev is more focused on conda integration. |
Ok, thanks. I understand, but still a pity. A single Python management tool for both camps would be nice one day. Hopefully the collaboration between you and the pixi team continues and they become complementary tools following the same standards :) |
Wanted to echo my support for this question as well. Many AI/ML and scientific workflows rely on Python packages that have complex C/C++ dependencies. GDAL is a good example of a package that is essential for many Python applications, but installing it via Pip requires that you have already installed the GDAL C library your machine. Conda-based tools generally do a good job of managing both the Python and C/C++ dependencies, which is why many scientists use this ecosystem. Unfortunately, using a package manager that cannot manage these lower-level dependencies is a non-starter for many of us. Would love to see the |
Just ran into this with a requirement to use |
just had an issue that uv does not work in a conda environment, but installation is ok. uv binary is missing. |
With the latest stabilizations Currently my environments require something like In short, supplanting @zanieb, have there been any developments in thinking about expanding capabilities in this direction, or is this still out of scope? I'm partially served by Thanks for the great work in this space! |
Thanks for the well written comment. We care about scientific Python (several of us worked in that domain before Astral), but right now we're focused on polishing the project management experience and working on correctness. Hopefully we'll be able to figure out a good story for Conda integration, but it's not in the immediate scope.
That's great to hear <3 |
Is it possible to export a Conda environment YAML file? It already supports exporting a |
@zanieb related to your response in #6989:
It has felt to me for a while that the unknown correspondence between PyPI and Conda packages is the biggest thing keeping the ecosystems separate. When looking into the topic many months ago I came across Grayskull, this thread discussing the exact problem, and this bot-generated mapping effort. By no means exhaustive, but I imagine some mapping like that would be a necessary starting point for Conda/PyPI interop, so figured I'd leave the links here. |
@matterhorn103 alternatively, is there any (technical) reason to continue using anything in the conda ecosystem? I've made the decision to never install anaconda or anything related on my new MacBook and im all in on uv - its the future. |
Like you, I don't use Conda personally at all any more. But I know that colleagues do and are unlikely to be budged. Part of that is that although PyPI can now, thanks to wheels, match Conda in the historically difficult things like |
I try to avoid |
There's https://github.com/nextgis/pygdal which installs without problems with pip, but uv pip fails. Resolved 2 packages in 5ms
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: pygdal==3.4.1.10
[stdout]
running bdist_wheel
running build
running build_py
copying ./osgeo/gnm.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/gdalnumeric.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/gdalconst.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/gdal_array.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/utils.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/gdal.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/osr.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/__init__.py -> build/lib.linux-x86_64-cpython-311/osgeo
copying ./osgeo/ogr.py -> build/lib.linux-x86_64-cpython-311/osgeo
running egg_info
writing pygdal.egg-info/PKG-INFO
writing dependency_links to pygdal.egg-info/dependency_links.txt
writing requirements to pygdal.egg-info/requires.txt
writing top-level names to pygdal.egg-info/top_level.txt
[stderr]
Traceback (most recent call last):
File "<string>", line 11, in <module>
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/build_meta.py", line 435, in build_wheel
return _build(['bdist_wheel'])
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
self.run_setup()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "<string>", line 225, in <module>
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 183, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
dist.run_commands()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
self.run_command(cmd)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/dist.py", line 995, in run_command
super().run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 381, in run
self.run_command("build")
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/dist.py", line 995, in run_command
super().run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/dist.py", line 995, in run_command
super().run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 78, in run
self.build_package_data()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 169, in build_package_data
for target, srcfile in self._get_package_data_output_mapping():
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 161, in _get_package_data_output_mapping
for package, src_dir, build_dir, filenames in self.data_files:
^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 87, in __getattr__
self.data_files = self._get_data_files()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 93, in _get_data_files
self.analyze_manifest()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/build_py.py", line 191, in analyze_manifest
self.run_command('egg_info')
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/dist.py", line 995, in run_command
super().run_command(command)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 313, in run
self.find_sources()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 321, in find_sources
mm.run()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 544, in run
self.add_defaults()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 582, in add_defaults
sdist.add_defaults(self)
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/command/sdist.py", line 109, in add_defaults
super().add_defaults()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 238, in add_defaults
self._add_defaults_ext()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 322, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command
cmd_obj.ensure_finalized()
File "/home/user/.cache/uv/builds-v0/.tmpkEGGLO/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "<string>", line 129, in finalize_options
File "<string>", line 30, in get_numpy_include
AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'. Did you mean: 'get_data_files'? |
@bart-maykin please open a new issue, this does not seem like the right place for that problem. |
The following is a concrete proposal how initial conda support may look like in
In sagemath/sage#37447, I've implemented this strategy in a custom python script (not using uv at all). It works quite well. |
I also support this. There are some biology packages that are only conda installable. |
+1000 for this support. This simplifies the operational of managing the python dependencies on a large scale. |
@shuowpro, I've written |
Adding my upvote here. We are adding some recommendations to uv in SciPy's doc but we also need to still recommend things like pixi until we have a solution for Conda. @charliermarsh I believe support for non Python deps is around the corner? |
@tupui Happy to review those SciPy changes, if you want to ping me. I don't think support for non-Python dependencies is around the corner though :) |
I've been using pyenv to manage python versions and miniconda and anaconda versions. I really need support for anaconda and miniconda, this is so critical. |
I think Astral are aware people would really like this feature, I don't think there's need for any more "me too" comments, add a thumbs up to the original post. Unless you have some novel use case not already described here. Also, for those who really need conda packages and/or environments, and are not already aware, pixi provides project management, like uv, and does both conda and standard Python packages: https://github.com/prefix-dev/pixi |
Thought I'd just drop a link here to raise awareness of a PR I have open over at the conda repo which would add support for creating a conda environment from a specification in a I like to think that it would be a good first step towards better PyPI-conda interop and would help a little in enabling projects like |
Yeah that might be the most sensible way forward tbh. I hate to have a specific file for the conda env while the whole ecosystem of tools transitioned from having their custom file to using the pyproject. Everything conda could very well be defined there. |
I'm very excited by uv and the possibilities it hints at for the future of one-stop packaging and environment management.
As for a vast number of scientists, though, conda is pretty much essential to many of my projects. A package manager limited to PyPI may replace pip and venv for pure Python projects for me but will always have to sit alongside conda with conda-forge.
I get that it's still very early days, but are there any ambitions/plans to truly turn Python packaging into a single effective ecosystem and unite the science and programming camps? Might uv in future also manage conda environments or use packages from conda-forge/other repos?
Or should I reign in my excitement a little?
The text was updated successfully, but these errors were encountered: