Search code examples
pythonpython-3.xpython-config

python: how to change python-config into my current python version


My question is that,

if I run

which python 

it returns

/opt/anaconda3/bin/python

However, If I run

which python-config

It returns

/usr/bin/python-config

which is the built-in python 2.7 in macbook.

How can I change the config into the current python that I'm using?


Solution

  • Check if there is a python-config or python3-config in /opt/anaconda3/bin. If there is a file named python3-config, you should run python3-config instead. If there is no python3-config, likely you don't have python-config installed for your conda environment. You can run pip install python-config (make sure you run pip under your anaconda environment).