06: linux下python开发环境梳理

1.1 修改~/.bashrc文件 改编终端颜色

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# User specific aliases and functions
export PS1='\[\e[32m\][\[\e[35m\]\u\[\e[m\]@\[\e[36m\]\h \[\e[31m\]\W\[\e[32m\]]\[\e[36m\]\$\[\e[m\] '


# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
vim ~/.bashrc

 1.2 Centos7.3安装python补全

  http://www.cnblogs.com/shaoguobao/archive/2011/05/31/2064336.html 

1.3 centos7下使用yum安装pip

  https://www.cnblogs.com/mangoVic/p/6428369.html

1.4 CENTOS使用VIRTUALENV搭建独立的PYTHON环境-PYTHON虚拟环境

  https://www.cnblogs.com/liuyansheng/p/6141197.html

  1、安装virtualenv

      yum install python-virtualenv

  2、创建python虚拟环境

       virtualenv env           # 执行后,在本地会生成一个与虚拟环境同名的文件夹

  3、启动虚拟环境    

      source bin/activate         # 启动虚拟环境

      deactivate                      # 退出虚拟环境

 1.5. centos pip install python-ldap报错

  error: Setup script exited with error: command 'gcc' failed with exit status 1

  https://www.cnblogs.com/dylan-wu/p/7772075.html

  yum install gcc libffi-devel python-devel openssl-devel -y

1.6 pycharm远程linux开发和调试代码

       https://www.cnblogs.com/lei0213/p/7898301.html

  https://www.cnblogs.com/xiongmao-cpp/p/7856596.html

1.7 python2.7无法安装python-ldap、django-auth-ldap 

  https://www.cnblogs.com/caowenhao/p/7807871.html

   python setup.py install

1.8 virtualenv复制虚拟独立的python环境

  https://blog.csdn.net/poxiaonie/article/details/78820015

1.9 解决shell脚本在windows下打开后运行报一下错误

  -bash: ./celery-crond.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
  : 没有那个文件或目录

 

  解决方法:

    vim打开后输入:  set ff 即可看到(fileformat=dos ),将其设置成  :set ff=unix  即可运行

posted @ 2018-04-15 15:20  不做大哥好多年  阅读(261)  评论(0编辑  收藏  举报