python环境的解决方案

pip错误-failed to create process/fatal error in launcher

电脑同时装了python2和python3,并且都配置了环境变量

将python2的python.exe改成python2.exe,python3的python.exe没有改(主要用python2时则可改python3的exe)

命令行里输入python,python2会进入对应的python版本

但输入pip2会报错: failed to create process

可改成 python2 -m pip  就ok了,后面就可以接pip的各种命令

用pip2安装包时:

python2 -m pip install pack_name
python2 -m pip install numpy pandas  

运行脚本时:

  1.  
    #!python2 #要写在文件编码声明前
  2.  
    # -*-coding:utf-8 -*-

由于某种原因,下载了python3.6又卸载后,再重新下python3.5 

按照上面重新改好python2,python3后,输入pip,pip2,pip3,都会报错

pip报错:fatal error in launcher:unable to create using process时

  1.  
    python2 -m pip install --upgrade pip
  2.  
    python -m pip install --upgrade pip

再试一遍,发现完美解决了,pip,pip2,pip3都不会报错了。

posted @ 2019-04-30 20:57  7411  阅读(103)  评论(0)    收藏  举报