- The main purpose of Python virtual environments is to create an isolated environment for Python projects. This means that each project can have its own dependencies, regardless of what dependencies every other project has. In other words, it is an isolated working copy of Python that allows you to work on a specific project without worry of affecting other projects.
- The connection between pip, virtualenv, pipenv, Anaconda, and conda is as follows:
- pip: The Python Package Manager:
- The PyPA recommended tool for installing Python packages
- You can find and publish Python packages using PyPI: The Python Package
Index (https://pypi.python.org/pypi)
- pyenv: Python Version Manager:
- pyenv lets you easily switch between multiple versions of Python
- If you need to use different versions of Python, pyenv lets you manage this easily
- virtualenv: Python Environment Manager:
- The virtualenv is a tool to create isolated Python environments
- To create a virtualenv, simply invoke virtualenv ENV, where ENV is a directory in which to place the new virtual environment
- To initialize the virtualenv, you need to source ENV/bin/activate
- To stop using virtualenv, simply call deactivate
- Once you activate the virtualenv, you can install all of a workspace's package requirements by running pip install -r requirements.txt
- anaconda: Package Manager, Environment Manager, and Additional Scientific Libraries:
- Anaconda includes an easy installation of Python and updates of over 100 prebuilt and tested scientific and analytic Python packages that include NumPy, Pandas, SciPy, Matplotlib, and IPython, with over 620 more packages available via a simple conda install <packagename>.
- conda is an open source package management system and environment
management system (provides virtual environment capabilities) included in the Anaconda distribution. Therefore, you can create virtual environments with conda. - While conda allows you to install packages, these packages are separate to PyPI packages, so you may still need to use pip additionally depending on the types of packages you need to install.
- Notebook documents are documents that are produced by the Jupyter Notebook App, which contain both computer code and rich text elements. Because of this mix of code and text elements, notebooks are the ideal place to bring together both an analysis description and its results. Moreover, they can be executed to perform data analysis in real time. The Jupyter Notebook App is a server-client application that allows for the editing and running of notebook documents via a web browser. The name Jupyter is an acronym that stands for the three languages it was designed for—Julia , Python, and R. It comes included in the Anaconda distribution.
- To work with images, the main packages that you need are as follows: Numpy, opencv, scikit-image, PIL, Pillow, SimpleCV, Mahotas, and ilastik. Additionally, to work in machine learning problems, you can also use pandas, scikit-learn, Orange, PyBrain, or Milk. Finally, if your computer vision project involves deep learning techniques, you can also use TensorFlow, Pytorch, Theano, or Keras.
- To install packages using pip according to the requirements.txt file from a local directory, we should execute pip install -r requirements.txt to install all the packages contained in this file. You can also create a virtual environment first, and then install all the required packages:
- cd to the directory where requirements.txt is located
- Activate your virtualenv
- Run pip install -r requirements.txt
- An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools, and a debugger. Most modern IDEs have intelligent code completion. Python IDE is the first thing you need to get started with Python programming. You can get started with Python programming in a basic text editor such as Notepad, but it is much better to use a complete and feature rich Python IDE.
PyCharm is a professional Python IDE, and comes in two flavors:
- Professional: Full-featured IDE for Python and web development (free trial)
- Community: Lightweight IDE for Python and scientific development (free, open source)
Most of its features are available in the Community flavor, including intelligent code completion, intuitive project navigation, on the fly error checking and fixing, code quality with PEP8 checks and smart refactoring, a graphical debugger, and test runner. It also integrates with IPython notebook, and supports Anaconda as well as other scientific packages such as Matplotlib and NumPy.
- OpenCV is released under a BSD license. Therefore, it is free for both commercial and academic use (https://www.opencv.org/license.html). BSD licenses can be grouped into three types:
- Two-clause BSD license
- Three-clause BSD license
- Four-clause BSD license
OpenCV uses the three-clause BSD license. All of these clauses are listed as follows:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
(3) Neither the name of the [organization] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
(4) All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the [organization].