# usepgfplotslibrary - undefined control sequence

I have problem with following example code:

%& --shell-escape --enable-write-18
\documentclass[a4paper,10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{polski}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{units}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
use units,
x unit=m,x unit prefix=k,
y unit=N,y unit prefix=m,
xlabel=Distance,ylabel=Force]

(1,2.3)
(2,2.7)
(3,2.1)
(4,1.8)
(5,1.5)
(6,1.1)
};
\end{axis}
\end{tikzpicture}
\end{document}

A cannot use units in axis labels. A similar code was included in this documentation: http://www.iro.umontreal.ca/~simardr/pgfplots.pdf on page 227.

Errors:

Missing \begin{document}. \usepgfplotslibrary{u (followed by: nits})
Package pgfkeys Error: I do not know the key '/pgfplots/use units' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys Error: I do not know the key '/pgfplots/x unit' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys Error: I do not know the key '/pgfplots/x unit prefix' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys Error: I do not know the key '/pgfplots/y unit' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys Error: I do not know the key '/pgfplots/y unit prefix' and I am going to ignore it. Perhaps you misspelled it.
Undefined control sequence:  \usepgfplotslibrary (followed by: {units})

What's more, the command \usepgfplotslibrary completely does not work with any other pgfplots library. I don't know what is wrong, but i have to get this working :/ Thank you in advance for your help.

I'm running Debian Sid. Texlive (2009-11), pgf (2.10-1)

-

When I try your code with the Debian/Ubuntu packages, I get

! Undefined control sequence.
Did you set $PATH correctly? (I don't know where to set it in Debian. It is in /etc/environment in Ubuntu) – Caramdir May 4 '11 at 20:01 @Naer: Or you can symlink the binaries form .../texlive/2010/bin/.../ to e.g. /usr/bin – Caramdir May 4 '11 at 20:36 You were right, I forgot to set$PATH. Now everything works fine. Thank you very much for your help :) –  Naer May 4 '11 at 21:26