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

Error while building wheels for pycocotools in Evaluation environment. #14

Open
VidushiRawat opened this issue Oct 7, 2024 · 1 comment

Comments

@VidushiRawat
Copy link

Hi,

I am getting the following error while installing the dependencies in the evaluation environment.

I am currently using a MacOs and running the following command:
pip install -r requirements_eval.txt

and getting the following error:
I also upgraded pip and installed rust locally but it doesn't seem to be working:

Error stack:
Building wheels for collected packages: pycocotools, tokenizers
Building wheel for pycocotools (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /Users/vee/opt/anaconda3/envs/cl-alfred-eval/bin/python /Users/vee/opt/anaconda3/envs/cl-alfred-eval/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/tmp3_t1dahx
cwd: /private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-install-3o22uqev/pycocotools_6bb542b3e1a2435b9a827a73590eead9
Complete output (56 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/pycocotools
copying pycocotools/coco.py -> build/lib.macosx-10.9-x86_64-3.6/pycocotools
copying pycocotools/mask.py -> build/lib.macosx-10.9-x86_64-3.6/pycocotools
copying pycocotools/init.py -> build/lib.macosx-10.9-x86_64-3.6/pycocotools
copying pycocotools/cocoeval.py -> build/lib.macosx-10.9-x86_64-3.6/pycocotools
running build_ext
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
building 'pycocotools._mask' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/pycocotools
creating build/temp.macosx-10.9-x86_64-3.6/common
creating build/common
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-build-env-60k7m5hb/overlay/lib/python3.6/site-packages/numpy/core/include -I./common -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include/python3.6m -c pycocotools/_mask.c -o build/temp.macosx-10.9-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:10241:28: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'siz' (aka 'unsigned long') [-Wsign-compare]
10241 | __pyx_t_9 = (__pyx_t_8 == __pyx_v_n);
| ~~~~~~~~~ ^ ~~~~~~~~~
pycocotools/_mask.c:15579:76: warning: code will never be executed [-Wunreachable-code]
15579 | if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
| ^~~~~~~~
pycocotools/_mask.c:15579:73: note: silence by adding parentheses to mark code as explicitly dead
15579 | if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
| ^
| /* DISABLES CODE */ ( )
pycocotools/_mask.c:15667:9: warning: code will never be executed [-Wunreachable-code]
15667 | Py_ssize_t kwsize;
| ^~~~~~~~~~~~~~~~~~
pycocotools/_mask.c:15819:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
15819 | CYTHON_FALLTHROUGH;
| ^
pycocotools/_mask.c:576:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
576 | #define CYTHON_FALLTHROUGH attribute((fallthrough))
| ^
pycocotools/_mask.c:15830:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
15830 | CYTHON_FALLTHROUGH;
| ^
pycocotools/_mask.c:576:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
576 | #define CYTHON_FALLTHROUGH attribute((fallthrough))
| ^
5 warnings generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-build-env-60k7m5hb/overlay/lib/python3.6/site-packages/numpy/core/include -I./common -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include/python3.6m -c ./common/maskApi.c -o build/temp.macosx-10.9-x86_64-3.6/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c:135:32: warning: unused variable 'xp' [-Wunused-variable]
135 | uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
| ^~
1 warning generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include -arch x86_64 -I/private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-build-env-60k7m5hb/overlay/lib/python3.6/site-packages/numpy/core/include -I./common -I/Users/vee/opt/anaconda3/envs/cl-alfred-eval/include/python3.6m -c ../common/maskApi.c -o build/temp.macosx-10.9-x86_64-3.6/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
clang: error: no such file or directory: '../common/maskApi.c'
clang: error: no input files
/private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-build-env-60k7m5hb/overlay/lib/python3.6/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-install-3o22uqev/pycocotools_6bb542b3e1a2435b9a827a73590eead9/pycocotools/_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for pycocotools
Building wheel for tokenizers (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /Users/vee/opt/anaconda3/envs/cl-alfred-eval/bin/python /Users/vee/opt/anaconda3/envs/cl-alfred-eval/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/tmpur0qectm
cwd: /private/var/folders/9f/tnrgz3hd6_b323xq5pn25sf80000gn/T/pip-install-3o22uqev/tokenizers_d0fef7416a214018a54f5375fd25e72a
Complete output (51 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers
copying py_src/tokenizers/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/models
copying py_src/tokenizers/models/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/models
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/decoders
copying py_src/tokenizers/decoders/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/decoders
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/normalizers
copying py_src/tokenizers/normalizers/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/normalizers
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/pre_tokenizers
copying py_src/tokenizers/pre_tokenizers/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/pre_tokenizers
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/processors
copying py_src/tokenizers/processors/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/processors
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/trainers
copying py_src/tokenizers/trainers/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/trainers
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/byte_level_bpe.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/sentencepiece_unigram.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/sentencepiece_bpe.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/base_tokenizer.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/char_level_bpe.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
copying py_src/tokenizers/implementations/bert_wordpiece.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/implementations
creating build/lib.macosx-10.9-x86_64-3.6/tokenizers/tools
copying py_src/tokenizers/tools/init.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/tools
copying py_src/tokenizers/tools/visualizer.py -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/tools
copying py_src/tokenizers/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers
copying py_src/tokenizers/models/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/models
copying py_src/tokenizers/decoders/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/decoders
copying py_src/tokenizers/normalizers/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/normalizers
copying py_src/tokenizers/pre_tokenizers/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/pre_tokenizers
copying py_src/tokenizers/processors/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/processors
copying py_src/tokenizers/trainers/init.pyi -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/trainers
copying py_src/tokenizers/tools/visualizer-styles.css -> build/lib.macosx-10.9-x86_64-3.6/tokenizers/tools
running build_ext
running build_rust
error: can't find Rust compiler

If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

To update pip, run:

  pip install --upgrade pip

and then retry package installation.

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.

ERROR: Failed building wheel for tokenizers
Failed to build pycocotools tokenizers
ERROR: Could not build wheels for pycocotools, tokenizers, which is required to install pyproject.toml-based projects

@VidushiRawat
Copy link
Author

Additionally, there also seems to be an incompatibility between python version 3.6 and dataclasses==0.8

Error Stack:
ERROR: Ignored the following versions that require a different python version: 0.7 Requires-Python >=3.6, <3.7; 0.8 Requires-Python >=3.6, <3.7
ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses==0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant