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

entry_point script file has a wrong python prefix on windows #5596

Open
2 tasks done
javierggt opened this issue Jan 17, 2025 · 1 comment
Open
2 tasks done

entry_point script file has a wrong python prefix on windows #5596

javierggt opened this issue Jan 17, 2025 · 1 comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@javierggt
Copy link

javierggt commented Jan 17, 2025

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I have a collection of conda packages. Every year or so I update dependencies. Now all scripts from all packages fail on windows. I have tried this with python 3.11 and 3.12, and several conda-build versions from 24.1.2 onwards. I can replicate the issue building on github actions and on my local machine.

Needless to say, I have not changed the recipes, and I have no idea what to try now. Maybe this is not a bug, but your bug template allows me to add all the details.

What follows is a simplified representative case with a hello-world script. Everything is in https://github.com/javierggt/hello with the steps I followed, but I copy it here just in case.

This is the error:

After installing the package, I get this error when trying to run the hello script:

Fatal error in launcher: Unable to create process using '"C:\Users\javierg\git\hello\bla\builds\hello_1737124823972\_h_env\python.exe"  "C:\Users\javierg\miniforge3\envs\test-py311\Scripts\hello.exe" ': The system cannot find the file specified.

If I pip-install it directly, there is no problem. The problem is only if I install the conda package I build, which sets the prefix to the build directory.

one workaround:
We figured that if we add the following to the recipe, then it works fine (but we prefer not to have to do this).

  entry_points:
    - hello=hello.hello:main

this is how I build

conda create -y -n conda-build --override-channels -c conda-forge python=3.11 conda-build=25.1.1
conda activate conda-build
git clone https://github.com/javierggt/hello.git
conda build hello --croot `pwd`/builds --no-anaconda-upload --no-test --python 3.11

Conda Info

active environment : conda-build
    active env location : C:\Users\javierg\miniforge3\envs\conda-build
            shell level : 1
       user config file : C:\Users\javierg\.condarc
 populated config files :
          conda version : 24.7.1
    conda-build version : not installed
         python version : 3.12.6.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=aarch64
                          __conda=24.7.1=0
                          __win=0=0
       base environment : C:\Users\javierg\miniforge3  (writable)
      conda av data dir : C:\Users\javierg\miniforge3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\javierg\miniforge3\pkgs
                          C:\Users\javierg\.conda\pkgs
                          C:\Users\javierg\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\javierg\miniforge3\envs
                          C:\Users\javierg\.conda\envs
                          C:\Users\javierg\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/24.7.1 requests/2.32.3 CPython/3.12.6 Windows/11 Windows/10.0.26100 solver/libmamba conda-libmamba-solver/24.7.0 libmambapy/1.5.9
          administrator : False
             netrc file : C:\Users\javierg/.netrc
           offline mode : False

Conda Config

Conda list

# packages in environment at C:\Users\javierg\miniforge3\envs\conda-build:
#
# Name                    Version                   Build  Channel
archspec                  0.2.3              pyhd8ed1ab_0    conda-forge
attrs                     24.3.0             pyh71513ae_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_1    conda-forge
boltons                   24.0.0             pyhd8ed1ab_1    conda-forge
brotli-python             1.1.0           py311hda3d55a_2    conda-forge
bzip2                     1.0.8                h2466b09_7    conda-forge
ca-certificates           2024.12.14           h56e8100_0    conda-forge
certifi                   2024.12.14         pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py311he736701_0    conda-forge
chardet                   5.2.0           py311h1ea47a8_2    conda-forge
charset-normalizer        3.4.1              pyhd8ed1ab_0    conda-forge
click                     8.1.8              pyh7428d3b_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_1    conda-forge
conda                     24.11.3         py311h1ea47a8_0    conda-forge
conda-build               25.1.1          py311h1ea47a8_1    conda-forge
conda-index               0.5.0              pyhd8ed1ab_0    conda-forge
conda-libmamba-solver     24.11.1            pyhd8ed1ab_0    conda-forge
conda-package-handling    2.4.0              pyh7900ff3_2    conda-forge
conda-package-streaming   0.11.0             pyhd8ed1ab_0    conda-forge
cpp-expected              1.1.0                h91493d7_0    conda-forge
distro                    1.9.0              pyhd8ed1ab_1    conda-forge
filelock                  3.16.1             pyhd8ed1ab_1    conda-forge
fmt                       11.0.2               h7f575de_0    conda-forge
frozendict                2.4.6           py311he736701_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_1    conda-forge
hpack                     4.0.0              pyhd8ed1ab_1    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_1    conda-forge
idna                      3.10               pyhd8ed1ab_1    conda-forge
importlib_resources       6.5.2              pyhd8ed1ab_0    conda-forge
jinja2                    3.1.5              pyhd8ed1ab_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_1    conda-forge
jsonpointer               3.0.0           py311h1ea47a8_1    conda-forge
jsonschema                4.23.0             pyhd8ed1ab_1    conda-forge
jsonschema-specifications 2024.10.1          pyhd8ed1ab_1    conda-forge
krb5                      1.21.3               hdf4eb48_0    conda-forge
libarchive                3.7.7                h979ed78_3    conda-forge
libcurl                   8.11.1               h88aaa65_0    conda-forge
libexpat                  2.6.4                he0c23c2_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
liblief                   0.15.1               he0c23c2_0    conda-forge
liblzma                   5.6.3                h2466b09_1    conda-forge
libmamba                  2.0.5                hc493ae7_1    conda-forge
libmambapy                2.0.5           py311h1191274_1    conda-forge
libsolv                   0.7.30               hbb528cf_0    conda-forge
libsqlite                 3.47.2               h67fdade_0    conda-forge
libssh2                   1.11.1               he619c9f_0    conda-forge
libxml2                   2.13.5               he286e8c_1    conda-forge
libzlib                   1.3.1                h2466b09_2    conda-forge
lz4-c                     1.10.0               h2466b09_1    conda-forge
lzo                       2.10              hcfcfb64_1001    conda-forge
m2-conda-epoch            20230914               0_x86_64    conda-forge
m2-msys2-runtime          3.4.9.1              hd8ed1ab_4    conda-forge
m2-patch                  2.7.6.2              hd8ed1ab_4    conda-forge
markupsafe                3.0.2           py311h5082efb_1    conda-forge
menuinst                  2.2.0           py311hda3d55a_0    conda-forge
more-itertools            10.6.0             pyhd8ed1ab_0    conda-forge
nlohmann_json             3.11.3               he0c23c2_1    conda-forge
openssl                   3.4.0                ha4e3fda_1    conda-forge
packaging                 24.2               pyhd8ed1ab_2    conda-forge
pip                       24.3.1             pyh8b19718_2    conda-forge
pkginfo                   1.12.0             pyhd8ed1ab_1    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_2    conda-forge
platformdirs              4.3.6              pyhd8ed1ab_1    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_1    conda-forge
psutil                    6.1.1           py311he736701_0    conda-forge
py-lief                   0.15.1          py311hda3d55a_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.6           py311he736701_2    conda-forge
pycparser                 2.22               pyh29332c3_1    conda-forge
pysocks                   1.7.1              pyh09c184e_7    conda-forge
python                    3.11.11         h3f84c4b_1_cpython    conda-forge
python-libarchive-c       5.1             py311h1ea47a8_1    conda-forge
python_abi                3.11                    5_cp311    conda-forge
pytz                      2024.2             pyhd8ed1ab_1    conda-forge
pyyaml                    6.0.2           py311he736701_1    conda-forge
referencing               0.36.1             pyhd8ed1ab_0    conda-forge
reproc                    14.2.5.post0         h2466b09_0    conda-forge
reproc-cpp                14.2.5.post0         he0c23c2_0    conda-forge
requests                  2.32.3             pyhd8ed1ab_1    conda-forge
ripgrep                   14.1.1               ha073cba_0    conda-forge
rpds-py                   0.22.3          py311h533ab2d_0    conda-forge
ruamel.yaml               0.18.10         py311he736701_0    conda-forge
ruamel.yaml.clib          0.2.8           py311he736701_1    conda-forge
setuptools                75.8.0             pyhff2d567_0    conda-forge
simdjson                  3.11.6               hc790b64_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
spdlog                    1.15.0               h81cc0e1_0    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
tqdm                      4.67.1             pyhd8ed1ab_1    conda-forge
truststore                0.10.0             pyhd8ed1ab_0    conda-forge
typing_extensions         4.12.2             pyha770c72_1    conda-forge
tzdata                    2025a                h78e105d_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_1    conda-forge
urllib3                   2.3.0              pyhd8ed1ab_0    conda-forge
vc                        14.3                ha32ba9b_23    conda-forge
vc14_runtime              14.42.34433         he29a5d6_23    conda-forge
vs2015_runtime            14.42.34433         hdffcdeb_23    conda-forge
wheel                     0.45.1             pyhd8ed1ab_1    conda-forge
win_inet_pton             1.1.0              pyh7428d3b_8    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
yaml-cpp                  0.8.0                h63175ca_0    conda-forge
zipp                      3.21.0             pyhd8ed1ab_1    conda-forge
zstandard                 0.23.0          py311h53056dc_1    conda-forge
zstd                      1.5.6                h0ea2cb4_0    conda-forge

Additional Context

This is the recipe:

source:
  path: .

requirements:

  build:
    - python

  run:
    - python

about:
  home: https://github.com/javierggt@hello

This is the code

pyproject.toml

[project]
name = "hello"
dynamic = ["version"]
dependencies = []

[tool.setuptools.packages.find]
include = ["hello"]  # package names should match these glob patterns (["*"] by default)

[build-system]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project.urls]
Homepage = "https://github.com/javierggt/hello"

[project.scripts]
hello = "hello.hello:main"

hello.py

def main():
    print("Hello!")

if __name__ == "__main__":
    main()
@javierggt javierggt added the type::bug describes erroneous operation, use severity::* to classify the type label Jan 17, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Jan 17, 2025
@javierggt
Copy link
Author

I repeated the process in the base environment, and got the same result. I did not change the description to reflect that, but I can if you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant