在这篇文章中,我们将带领您了解CENTOS7Python3.7.1安装pyzmq的全貌,包括centos7安装python3.6的相关情况。同时,我们还将为您介绍有关()centos7安装python
在这篇文章中,我们将带领您了解CENTOS7 Python3.7.1 安装 pyzmq的全貌,包括centos7安装python3.6的相关情况。同时,我们还将为您介绍有关() centos7 安装 python36、centos7 - 安装 python3.7、CENTOS7 Python3.7 PyAudio 安装、CENTOS7 Python3.7 pygame 安装的知识,以帮助您更好地理解这个主题。
本文目录一览:- CENTOS7 Python3.7.1 安装 pyzmq(centos7安装python3.6)
- () centos7 安装 python36
- centos7 - 安装 python3.7
- CENTOS7 Python3.7 PyAudio 安装
- CENTOS7 Python3.7 pygame 安装
CENTOS7 Python3.7.1 安装 pyzmq(centos7安装python3.6)
直接安装出现错误,缺少库文件
gcc -pthread build/temp.linux-aarch64-3.7/scratch/tmp/timer_createv3ufssd_.o -o build/temp.linux-aarch64-3.7/scratch/a.out
build/temp.linux-aarch64-3.7/scratch/tmp/timer_createv3ufssd_.o: In function `main'':
/tmp/timer_createv3ufssd_.c:2: undefined reference to `timer_create''
collect2: error: ld returned 1 exit status
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.linux-aarch64-3.7/scratch/vers.c -o build/temp.linux-aarch64-3.7/scratch/vers.o
build/temp.linux-aarch64-3.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory
#include "zmq.h"
^
compilation terminated.
error: command ''gcc'' failed with exit status 1
Failed with default libzmq, trying again with /usr/local
{''libraries'': [''zmq''], ''include_dirs'': [''/usr/local/include''], ''library_dirs'': [''/usr/local/lib''], ''runtime_library_dirs'': [''/usr/local/lib''], ''extra_link_args'': []}
解决
sudo yum -y install zeromq-devel zeromq
sudo yum -y install czmq-devel czmq
pip3.7 install pyzmq
() centos7 安装 python36
centos7 默认安装 python2.7
1. 先安装 python36 和对应 pip
yum install python-pip #安装python2的pip
yum install python36
yum install python36-pip
2. 修改软链接
(1)软链接由 python2 变成 python3
ln -snf python3 python
(2)pip 默认成 python3 的
mv pip pip.bak
ln -snf pip3 pip
3. 修改 #!文件
yum 和 urlgrabber-ext-down 需要依赖 Python2
vim /usr/bin/yum
vim /usr/libexec/urlgrabber-ext-down
都改成 #! /usr/bin/python2.7
手动安装的软件一般在此目录下
/usr/local
centos7 - 安装 python3.7
说明
全部操作都在 root
用户下执行
1. 安装编译相关工具
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install libffi-devel -y
2. 下载安装包解压
cd #回到用户目录
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar -xvJf Python-3.7.0.tar.xz
3. 编译安装
mkdir /usr/local/python3 #创建编译安装目录
cd Python-3.7.0
./configure --prefix=/usr/local/python3
make && make install
4. 创建软连接
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
5. 验证是否成功
python3 -V
pip3 -V
CENTOS7 Python3.7 PyAudio 安装
出现错误:
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/usr/local/python371/include/python3.7m -c src/_portaudiomodule.c -o build/temp.linux-aarch64-3.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command ''gcc'' failed with exit status 1
安装依赖包:
sudo yum -y install portaudio portaudio-devel
CENTOS7 Python3.7 pygame 安装
安装出现错误:
WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...
/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
Hunting dependencies...
WARNING: "sdl-config" failed!
WARNING: "pkg-config freetype2" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
解决:
sudo yum -y install SDL-devel
有出现错误:
WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...
Hunting dependencies...
WARNING: "pkg-config freetype2" failed!
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 2.4.11
Missing dependencies
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ln87l5bh/pygame/
关于CENTOS7 Python3.7.1 安装 pyzmq和centos7安装python3.6的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于() centos7 安装 python36、centos7 - 安装 python3.7、CENTOS7 Python3.7 PyAudio 安装、CENTOS7 Python3.7 pygame 安装的相关知识,请在本站寻找。
本文标签: