ubuntu下用Pip安装python拓展包

时间:2021-10-26 02:07:30

ubuntu下用Pip安装python拓展包

今天在windows下学习django的时候创建admin的用户,在python命令模式执行manage.py createsuperuser

python.exe虚拟机崩溃...我也崩溃了,按照教程一步步没错,环境也没问题,在网上找到了一些同样的错误 但貌似

没解决方法,建议换到linux环境下..没办法只能将python整体搬迁到ubuntu虚拟机中,晚上在配环境安装以前的

一些python拓展。在python中可以使用easy_install和pip安装python拓展但推荐使用pip,在*看到

个帖子:

Don't use easy_install, unless you like stabbing yourself in the face. Use pip.

Two reasons, there may be more:

  1. pip provides an uninstall command

  2. if an installation fails in the middle, pip will leave you in a clean state.

安装pip的方法:

Install pip and virtualenv for Ubuntu 10.10 Maverick and newer

$ sudo apt-get install python-pip python-dev build-essential 
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv

For older versions of Ubuntu

  • Install Easy Install
    $ sudo apt-get install python-setuptools python-dev build-essential 
  • Install pip
    $ sudo easy_install pip 
  • Install virtualenv
    $ sudo pip install --upgrade virtualenv 
安装mysql拓展包可以:sudo pip install mysql-python安装其他的包只要pip + 包的名字 就行了 很方便。而且安装完的mysqlib用起来没一点问题,在windows下还要修改下源文件。写程序还是在linux下好啊。安装mysql apt-get install mysql-server