[Python] Building a virtual python environment for the pyramid tutorial (summary)

To implement pyramid tutorial on Linux (debian) How to create a virtual python environment using virtualenv

Before, I tried to create an environment by groping, but since I learned a lot, I reorganized it.

setuptools, pip, virtualenv installation

For the time being, prepare three, setuptools, pip, and virtualenv.

#Installation of setuptools
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

#Easy when setuptools is installed_Install pip and virtualenv as install will be available
$ easy_install pip
$ easy_install virtualenv

You may need administrator privileges according to your environment.

Virtual Python environment construction

Build a virtual environment using virtualenv

#Build a virtual environment named sample
$ virtualenv --no-site-packages sample

By activating after building the environment, You can use the environment.

#sample Activate in virtual environment
$ cd sample
$ source bin/activate

If successful, the environment name will be displayed in () in the command. In the above case, it looks like (sample).

Deactivate command when leaving the environment

#Get out of the environment
$ deactivate

Install Pyramid

Install puramid while in the virtual environment. Work location is directly under the virtual environment directory

$ pip install pyramid

By the way, in my environment, this command installed Pyramid 1.4.5. It's different from the tutorial version, but I wonder if it can be managed.

Installation (tutorial)

Then follow Install Pyramid Tutorial Install what you need. Somehow I'm using pip instead of easy_install.

・ Project creation

$ bin/pcreate -s alchemy tutorial

-Installing the project in development mode

$ cd tutorial
$ python setup.py develop

・ Test execution

$ python setup.py test -q

・ Extraction of test coverage information

$ pip install nose coverage
$ ../bin/nosetests --cover-package=tutorial --cover-erase --with-coverage

-Database initialization

$ ../bin/initialize_tutorial_db development.ini

・ Launch application

$ ../bin/pserve development.ini --reload

This will start the server. This completes Tutorial installation.

Recommended Posts

[Python] Building a virtual python environment for the pyramid tutorial (summary)
[Mac] Building a virtual environment for Python
Building a Python virtual environment
Building a Python virtual environment
Building a virtual environment with Python 3
Let's create a virtual environment for Python
Building a Python development environment for AI development
[Python] Web development preparation (building a virtual environment)
Building a virtual environment for Mayavi dedicated to Python 3.6, Anaconda, Spyder users
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Building a Docker working environment for R and Python
Building and enabling a python virtual environment, etc. (venv)
Procedure for building a CDK environment on Windows (Python)
Building a Python environment for programming beginners (Mac OS)
Memo for building a machine learning environment using Python
Building a Python environment on Mac
Virtual Environment Version Control Summary Python
Enable the virtualenv Python virtual environment for Visual Studio Code
Building a python environment for artificial intelligence (Chainer / TensorFlow / CSLAIER)
Building a Python environment on Ubuntu
Summary from building Python 3.4. * From source to building a scientific computing environment
Create a virtual environment with Python!
Building a development environment for Android apps-creating Android apps in Python
Building a Hy environment for Lisper who hasn't touched Python
Create a virtual environment for python on mac [Very easy]
The shortest memo for building a python environment that takes less than 5 minutes to work.
Building a Docker working environment for R and Python 2: Japanese support
How about Anaconda for building a machine learning environment in Python?
Building a Windows 7 environment for getting started with machine learning with Python
Try using virtualenv, which can build a virtual environment for Python
From installing Ansible to building a Python environment in Vagrant's virtual environment
[Pyenv] Building a python environment with ubuntu 16.04
Building a Python3 environment with Amazon Linux2
About the virtual environment of python version 3.7
Building a virtual environment using homebrew + pyenv-virtualenv
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
Creating a python virtual environment on Windows
Building a conda environment for ROS users
Build a python virtual environment with pyenv
Add a Python virtual environment to VSCode
A note about doing the Pyramid tutorial
Prepare a Python virtual environment for your project with venv with VS Code
Create a Python development environment locally at the fastest speed (for beginners)
[Python, Scala] Do a tutorial for Apache Spark
Selenium + WebDriver (Chrome) + Python | Building environment for scraping
How to create a Python virtual environment (venv)
Created a Python wrapper for the Qiita API
Building a python environment with virtualenv and direnv
Building an environment for executing Python scripts (for mac)
Building an Anaconda environment for Python with pyenv
Building a Python environment with WLS2 + Anaconda + PyCharm
ffmpeg-Build a python environment and split the video
Python: Prepare a serializer for the class instance:
Build a simple Python virtual environment without pyenv
Think about building a Python 3 environment in a Mac environment
[Venv] Create a python virtual environment on Ubuntu
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
Procedure for creating a Python quarantine environment (venv environment)
A memo for creating a python environment by a beginner