GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - maudzung/virtual_environment_python3: The instruction to setup a virtual environment

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
Readme.md
Readme.md
 
 
requirement.txt
requirement.txt
 
 
setup.sh
setup.sh
 
 

Repository files navigation

The instruction to setup a virtual environment

We usually work on different projects with different libraries, even with different versions of same libraries. Therefore, we should use virtual environments.
Each project works on a specific virtual environment.

Set execute permission to setup.sh, then run it

chmod +x setup.sh
./setup.sh

Add the below lines to ~/.profile

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

similarly, add these lines to ~/.bashrc

export WORKON_HOME=~/.virtualenvs
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3'
source /usr/local/bin/virtualenvwrapper.sh

Execute these commands:

source ~/.profile
source ~/.bashrc

Now, we're going to create a virtual environment:

mkvirtualenv imrc -p python3

(imrc is the name of your environment)

To work on the new environment, execute the command:

workon imrc

Now, you are in the virtual environment named imrc, you should install essential libraries in the environment for our work. The libraries are listed in the requirement.txt file, you can modify (add/delete) libraries that you don't need to use.
Obviously, you can install any libraries whenever you want. Run the command to install libraries listed in the requirement.txt:

pip install -r requirement.txt

Now, you can work with the essential libs. To check the libraries that are installed in your environment, run:

pip list

Thank you.

About

The instruction to setup a virtual environment

Topics

librariespip3python3virtualenv

Resources

Readme
Activity

Stars

13 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.