2

I'm trying to install the Chilkat library for Python in order to use its encryption functionality, but being new to Python in every possible way, I'm getting stuck entirely too early. I've installed the library as instructed by the docs and verified that the files are in the "right place" (/usr/local/lib/python2.7/site-packages/) on my Ubuntu 12.04 server.

I've also downloaded the test script. When I try to run it, however:

ImportError: No module named chilkat

I know this is stupid basic, but here I am. In the docs they do mention a possible issue with sys.prefix. That (presumably default, since I've never touched it) value on my machine is /usr. I moved everything there, but still get the same error.

Help? Where is the most "pythonic" place to put these files and how can I get Python to recognize them universally?

Thanks.

Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
  • 2
    Sounds like a PATH problem. Do you have a PYTHON_PATH variable defined in your profile? – BenDundee Feb 04 '13 at 19:39
  • 1
    What is the value of `sys.path`? – Simeon Visser Feb 04 '13 at 19:39
  • No `PYTHON_PATH` in my profile (it's a Vagrant VM), @BenDundee. And, @Simeon Visser, my `sys.path` is `['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/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']`. This looks like the problem, assuming `sys.path` is similar to the Java classpath. Should I move to `dist-packages` instead of `site-packages`? Is that pretty common? – Rob Wilkerson Feb 04 '13 at 19:42

1 Answers1

2

For anyone searching, I just ended up adding site-packages to my sys.path by adding a .pth file to dist-packages which was already in my path.

echo "/usr/local/lib/python2.7/site-packages" > /usr/local/lib/python2.7/dist-packages/site-packages.pth
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192