[MacOS M1] Can not install via pip
See original GitHub issueSummary
- OS: MacOS 12.5
- Architecture: arm64
- Psutil version: 5.9.1
- Python version: 3.9.10
- Type: installation
Description
bin/pip install psutil
fails:
Collecting psutil
Using cached psutil-5.9.1.tar.gz (479 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: psutil
Building wheel for psutil (PEP 517) ... error
ERROR: Command errored out with exit status 1:
…
In file included from psutil/_psutil_osx.c:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:49:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h:81:49: error: expected ';' after top level declarator
typedef mach_vm_address_t IOVirtualAddress __kernel_ptr_semantics;
^
In file included from psutil/_psutil_osx.c:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:120:53: error: expected ';' after top level declarator
typedef natural_t OSAsyncReference[kOSAsyncRefCount] __kernel_ptr_semantics;
^
psutil/_psutil_osx.c:102:17: warning: format specifies type 'long' but the argument has type 'pid_t' (aka 'int') [-Wformat]
pid, err, errno, mach_error_string(err));
^~~
psutil/_psutil_common.h:111:21: note: expanded from macro 'psutil_debug'
fprintf(stderr, __VA_ARGS__); \
^~~~~~~~~~~
200 warnings and 2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil which use PEP 517 and cannot be installed directly
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Pip install doesn't work on m1 Mac - Super User
I tried installing it with ensurepip as well as with the official get-pip.py script. With the official installation script I get a warning:...
Read more >Pip install fails with M1 Mac #1221 - apple/coremltools - GitHub
Describe the bug Pip install for coremltools fails with M1 mac Numpy fails to build as a coremltools dependency Python 3.8.2, 3.8.10, 3.9, ......
Read more >pip Command Not Found – Mac and Linux Error Solved
When using Python, you might need to install and use certain packages. And there is a command available for that known as 'pip'....
Read more >Python pip installation on Mac is not working - Stack Overflow
Go to /Users/arnau/Library/Python/2.7/bin. Duplicate the files listed into /usr/local/bin/ so that the command-line can recognize your command, ...
Read more >How to Install PIP on a Mac - groovyPost
Open the Mac Terminal app via the Launchpad. · In the Terminal, type python -m ensurepip or python3 -m ensurepip and press Enter....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re also getting a similar error - (IOKit/IOKitLib.h file not found)
Running with macOS version 12.5.1 (Apple M1)
@ben9923 thanks for following up. i believe that i discovered the issue over the weekend. it had to do with xcode not being initialized. this small step ended up resolving the issue:
xcodebuild -runFirstLaunch