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

Could not install crypt_r on Mac #13

Open
sergei4e opened this issue Aug 16, 2024 · 6 comments
Open

Could not install crypt_r on Mac #13

sergei4e opened this issue Aug 16, 2024 · 6 comments

Comments

@sergei4e
Copy link

Could not install crypt_r on Mac.

% pip install crypt-r

Collecting crypt-r
Using cached crypt_r-3.13.1.tar.gz (20 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: crypt-r
Building wheel for crypt-r (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for crypt-r (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-cpython-311
copying src/crypt_r.py -> build/lib.macosx-10.9-x86_64-cpython-311
copying src/crypt.py -> build/lib.macosx-10.9-x86_64-cpython-311
running egg_info
writing src/crypt_r.egg-info/PKG-INFO
writing dependency_links to src/crypt_r.egg-info/dependency_links.txt
writing top-level names to src/crypt_r.egg-info/top_level.txt
reading manifest file 'src/crypt_r.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.h' under directory 'src'
adding license file 'LICENSE'
writing manifest file 'src/crypt_r.egg-info/SOURCES.txt'
running build_ext
building '_crypt_r' extension
creating build/temp.macosx-10.9-x86_64-cpython-311
creating build/temp.macosx-10.9-x86_64-cpython-311/src
clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /<...>/include -fPIC -O2 -isystem /Users/serg/opt/anaconda3/envs/tokenizer/include -I/Users/<...>/include/python3.11 -c src/_crypt_r.c -o build/temp.macosx-10.9-x86_64-cpython-311/src/_crypt_r.o
src/_crypt_r.c:9:10: fatal error: 'crypt.h' file not found
#include <crypt.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: Failed building wheel for crypt-r
Failed to build crypt-r
ERROR: Could not build wheels for crypt-r, which is required to install pyproject.toml-based projects

@frenzymadness
Copy link
Member

I don't know Mac well enough to help you fix that but the error indicates that you need to install a package containing crypt.h header file.

As I'm looking for some solutions online, it might also require some changes here in the code because the functions might be declared in different header files.

@encukou
Copy link
Member

encukou commented Aug 16, 2024

See the README:

This library is tested with the crypt_r implementation in Fedora Linux (libxcrypt, as of 2024), and should work with compatible implementations of crypt_r (such as libcrypt.so from older glibc).

Do you have libxcrypt (or another implementation) installed on the system?

@hroncok
Copy link
Member

hroncok commented Aug 17, 2024

For example, libxcrypt is available on homebrew.

@sergei4e
Copy link
Author

libxcrypt 4.4.36 is already installed and up-to-date
but
ERROR: Could not build wheels for crypt-r, which is required to install pyproject.toml-based projects

@hroncok
Copy link
Member

hroncok commented Aug 20, 2024

libxcrypt 4.4.36 is already installed and up-to-date

Installed how? Including the devel files (such as the header)?

@hroncok
Copy link
Member

hroncok commented Nov 4, 2024

@sergei4e Do you still have this problem? Do you have libxcrypt header files installed?

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

4 participants