Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:29:01+00:00 2026-06-06T16:29:01+00:00

I am using virtualenvwrapper to use virtualenv for my Django deployement. Following is my

  • 0

I am using virtualenvwrapper to use virtualenv for my Django deployement.
Following is my Fabric task:

proj_path = '/path/to/proj'

def setup_code():
    sudo('pip install virtualenvwrapper')
    run('export WORKON_HOME=$HOME/.virtualenvs')
    run('source /usr/local/bin/virtualenvwrapper.sh && mkvirtualenv myenv')
    run('source /usr/local/bin/virtualenvwrapper.sh && workon myenv')
    cd(proj_path)
    req_file = os.path.join(proj_path, 'requirements.txt')
    run('pip install -r %s' % req_file)

I executed the above fab task, but it’s behaving strangely. pip starts retrieving all the packages, and then starts to execute the setup file for them. While executing setup file it crashes saying Permission denied.

But why? It’s working inside ~ and virtualenv.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:29:05+00:00Added an answer on June 6, 2026 at 4:29 pm

    Figured out the problem :

    For Fabric :

    cd('dir') # doesn't works.
    

    Following works:

    with cd('dir'):
        print('pwd') # Directory change reflects here.
    

    Similarly, other environmental things like :

    run('export WORKON_HOME=$HOME/.virtualenvs')
    run('source /usr/local/bin/virtualenvwrapper.sh && mkvirtualenv myenv')
    run('source /usr/local/bin/virtualenvwrapper.sh && workon myenv')
    

    But changed to :

    with prefix('WORKON_HOME=$HOME/.virtualenvs'):
        with prefix('source /usr/local/bin/virtualenvwrapper.sh'):
            with prefix('workon myenv'): # Assuming there is a env called `myenv`
                run('pip install -r requirements.txt') # Works in virtualenv
    

    Figured it out from the official documentation : http://docs.fabfile.org/en/stable/api/core/context_managers.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've installed virtualenv and virtualenvwrapper on Windows using easy_install. But mkvirtualenv is missing. I
I'm starting to use virtualenv and virtualenvwrapper on my projects. After activating the virtualenv
I'm using virtualenv and the virtualenvwrapper. I can switch between virtualenv's just fine using
Using LINQ on collections, what is the difference between the following lines of code?
i am setting up a virtualenv for django deployment. i want an isolated env
I've already been using pip and virtualenv (and actually sometimes still prefer a well
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using virtualenvwrapper to develop on the CKAN project is a bit more complex than
Current Python Workflow I have pip , distribute , virtualenv , and virtualenvwrapper installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.