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

TypeError: expected str, bytes or os.PathLike object, not list when performing conda build #5049

Closed
2 tasks done
kayjan opened this issue Oct 31, 2023 · 5 comments · Fixed by #5050
Closed
2 tasks done
Assignees
Labels
in-progress issue is actively being worked on locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Milestone

Comments

@kayjan
Copy link

kayjan commented Oct 31, 2023

Checklist

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

What happened?

I was trying to perform a conda build and faced this error

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda/cli/main.py", line 78, in main_subshell
        exit_code = do_call(args, parser)
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 142, in do_call
        result = plugin_subcommand.action(getattr(args, "_args", args))
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda_build/plugin.py", line 10, in build
        execute(*args, **kwargs)
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 568, in execute
        outputs = api.build(
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda_build/api.py", line 253, in build
        return build_tree(
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda_build/build.py", line 4026, in build_tree
        handle_anaconda_upload(tarballs, config=config)
      File "/Users/xx/miniforge3/lib/python3.9/site-packages/conda_build/build.py", line 4138, in handle_anaconda_upload
        subprocess.call(cmd + [package])
      File "/Users/xx/miniforge3/lib/python3.9/subprocess.py", line 349, in call
        with Popen(*popenargs, **kwargs) as p:
      File "/Users/xx/miniforge3/lib/python3.9/subprocess.py", line 951, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/Users/xx/miniforge3/lib/python3.9/subprocess.py", line 1712, in _execute_child
        and os.path.dirname(executable)
      File "/Users/xx/miniforge3/lib/python3.9/posixpath.py", line 152, in dirname
        p = os.fspath(p)
    TypeError: expected str, bytes or os.PathLike object, not list

`$ /Users/xx/miniforge3/bin/conda build -c conda-forge --output-folder . .`

  environment variables:
                 CIO_TEST=<not set>
    CONDA_ALLOW_SOFTLINKS=false
        CONDA_DEFAULT_ENV=testenv1
                CONDA_EXE=/Users/xx/miniforge3/bin/conda
             CONDA_PREFIX=/Users/xx/miniforge3/envs/testenv1
           CONDA_PREFIX_1=/Users/xx/miniforge3
    CONDA_PROMPT_MODIFIER=(testenv1)
         CONDA_PYTHON_EXE=/Users/xx/miniforge3/bin/python
               CONDA_ROOT=/Users/xx/miniforge3
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
                 INFOPATH=/opt/homebrew/share/info:
               LD_PRELOAD=<not set>
                  MANPATH=/opt/homebrew/share/man::
                     PATH=/Users/xx/miniforge3/bin:/Users/xx/miniforge3/bin:/Users/xx/miniforge3/bin:/Users/xx/miniforge3/envs/testenv1/bin:/Users/xx/miniforge3/bin:/Users/xx/miniforge3/bin:/Users/xx/miniforg
                          e3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/Syste
                          m/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xx/Li
                          brary/Application Support/Coursier/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : testenv1
    active env location : /Users/xx/miniforge3/envs/testenv1
            shell level : 2
       user config file : /Users/xx/.condarc
 populated config files : /Users/xx/miniforge3/.condarc
                          /Users/xx/.condarc
          conda version : 23.9.0
    conda-build version : 3.27.0
         python version : 3.9.18.final.0
       virtual packages : __archspec=1=m1
                          __osx=13.2.1=0
                          __unix=0=0
       base environment : /Users/xx/miniforge3  (writable)
      conda av data dir : /Users/xx/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/xx/miniforge3/pkgs
                          /Users/xx/.conda/pkgs
       envs directories : /Users/xx/miniforge3/envs
                          /Users/xx/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.9.0 requests/2.27.1 CPython/3.9.18 Darwin/22.3.0 OSX/13.2.1
                UID:GID : 502:20
             netrc file : /Users/xx/.netrc
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install <package>

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install <package>

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]: 
Timeout reached. No report sent.

Conda Info

active environment : testenv1
    active env location : /Users/xx/miniforge3/envs/testenv1
            shell level : 2
       user config file : /Users/xx/.condarc
 populated config files : /Users/xx/miniforge3/.condarc
                          /Users/xx/.condarc
          conda version : 23.9.0
    conda-build version : 3.27.0
         python version : 3.9.18.final.0
       virtual packages : __archspec=1=m1
                          __osx=13.2.1=0
                          __unix=0=0
       base environment : /Users/xx/miniforge3  (writable)
      conda av data dir : /Users/xx/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/xx/miniforge3/pkgs
                          /Users/xx/.conda/pkgs
       envs directories : /Users/xx/miniforge3/envs
                          /Users/xx/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.9.0 requests/2.27.1 CPython/3.9.18 Darwin/22.3.0 OSX/13.2.1
                UID:GID : 502:20
             netrc file : /Users/xx/.netrc
           offline mode : False

Conda Config

==> /Users/xx/miniforge3/.condarc <==
channels:
  - conda-forge

==> /Users/xx/.condarc <==
channels:
  - conda-forge
anaconda_upload: True

Conda list

# packages in environment at /Users/xx/miniforge3/envs/testenv1:
#
# Name                    Version                   Build  Channel
archspec                  0.2.1              pyhd8ed1ab_1    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bigtree                   0.14.2             pyhd8ed1ab_0    conda-forge
blinker                   1.6.3              pyhd8ed1ab_0    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boolean.py                4.0                pyhd8ed1ab_0    conda-forge
brotli-python             1.1.0           py311ha891d26_1    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
c-ares                    1.20.1               h93a5062_1    conda-forge
ca-certificates           2023.7.22            hf0a4a13_0    conda-forge
cctools                   973.0.1             hd1ac623_15    conda-forge
cctools_osx-arm64         973.0.1             h2a25c60_15    conda-forge
certifi                   2023.7.22          pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py311h4a08483_0    conda-forge
chardet                   5.2.0           py311h267d04e_1    conda-forge
charset-normalizer        3.3.1              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.9.0          py311h267d04e_1    conda-forge
conda-build               3.27.0          py311h267d04e_0    conda-forge
conda-forge-pinning       2023.10.26.11.34.06      hd8ed1ab_0    conda-forge
conda-index               0.2.3              pyhd8ed1ab_0    conda-forge
conda-package-handling    2.2.0              pyh38be061_0    conda-forge
conda-package-streaming   0.9.0              pyhd8ed1ab_0    conda-forge
conda-smithy              3.27.1             pyhd8ed1ab_0    conda-forge
conda-verify              3.1.1           py311h267d04e_1006    conda-forge
cryptography              41.0.5          py311h71175c2_0    conda-forge
curl                      8.4.0                h2d989ff_0    conda-forge
deprecated                1.2.14             pyh1a96a4e_0    conda-forge
filelock                  3.12.4             pyhd8ed1ab_0    conda-forge
future                    0.18.3             pyhd8ed1ab_0    conda-forge
gettext                   0.21.1               h0186832_0    conda-forge
git                       2.42.0          pl5321h46e2b6d_0    conda-forge
gitdb                     4.0.11             pyhd8ed1ab_0    conda-forge
gitpython                 3.1.40             pyhd8ed1ab_0    conda-forge
gmp                       6.2.1                h9f76cd9_0    conda-forge
icu                       73.2                 hc8870d7_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
isodate                   0.6.1              pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311h267d04e_3    conda-forge
krb5                      1.21.2               h92f50d5_0    conda-forge
ld64                      609                 h89fa09d_15    conda-forge
ld64_osx-arm64            609                 hc4dc95b_15    conda-forge
libarchive                3.7.2                h82b9b87_0    conda-forge
libcurl                   8.4.0                h2d989ff_0    conda-forge
libcxx                    16.0.6               h4653b0c_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h642e427_1    conda-forge
libexpat                  2.5.0                hb7217d7_1    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libiconv                  1.17                 he4db4b2_0    conda-forge
liblief                   0.12.3               hb7217d7_0    conda-forge
libllvm15                 15.0.7               h504e6bf_3    conda-forge
libnghttp2                1.52.0               hae82a92_0    conda-forge
libsodium                 1.0.18               h27ca646_1    conda-forge
libsqlite                 3.43.2               h091b4b1_0    conda-forge
libssh2                   1.11.0               h7a5bd25_0    conda-forge
libxml2                   2.11.5               h25269f3_1    conda-forge
libzlib                   1.2.13               h53f4e23_5    conda-forge
license-expression        30.1.1             pyhd8ed1ab_0    conda-forge
lz4-c                     1.9.4                hb7217d7_0    conda-forge
lzo                       2.10              h642e427_1000    conda-forge
markupsafe                2.1.3           py311heffc1b2_1    conda-forge
more-itertools            10.1.0             pyhd8ed1ab_0    conda-forge
msrest                    0.6.21             pyh44b312d_0    conda-forge
ncurses                   6.4                  h7ea286d_0    conda-forge
oauthlib                  3.2.2              pyhd8ed1ab_0    conda-forge
openssl                   3.1.4                h0d3ecfb_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
patch                     2.7.6             h27ca646_1002    conda-forge
pcre2                     10.40                hb34f9b4_0    conda-forge
perl                      5.32.1          4_hf2054a2_perl5    conda-forge
pip                       23.3.1             pyhd8ed1ab_0    conda-forge
pkginfo                   1.9.6              pyhd8ed1ab_0    conda-forge
pluggy                    1.3.0              pyhd8ed1ab_0    conda-forge
psutil                    5.9.5           py311heffc1b2_1    conda-forge
py-lief                   0.12.3          py311ha397e9f_0    conda-forge
pycosat                   0.6.6           py311heffc1b2_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pycryptodome              3.19.0          py311h7df3ba5_1    conda-forge
pygithub                  1.59.1             pyhd8ed1ab_0    conda-forge
pyjwt                     2.8.0              pyhd8ed1ab_0    conda-forge
pynacl                    1.5.0           py311heffc1b2_3    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.6          h47c9636_0_cpython    conda-forge
python-libarchive-c       5.0             py311h267d04e_2    conda-forge
python_abi                3.11                    4_cp311    conda-forge
pytz                      2023.3.post1       pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.1           py311heffc1b2_1    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
requests-oauthlib         1.3.1              pyhd8ed1ab_0    conda-forge
ripgrep                   13.0.0               h5ef7bb8_3    conda-forge
ruamel.yaml               0.17.40         py311h05b510d_0    conda-forge
ruamel.yaml.clib          0.2.7           py311heffc1b2_2    conda-forge
scrypt                    0.8.20          py311h36e034f_1    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
sigtool                   0.1.3                h44b9a77_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     5.0.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
tapi                      1100.0.11            he4954df_0    conda-forge
tk                        8.6.13               hb31c410_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
truststore                0.8.0              pyhd8ed1ab_0    conda-forge
typing_extensions         4.8.0              pyha770c72_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urllib3                   2.0.7              pyhd8ed1ab_0    conda-forge
vsts-python-api           0.1.25             pyhd8ed1ab_1    conda-forge
wheel                     0.41.2             pyhd8ed1ab_0    conda-forge
wrapt                     1.15.0          py311heffc1b2_1    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
yaml                      0.2.5                h3422bc3_2    conda-forge
zstandard                 0.21.0          py311hae4035a_1    conda-forge
zstd                      1.5.5                h4f39d0f_0    conda-forge

Additional Context

I faced this issue when building on my laptop (all the config statements above are from my laptop), and also when building on GitHub actions.

@kayjan kayjan added the type::bug describes erroneous operation, use severity::* to classify the type label Oct 31, 2023
@travishathaway travishathaway transferred this issue from conda/conda Nov 1, 2023
@travishathaway travishathaway added the source::community catch-all for issues filed by community members label Nov 1, 2023
@travishathaway
Copy link
Contributor

travishathaway commented Nov 1, 2023

Hi @kayjan,

Thanks for filing this issue.

I took a look at your GitHub action:

https://github.com/kayjan/bigtree/blob/master/.github/workflows/conda-publish.yml (I think that's the right one 😅)

You need to make sure that you also install the package anaconda-client. Not have this package is why you are seeing this error.

This is understandably a pretty bad error message to see for this case and can be improved. So, let's leave this issue open and improve that error message 😄.

Also, I think the last line in you GitHub action is redundant:

        anaconda upload ./noarch/*.tar.bz2

If you've configured conda-build to automatically upload to anaconda.org, then you do not need to do it again.

@travishathaway travishathaway added the severity::3 major; broken functionality with a workaround label Nov 1, 2023
@travishathaway
Copy link
Contributor

travishathaway commented Nov 1, 2023

I have been able to successfully recreate this error.

To recreate, you need to first set conda config --set anaconda_upload yes and then try to build a package. Make sure that anaconda-client is not installed.

@travishathaway travishathaway self-assigned this Nov 1, 2023
@travishathaway travishathaway added the in-progress issue is actively being worked on label Nov 1, 2023
@travishathaway travishathaway moved this from 🆕 New to 🏗️ In Progress in 🧭 Planning Nov 1, 2023
@kayjan
Copy link
Author

kayjan commented Nov 1, 2023

Thanks for your help! Have made the necessary changes and facing the error of Error: ('Authorization header was not given', 401) on this GitHub action.

Edit: I tried to add anaconda login --username $USERNAME --password $PASSWORD with the relevant environment variable but the error is that anaconda is an invalid command. But I have already installed anaconda-client, do I need to install something else? View details here.

Should I raise another issue?

@kayjan
Copy link
Author

kayjan commented Nov 3, 2023

I managed to fix this issue by setting the api token as environment variable instead of using the logging in method 😄

@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to 🏁 Done in 🧭 Planning Nov 3, 2023
@travishathaway
Copy link
Contributor

Hi @kayjan,

Glad to hear you've resolved this issue. We have just added a bug fix that will at least make the error message a little more informative next time.

@jezdez jezdez added this to the 3.28.0 milestone Nov 13, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in-progress issue is actively being worked on locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants