2

I created my own python module and packaged it with distutils. Now I installed it on a new system (python setup.py install) and I'm trying to call it from a plpython3u function, but I get an error saying the module does not exist.

It was working on a previous Ubuntu instalation, and I'm not sure what I did wrong when setting up my new system.

I'm trying this on a Ubuntu 15.10 pc with postgresql 9.5, everything freshly installed. I'm also trying this setup in a docker image built with the same componentes (ubuntu 15.10 and pg 9.5). I get the same error in both setups.

Could you please hint me about why this is failing? I wrote down my installation instructions for both systems (native and docker), so I can provide them if that helps.

Thanks

4
  • Did you install the module system wide using sudo? Or are you using virtual env? Commented Feb 4, 2016 at 15:12
  • Hi Noorul, yes I did use sudo. I tried without using sudo and got a permission error. Commented Feb 4, 2016 at 15:22
  • I executed echo $PYTHONPATH in a terminal and it's empty, nevertheless I tried importing the same module from an interactive python sesion and it works fine. It seems like it's a problem with my postgres/plpython setup. Any ideas? Thanks Commented Feb 4, 2016 at 15:30
  • Are you sure that you are using the same python interpreter? How are you running the script? If it is executable, see the shebang. Commented Feb 4, 2016 at 15:50

1 Answer 1

1

Sorry guys I think I found the problem. I'm using plpython3 in my stored procedure, but intalled my custom module using python 2. I just did sudo python3 setup.py install and now it's working on the native Ubuntu. I'll now try modifying my docker image and see if it works there too. Thanks

Sign up to request clarification or add additional context in comments.

2 Comments

You should mark this answer as correct so that it won't come up in search results as having no answer.
I'll do that as soon as SO allows me to (it says I have to wait 2 days before accepting my own answer).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.