[英]I cannot install python packages using pip3
I have installed pip3 successfully but whenever i try to install a package it comes up with this error(on macos high sierra terminal):我已成功安装 pip3,但每当我尝试安装 package 时,都会出现此错误(在 macos high sierra 终端上):
libsuinput/src/suinput.c:25:10: fatal error: 'linux/limits.h' file not found
#include <linux/limits.h>
^
1 error generated.
error: command 'gcc' failed with exit status 1
and和
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_4/bc_4xmsn63vb8kt8t5_g1wqm0000gn/T/pip-install-hby05qne/python-uinput/setup.py'"'"'; __file__='"'"'/private/var/folders/_4/bc_4xmsn63vb8kt8t5_g1wqm0000gn/T/pip-install-hby05qne/python-uinput/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_4/bc_4xmsn63vb8kt8t5_g1wqm0000gn/T/pip-record-xlhm8d89/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Can anyone help?任何人都可以帮忙吗?
Edit: it returns the same error using normal pip
编辑:它使用普通
pip
返回相同的错误
Solved.解决了。 Package i was trying to install was not compatible with MacOS.
我尝试安装的 Package 与 MacOS 不兼容。
Python 2 is installed by default on Apple computers(check by $ python --version
), but if you need Python 3 then you can use following steps- Python 2 默认安装在苹果电脑上(检查
$ python --version
),但如果你需要 Python 3 那么你可以使用以下步骤 -
$ xcode-select --install
.$ xcode-select --install
。 Then install homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To confirm Homebrew installed correctly, run this command: $ brew doctor
要确认 Homebrew 安装正确,请运行以下命令:
$ brew doctor
$ brew install python3
$ brew install python3
$ python3 --version
$ python3 --version
检查您的 python 版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.