个人python开发环境搭建
短信预约 -IT技能 免费直播动态提醒
一、环境
ubuntu10.4
mysql5.1.60
python.2.6
java7
二、搭建
1. 安装ubuntu10.4,并更新软件包
2. sudo su- 切换到root用户下 安装mysql5.1.60
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/var/mysql.sock --sysconfdir=/usr/local/mysql/etc --with-charset=utf8 --without-debug --with-mysqld-user=mysql --with-extra-charsets=gb2312,big5,gbk
make
make install
mkdir /usr/local/mysql/etc
cp support-files/my-medium.cnf /usr/local/mysql/etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
PATH=/usr/local/mysql/bin:$PATH
echo "PATH=/usr/local/mysql/bin:\$PATH" >> /etc/profile
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe --user=mysql &
3. 安装python2.6.6
(1)安装支持包
sudo apt-get install -y build-essential
sudo apt-get install -y libncursesw5-dev
sudo apt-get install -y libssl
sudo apt-get install -y libssl-dev
sudo apt-get install -y python-dev
sudo apt-get install -y libreadline5-dev
sudo apt-get install -y libgdbm-dev
sudo apt-get install -y libc6-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y tk-dev
sudo apt-get install -y ruby
sudo apt-get install -y zlib1g
sudo apt-get install -y zlib1g.dev
sudo apt-get install -y libbz2-dev
sudo apt-get install -y libdb-dev
sudo apt-get install -y lzma-dev
(2)编译安装python2.6.6
sudo ./configure --prefix=/usr/local/python266
sudo make
sudo make install
(3)安装python虚拟隔离环境
sudo apt-get install python-setuptools
sudo easy_install virtualenv
virtualevn --no-site-packages --python /usr/local/python266/bin/python env
source env/bin/activate (进入python2.6.6的隔离环境)
#-- 使用pip安装相关的模块,例如安装MySQLdb,如下
pip install MySQL-python
4.安装java7
sudo apt-get purge openjdk*
sudo rm /var/lib/dpkg/info/oracle-java7-installer*sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341