Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Why should i use vagrant if i use virtualenv?

The difference between virtualenv and Vagrant is that virtualenv is only about separate Python installations whereas Vagrant is about the whole machine.

  • virtualenv isolates the Python interpreter and the Python dependencies on one machine so you can install multiple Python projects alongside each other with their own dependencies. But for the rest of the machine the virtualenv doesn't do anything: you still have global dependencies / packages that are installed using your Mac OS X / Linux package manager and these are shared between the virtualenvs.

  • Vagrant specifies the whole machine: it allows you to specify the Linux distribution, packages to be installed and actions to be taken to install the project. So if you want to launch a Vagrant box with multiple Python projects on that machine you'd still use virtualenv to keep the Python dependencies separate.

For example, a developer on Mac OS X and a developer on Ubuntu Linux can use virtualenv to keep their Python projects installed but they'd need to use Vagrant to locally launch the same machine (e.g., a Linux distribution which matches the deployed server) to run exactly the same Linux version with the same packages installed on it and with the same Python project installations.

So, to answer your question, the reason to use Vagrant is that it allows you to locally create a machine with the exact packages installed whereas virtualenv would only concern itself with the Python dependencies.

Categories : Python

Related to : Why should i use vagrant if i use virtualenv?
How does pip know about virtualenv and where to install packages
Virtualenvs have the pip command installed in their bin/ directories. By swapping out the PATH you are executing a different pip command each time. The bin/pip script is tied to the bin/python executable for that virtual env, and in turn that bin/python executable is tied to the virtualenv; you don't have to use source bin/activate to be able to use a virtualenv, because just the bin/python execu

Categories : Python
Does virtualenv serve a purpose (in production) when using docker?
Virtualenv was created long before docker. Today, I lean towards docker instead of virtualenv for these reasons: Virtualenv still means people consuming your product need to download eggs. With docker, they get something which is "known to work". No strings attached. Docker can do much more than virtualenv (like create a clean environment when you have products that need different Python version

Categories : Python
How to automatically start virtualenv environments on windows
The activate script from virtualenv gave me some clues. The trick was to prepend the virtualenv path to the system path. Then the script could just cd into the project directory and start the app. @echo off set "VIRTUAL_ENV=C:UsersDarknCodePythonflask-introvenv" set "PATH=%VIRTUAL_ENV%Scripts;%PATH%" cd C:UsersDarknCodePythonflask-intro waitress-serve --port=5000 app:app

Categories : Python
Setting up development vagrant box for Rails
you need to install the bundle gem using the rbenv gem command: rbenv global 2.1.2 # ensure all shims for current ruby version are there rbenv rehash gem install bundler # rehash again to make sure you get the `bundler` command from `rbenv` rbenv rehash bundle install Hope this helps

Categories : Ruby On Rails
Symfony 2 application on Vagrant + Docker
I haven't used vagrant with docker, but I have had a simliar issue just using vagrant and symfony. I had to configure the permissions for the logs and cache dirs in the vagrant file, so something like this (guest is Ubuntu 14.04): config.vm.synced_folder "symfony/app/cache", "/vagrant/symfony/app/cache", owner: "www-data", group: "vagrant", mount_options: ["dmode=775,fmode=664"] config.vm.synced

Categories : Symfony2
Recently Add
Unable to Delete and redraw or Draw over plot axes based on PYQT widget state change
Generate, fill and plot a hexagonal lattice in Python
Getting a decorator with args to work with method: self does not exist
Is this function correct?
kivy adding variables to the root widget
Pandas: Generate a histogram/pivot against timeseries data
bash wrap a piped command with a python script
Selecting a combo box using selenium webdriver xpath
How to check how many calls left in AlchemyAPI? python
sklearn.ensemble.AdaBoostClassifier cannot accecpt SVM as base_estimator?
Sklearn Linear Regression - "IndexError: tuple index out of range"
How can I keep an object selected in the outliner after physically deselecting it in the 3d view?
Limiting results with Jinja (Python)
Python Flask - Which file is used to log?
ros python publisher/subscriber
Get spline fit residual from scipy.interpolate.splprep()
A linker error of Boost.Python in Visual Studio 2008
access parent methods in python
Python retreive DayOfWeek as integer
Async insertAll requests using python-api-client
django modelForm filter isn't effective?
Many numpy array manipulations in one array
How can I unit-test a method without instantiating the class?
base.html can't access {% if user.is_authenticated %}
How to cope with diacritics while trying to match with regex in Python
Data is missing after using @validate with Schema
Find out where a process writes to
kivy - getting a spinner to remember its selection
Regular expression is not working
Django - Get a QuerySet of Months and the amount of expense
© Copyright 2017 Publishing Limited. All rights reserved.