Skip to main content

Two results for which -a pg_config, trying to install psycopg2 on Mac

I am trying to install pyscopg2 (using pip) on Sierra.

Seems to be a common problem, so I've checked out a handful of other SO answers. I tried the solution from here.

But I still can't install. My error is

Could not find a version that satisfies the requirement pyscopg2 (from versions: )
No matching distribution found for pyscopg2

When I run which -a pg_config, I get TWO lines:

/Applications/Postgres.app/Contents/Versions/9.5/bin//pg_config
/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config

Which feels wrong.

1\ Is the double pg_config the source of my problem?

2\ If so, how do I correct?

Comments

Popular posts from this blog

Mapping column names to random forest feature importances

I am trying to plot feature importances for a random forest model and map each feature importance back to the original coefficient. I've managed to create a plot that shows the importances and uses the original variable names as labels but right now it's ordering the variable names in the order they were in the dataset (and not by order of importance). How do I order them in order of feature importance? Thanks! My code is: importances = brf.feature_importances_ std = np.std([tree.feature_importances_ for tree in brf.estimators_], axis=0) indices = np.argsort(importances)[::-1] # Print the feature ranking print("Feature ranking:") for f in range(x_dummies.shape[1]): print("%d. feature %d (%f)" % (f + 1, indices[f], importances[indices[f]])) # Plot the feature importances of the forest plt.figure(figsize=(8,8)) plt.title("Feature importances") plt.bar(range(x_train.shape[1]), importances[indices], color="r", yerr=...

OSError: [WinError 6] The handle is invalid, running subprocess.Popen on Python 3.6

I have the following code, I am trying to run XFoil (an airfoil analysis code, but that isn't important) from Python. import subprocess as sp ps = sp.Popen(r'C:\Users\me\XFoil\xfoil.exe',stdin=sp.PIPE,stderr=sp.PIPE,stdout=sp.PIPE) When I run, I get the following error: OSError: [WinError 6] The handle is invalid With the full list of errors as follows: File "~/XFoil_Own.py", line 12, in ps = sp.Popen(r'C:\Users\,e\XFoil\xfoil.exe' ,stdin=sp.PIPE,stderr=sp.PIPE,stdout=sp.PIPE) File "~\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 210, in __init__ super(SubprocessPopen, self).__init__(*args, **kwargs) File "~\Anaconda3\lib\subprocess.py", line 596, in __init__ _cleanup() File "~\Anaconda3\lib\subprocess.py", line 205, in _cleanup res = inst._internal_poll(_deadstate=sys.maxsize) File "~\Anaconda3\lib\subprocess.py", line 1035, in _internal_poll if _WaitForSingleObject(self._ha...

SQLCODE Error -122

I'm not used to SQL a lot, so maybe my question is so dumb, don't be hard with me guys ;) So, this is my table PEOPLE, and what i want is with a query is find the people that are not in an expecific age, but im getting an error. PEOPLE +-------+------+---------+ | NUMPOL| MCT | PRODNUM| +-------+------+---------+ | 98552 | 1054 | 9704 | +-------+------+---------+ | 89854 | 0985 | 5014 | +-------+------+---------+ | 78542 | 1054 | 9704 | +-------+------+---------+ | 98552 | 0965 | 9704 | +-------+------+---------+ | 98552 | 4222 | 9704 | +-------+------+---------+ I'm trying to run this query SELECT NUMPOL, MCT, PRODCO FROM PEOPLE WHERE MCT NOT IN (1054,0965) AND PRODNUM='9704' GROUP BY NUMPOL And this is the error that I'm getting, I tried to solve it googling but never could find an answer because I can't find why it told me that the select list is not valid: SQLCODE = -122, ERROR: COLUMN OR...