lxml installation error ubuntu 14.04 (internal compiler error)

Possible solution (if you have no ability to increase memory on that machine) is to add swap file. sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288 sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile from https://github.com/pydata/pandas/issues/1880#issuecomment-9920484 This worked for me on smallest digital ocean machine

Too many different Python versions on my system and causing problems

Why did it get messed up? There’re a couples of different way to install Python, as the update of OP says, and they locate files in different locations. For example, macports puts things into /opt/local/, while homebrew puts things into /usr/local/. Also, Mac OS X brings a few python versions with itself. So, if you … Read more

What is the advantage of setting zip_safe to True when packaging a Python project?

Zip files take up less space on disk, which also means they’re more quickly read from disk. Since most things are I/O bound, the overhead in decompressing the packaging may be less than the overhead in reading a larger file from disk. Moreover, it’s likely that a single, small-ish zip file is stored sequentially on … Read more

Plotting 3D Polygons in python-matplotlib

I think you’ve almost got it. Is this what you want? from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection import matplotlib.pyplot as plt fig = plt.figure() ax = Axes3D(fig, auto_add_to_figure=False) fig.add_axes(ax) x = [0,1,1,0] y = [0,0,1,1] z = [0,1,0,1] verts = [list(zip(x,y,z))] ax.add_collection3d(Poly3DCollection(verts)) plt.show() You might also be interested in art3d.pathpatch_2d_to_3d.

request.user returns a SimpleLazyObject, how do I “wake” it?

See my answer on a similar question. Django lazy loads request.user so that it can be either User or AnonymousUser depending on the authentication state. It only “wakes up” and returns the appropriate class when an attribute is accessed on it. Unfortunately, __class__ doesn’t count because that’s a primitive class attribute. There’s occasions where you … Read more

Association between naming classes and naming their files in python (convention?)

What you have presented is the standard convention. Package and Module Names Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged. Since module names are mapped to file names, and some … Read more