centos6 安装python3.5后pip无法使用的处理

现象:安装pip后发现命令无法识别command not found

原因:which查看找到不到执行路径   find搜索发现安装后存放在/usr/local/python3.5/bin下,于是判断是因为没有注册路径的问题

解决:参考地址为https://lempstacker.com/tw/Installing-Python-3-5-on-CentOS-7/

http://blog.csdn.net/apn172/article/details/8868968

1、导出头文件: /usr/local/python3.5/include

2、导出库文件: /usr/local/python3.5/lib

3、为可执行程序添加PATH路徑: /usr/local/python3.5/bin

具体执行过程如下:

[[email protected] python3.5]$ sudo ln -sv /usr/local/python3.5/include /usr/local/include/python3                  #如果采用的是root账户就可以不加sudo      ln为添加软链接
‘/usr/local/include/python3/include’ -> ‘/usr/local/python3.5/include’
[[email protected] python3.5]$
[[email protected] python3.5]$ echo ‘/usr/local/python3.5/lib‘ | sudo tee /etc/ld.so.conf.d/python351.conf         #tee重定向文件,把python3.5的库文件路径写入python351.conf然后放在/etc/ld.so.conf.d下
/usr/local/python3.5/lib
[[email protected] python3.5]$ cat /etc/ld.so.conf.d/python351.conf
/usr/local/python3.5/lib
[[email protected] python3.5]$ sudo ldconfig -v
echo ‘export PATH=$PATH:/usr/local/python3.5/bin‘ | sudo tee /etc/profile.d/python351.sh                     #添加环境变量

#使文件生效
source /etc/profile.d/python351.sh
时间: 2024-11-08 07:36:41

centos6 安装python3.5后pip无法使用的处理的相关文章

CentOS7 安装 Python3.8后 pip 安装报错

[[email protected] Python-3.8.0]# pip install bs4 Collecting bs4 Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz ERROR: Command errored out with exit status 1: c

安装python3.6后使用pip报错

安装python3.6后,pip是一起安装好的,安装目录再C:\Programs\Python\Python36-32\Scripts中. 在python终端模式下使用pip出现错误如下: 错误原因:pip不应在python终端模式下使用:直接在cmd下使用pip即可. 原文地址:https://www.cnblogs.com/feitian629/p/10362154.html

centos7安装python3.5后文件不兼容问题

源码安装python3.5           1.      准备环境                       yum install gcc-* glibc-* -y           2.     下载python3.5源码安装包                        wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz           3.      解包                    

Centos7 安装python3.8和pip

安装python3 yum -y install yum-utilsyum-builddep pythoncurl -O https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgztar xf Python-3.8.0.tgzcd Python-3.8.0./configuremakemake install 设置python3为默认版本 vi /etc/profile.d/python.sh #编辑用户自定义配置,输入alias参数?ali

centos6安装python3.4和pip3

在安装了epel源的情况下,直接yum就可以安装python3.4 yum install python34 -ypython3 --version 没有自带pip3,从官网安装 wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py python3 get-pip.pypip3 -V 写个简单的代码 #!/usr/bin/python3 # -*- coding: UTF-8 -*- import sys print(s

CentOS 6.8 安装python3.7后 yum出错

升级python2.6.6 到python3.7后,将软连接重新定义python到python3上.再用yum 提示:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax 解决办法:首先确保python2.6还在,然后:修改:/usr/bin/yum文件:将第一行"#!/usr/bin/python" 改为 "#!/usr/bin/pyt

centos6,python3,通过pip安装pycurl出现报错提示

Centos6.7系统,python3.6.7,通过 pip 安装pycurl出现报错: __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config': 'curl-config' 系统已经安装了curl,出现此错误提示一般是因为没有安装对应的开发库,解决方法: yum -y install libcurl-devel 原文地址:https://

Centos6.5 编译安装python3.5版本,无法使用退格键方向键删除键等

记录一下: 解决办法: 安装yum install readline-devel.x86_64,删除编译好的python3.5,重新编译python3.5即可.

centos6安装python3.6.4

安装Python依赖包: [[email protected] src]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 下载Python源码包: [[email protected] src]# wget ttp://mirrors.sohu.com/python/3.6.4/Python-3.6.4.tgz 编译.安装: