Python working Environment


Setup python working environment with virtual environment and virtual-wrapper (LINUX)

Start the set-up with some testing.

Check whether python-pip is installed using the command
pip version
If pip is not there using this command you can install it using below command

sudo apt-get install python-pip python dev build-essential
This will install pip which will be required to install other pip packages and python-dev setup other header-files.
Now install virtualenvs and virtual wrapper
sudo apt-get install virtualenv && virtualenvwrapper
Now you had installed virtual environment and virtualenvwrapper. now it time to make some alias and setup project working directories.
Create a folder name virtualenvs anywhere your machine. I prefer to create on my home directory.
Use this command to create directory
mkdir ~/virtualenvs
Now its time to make some alias so that handling of the environment will be easier.
open up your bashrc file. Mainly this is located at your home directory in Ubuntu.
vim ~/.bashrc
Copy and paste these lines at the very end of your bashrc file
export PROJECT_HOME=~/virtualenvs
. /usr/local/bin/virtualenvwrapper.sh
These two lines will do all things, but I need some additional features like color for git and root color show git branch name and many more.


parse_git_branch() {
   git branch 2 > /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/(/1)/'
}
ps1= '$(debian_chroot:+($debin)chroot)}\[\033[01:32m\]\u@\h\[\033[00m\]:\[\033[01:34m\]\w\[\033[01:31\]\w\[\033[01:31\]$(parse_git_branch)\[\033[00m\]\$'
unset color_prompt force_color_prompt
Now the environment is ready to use.
To create an environment with this command.
mkproject projectname
To start and existing project
workon project_name

Comments

  1. See on tõesti kasulik ajaveeb, et leida oma teadmiste lisamiseks mõni muu allikas. Töökeskkonna riskianalüüs

    ReplyDelete
  2. COMMONWEALTH Casino Commission Executive Director Andrew Yeom on Friday appeared earlier than a House committee to present the findings of his analysis into the feasibility of internet gambling within the CNMI. During Q1 2022, GKL reported a net loss totaling 10.eighty billion Korean received, the equal of US$8.5 million. Plus, the corporate posted 파라오카지노 an operating loss of forty two.29 billion Korean received. For Q1 + Q2 2022, GKL was also operating within the red with a loss of 18.77 billion Korean received, down sixty six.2% from the same period in 2021 (55.49 billion Korean won). But the necessary figure for the corporate is the revenue generated for Q1 + Q2 + Q3 of 2022 – up 160%, at US$121.1 million.

    ReplyDelete

Post a Comment

Popular Posts