-1

Running a script on Putty, under directory user/Projects/Python/example.py.

Under the Python directory, there is a subfolder called crypto, and under that, a library called cryptolib.so.

If I run example.py from the Python folder, it works perfectly. But if I run it from my user folder, it says:

OSError: ./crypto/cryptolib.so: cannot open shared object file: No such file or directory.

This is a C++ library I'm calling, using Python

How do I change the library path?

RAgarwal
  • 21
  • 3

1 Answers1

0

It seems you want to import a module from another directory. This question already has an answer. An alternative solution is to copy and paste your file from one directory into another directory (this is terribly lazy and inefficient time-wise and storage-wise, but if you don't care about efficiency or writing Pythonic code, this may suit you).

Joel
  • 1,564
  • 7
  • 12
  • 20
  • I'm not trying to import another file, there is a library for which the path isn't specified. I want to change that. All other commands I've seen online regarding LD_LIBRARY_PATH haven't worked – RAgarwal Jul 04 '18 at 14:32