w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Issues in Installing Python packages in webfaction
  • as Daniel Roseman noted - the syntax error came from using Python2.4
  • the permission problem is caused by trying to install into system Python, what requires sudo or being root

Possible solutions

Install into system Pyhton (using sudo)

$ sudo pip install mezzanine

This will spoil the system Python and is not much recommended. It would be well acceptable if you are e.g. under Docker.

Install into user profile

$ pip install --user mezzanine

It will install the package into user scheme and will not spoil system Python.

This is more acceptable, but can soon become messy environment to run code in, as Python will import form user scheme, sometime from system.

Use virtualenv

Assuming you have virtualenv installed:

$ cd ~/projects
$ mkdir mezza
$ cd mezza
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install mezzanine
$ pip freeze
mezzanine==3.1.8

(there will be a bit more lines from freeze).

This installs into virtualenv, which is easy to recreate, destroy, and does not mess up with other environments.

With virtulanevwrapper you will get set of additional tools, which will simplify your environment a lot.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.