I was following the same instructions and encountered the same problem.
Moving or removing the /usr/local/lib/python2.7/dist-packages/twisted
directory also resolved the issue for me.
You can use for example the following command to change the name of the problematic directory:
mv /usr/local/lib/python2.7/dist-packages/twisted /usr/local/lib/python2.7/dist-packages/twisted2
Then use sudo service carbon-cache start
again
Background
I had the same issue on my Ubuntu 14.04 machine. Some investigation indicates that there are two virtually identical areas for twisted plugins on my machine.
/usr/local/lib/python2.7/dist-packages/twisted
and
/usr/lib/python2.7/dist-packages/twisted
I am not sure where these two areas originate from. Perhaps one comes with the distro and the other is created through a manual pip install twisted
that I may have done at one time. I suspect that the /usr/local/lib/python2.7/dist-packages/
area gets populated with content when I install packages using pip
. So this problem my eventually be attributed to users (e.g. me) installing twisted
via pip
and via the apt
package system.
In any case, a diff through these areas showed that the carbon related files were installed into the /usr/lib/python2.7/dist-packages/
area. dpkg -L graphite-carbon
also indicates that the package files go into the /usr/lib/python2.7/dist-packages/
area.
However, when the carbon start script is run is appears that /usr/local/lib/python2.7/dist-packages/twisted/plugins
area is used leading to the plugin not being found.
I assume that this issue is related to the modules search path. As can be seen below the /usr/local/lib/python2.7/dist-packages/
comes before the /usr/lib/python2.7/dist-packages/
in my default path.
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
>>>