Can't pip install on Macbook
Hi,
thanks for sharing your code!
I'm trying to install this package on a Macbook Pro, put using pip install corels or cloning the repo and using pip install . does not work.
Here is the output. As you can see, I'm using miniconda3, with a clean environment. I already tried to install g++ and gmp (brew install g++ gmp).
(corels) berga@Lucas-MacBook-Pro pycorels % pip install .
Processing /Users/berga/PycharmProjects/pycorels
Preparing metadata (setup.py) ... done
Collecting numpy
Using cached numpy-1.24.2-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
Building wheels for collected packages: corels
Building wheel for corels (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
Traceback (most recent call last):
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 87, in <module>
install(True)
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 61, in install
setup(
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/numpy-1.24.2.dist-info' -> '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/EGG-INFO'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 89, in <module>
install(False)
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 61, in install
setup(
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/numpy-1.24.2.dist-info' -> '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for corels
Running setup.py clean for corels
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
Traceback (most recent call last):
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 87, in <module>
install(True)
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 61, in install
setup(
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/numpy-1.24.2.dist-info' -> '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/EGG-INFO'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 89, in <module>
install(False)
File "/Users/berga/PycharmProjects/pycorels/setup.py", line 61, in install
setup(
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
return fetch_build_egg(self, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
os.rename(dist_info, egg_info)
OSError: [Errno 66] Directory not empty: '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/numpy-1.24.2.dist-info' -> '/Users/berga/PycharmProjects/pycorels/.eggs/numpy-1.24.2-py3.11-macosx-11.1-arm64.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for corels
Failed to build corels
Installing collected packages: numpy, corels
Running setup.py install for corels ... error
error: subprocess-exited-with-error
× Running setup.py install for corels did not run successfully.
│ exit code: 1
╰─> [37 lines of output]
running install
/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-11.1-arm64-cpython-311
creating build/lib.macosx-11.1-arm64-cpython-311/corels
copying corels/corels.py -> build/lib.macosx-11.1-arm64-cpython-311/corels
copying corels/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/corels
copying corels/utils.py -> build/lib.macosx-11.1-arm64-cpython-311/corels
copying corels/VERSION -> build/lib.macosx-11.1-arm64-cpython-311/corels
running build_ext
building 'corels._corels' extension
creating build/temp.macosx-11.1-arm64-cpython-311
creating build/temp.macosx-11.1-arm64-cpython-311/corels
creating build/temp.macosx-11.1-arm64-cpython-311/corels/src
creating build/temp.macosx-11.1-arm64-cpython-311/corels/src/corels
creating build/temp.macosx-11.1-arm64-cpython-311/corels/src/corels/src
clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/berga/miniconda3/envs/corels/include -arch arm64 -fPIC -O2 -isystem /Users/berga/miniconda3/envs/corels/include -arch arm64 -Icorels/src/ -Icorels/src/corels/src -I/Users/berga/miniconda3/envs/corels/include/python3.11 -I/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/numpy/core/include -c corels/_corels.cpp -o build/temp.macosx-11.1-arm64-cpython-311/corels/_corels.o -Wall -O3 -std=c++11 -DGMP
corels/_corels.cpp:220:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~~~~~~~~~
1 error generated.
running install
/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
running build_ext
building 'corels._corels' extension
clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/berga/miniconda3/envs/corels/include -arch arm64 -fPIC -O2 -isystem /Users/berga/miniconda3/envs/corels/include -arch arm64 -Icorels/src/ -Icorels/src/corels/src -I/Users/berga/miniconda3/envs/corels/include/python3.11 -I/Users/berga/miniconda3/envs/corels/lib/python3.11/site-packages/numpy/core/include -c corels/_corels.cpp -o build/temp.macosx-11.1-arm64-cpython-311/corels/_corels.o -Wall -O3 -std=c++11
corels/_corels.cpp:220:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> corels
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Can you help me? Thanks :)
Hello, just updating my issue. It seems that installing on Python 3.10 solves my issue, as this error occurs on Python 3.11 only. It seems that, on my system, the file longintrepr.h is found in a different directory for Python 3.11 (include/python3.11/cpython/longintrepr.h instead of include/python3.10/longintrepr.h). For me, changing the Python version is not a critical issue, but for others, I think it would be nice to be able to install it on Python 3.11.
I'm using Python 3.12.5 and when I pip install corels or pip install . I get the same error _corels.cpp:220:12: fatal error: 'longintrepr.h' file not found.
same error in python3.9. Is there any solutions available?