[英]error: command 'gcc' failed with exit status 1 on centos 6.5
[英]error: command 'gcc' failed with exit status 1 on CentOS
我正在嘗試使用sudo pip install lxml
在 CentOS 上安裝 lxml 包,並在最后拋出此錯誤:
error: command 'gcc' failed with exit status 1
---------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-PjviBq-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/lxml
Storing complete log in /root/.pip/pip.log
[hg@user-centos-1 ~]$ error: command 'gcc' failed with exit status 1
bash: error:: command not found
“錯誤:命令‘gcc’失敗,退出狀態為 1”。 由於缺少 python-devel 和一些依賴項,安裝失敗。
糾正gcc問題的最佳方法:
您需要重新安裝 gcc 、 gcc-c++ 和依賴項。
對於python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
對於python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
希望這會有所幫助。
gcc 安裝了嗎?
sudo yum install gcc
我打賭你必須安裝libxml2-devel
或libxml++-devel
甚至python-devel
。 但這只是一個瘋狂的猜測,沒有從日志文件中看到實際的錯誤。 但似乎gcc
缺少頭文件或庫文件。
sudo yum install python36 python36-devel python36-libs python36-tools
如果使用python36,這是設置的最佳路徑。 在 aws ec2 實例上為我糾正了這個錯誤
我是怎么解決的
# yum update
# yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# yum install -y python36u python36u-libs python36u-devel python36u-pip
# pip3.6 install pipenv
我希望它會幫助某人解決“gcc”問題。
pip install -U pip
pip install -U cython
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.