WebFaction
Community site: login faq

Can somebody recommend a way to install django with virtualenv and mod_wsgi 3.4/ python 3.3 ?

asked 27 Dec '13, 11:14

xpostudio4
128
accept rate: 100%


You just need to create a mod_wsgi3.4/python3.3 application to get your apache instance. Then in the httpd.conf, you just need to update the python-path to include your virtualenv as well as update the WSGIScriptAlias to point to your wsgi file for your project.

permanent link

answered 27 Dec '13, 11:40

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

I tried to install django with mod_wsgi 3.4, python 3.4 and the new venv module included in python 3.3 but i'm having permission problems: PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/site-packages/django'

I created a ticket to Webfaction staff but they haven't gave me a solution.

These were the steps I did to configure the venv module.

  1. I Created a mod_wsgi 3.4/Python 3.4 application from my.webfaction.com called "myapp".
  2. With SSH, I change directory (cd) to ~/webapps/
  3. Then I typed this: pyvenv-3.4 --symlink myapp
  4. I change directory to ~/webapps/myapp/
  5. I activate the venv with: source bin/activate
  6. I runned pip install django, but I got this permission error > PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/site-packages/django'

They told me this: The directory /usr/local/lib/python3.4/site-packages/django does not exist on our servers. You will need to change the installer to use /home/divxpr/lib/python3.4/site-packages/django instead.

How i do this? I asked them but i'm afraid they don't know how to do this.

Thanks,

Iván (Sorry for the I-centrism)

permanent link

answered 15 Jun '14, 08:06

Ivan Rivera
12
accept rate: 0%

I found a solution for this at this page: https://community.webfaction.com/questions/4253/simple-virtualenv-usage-with-django

The problem was that the version of pip i was running is the 1.5.4 (pip -V) and for all the packages installed with pip 1.5 version or greater you need to append --no-use-wheel like this:

pip3.3 install django --no-use-wheel

(15 Jun '14, 08:53) Ivan Rivera

Pip, executed within an activated virtualenv, shouldn't need the --no-use-wheel option.

Pip is also not installed by default when a virtualenv is created.

If you didn't install pip after enabling the virtual environment, then chances are you are using a different pip executable that uses the default python interpreter instead of the one in your venv, hence the mix up.

(15 Jun '14, 11:37) iliasr ♦♦

You are right, i haven't enable pip in the active environment since i thought pip is installed automatic with Python 3.4.

Do you know how to install PIP into a venv? i runned easy_install pip but the general pip executable is installed.

(16 Jun '14, 06:15) Ivan Rivera

With your venv activated, use wget to fetch https://bootstrap.pypa.io/get-pip.py and then run python get-pip.py. It should install pip, pip3 and pip3.4 in your virtualenv's bin directory, which you can use to install pacakges.

UPDATE: According to the documentation python 3.4 based venvs install pip by default. Python 3.3 ones, still need to manually have it installed.

(16 Jun '14, 16:43) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×55
×55
×23

question asked: 27 Dec '13, 11:14

question was seen: 6,589 times

last updated: 17 Jun '14, 07:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM