Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install plpython on mac with python 2.7

I need to install plpython because I'm getting the error

could not access file "$libdir/plpython2": No such file or directory

when trying to do python manage.py migrate. I have seen different suggestions on how to install this package but none works for me because I need to be using python version 2.7 (some people suggested installing python 3.2) and I cannot run sudo apt-get install ... because I have to be working on a mac.

I have tried running

CREATE LANGUAGE plpython2u;

but I got the error

ERROR:  could not access file "$libdir/plpython2": No such file or directory

Also, I have tried pip/brew install plpython. But no result. Any suggestions?

like image 285
Nicky Mirfallah Avatar asked Jun 27 '16 20:06

Nicky Mirfallah


People also ask

Can I install Python 2 and 3 Mac?

Use brew install python to install python3 on the mac, current version is Python 3.6. 5 . If your mac has a python2 already, brew will ask for an upgrade, which is fine.

Where is Python 2 on Mac?

The Apple-provided build of Python is installed in /System/Library/Frameworks/Python. framework and /usr/bin/python , respectively.

What is plpython3u?

If a language is installed into template1 , all subsequently created databases will have the language installed automatically. PL/Python is only available as an “untrusted” language, meaning it does not offer any way of restricting what users can do in it and is therefore named plpython3u .


1 Answers

If anybody has the same problem, I fixed this by uninstalling postgres and installing it using brew install postgres --with-python

like image 193
Nicky Mirfallah Avatar answered Sep 20 '22 19:09

Nicky Mirfallah