0

I'm trying to install my own version of Python that is independent of the system one on my Mac. Basically, I'm following this Machine Learning Tutorial. I'm in step 4.4 where I'm trying to run the command "python create_lmdb.py" in the command-line, but I get an error saying opencv module not found.

So, then I found the latest openCV Tutorial for Sierra to install openCV properly. I am in step 2 and 3 where I've tried to edit the /.bash_profile with "export PATH=/usr/local/bin:$PATH". I've saved and opened the file to confirm that the file changed. I continued with the tutorial, but when I get to "which python" I find that Python is still the system version with the file path of /usr/bin/python rather than /usr/local/bin/python.

I've spent 3 days on this problem. I've searched around on here and tried various solutions. I've contacted Apple, but they of course couldn't help...or wouldn't. Googled like crazy. I've tried installing a different distribution of Python. I've tried uninstalling and reinstalling Python.

Thanks in advance for any help.

2 Answers2

0

In essence, this is something that you don't want to change. For various reasons changing what your system believes to be "python" is not ideal. A more detailed anser can be found here, but for those that don't want to click through all you need to do is create a bash alias to the path you desire.

i.e. alias py=/usr/bin/python3 or whatever the actual path is.

0

I would recommend reading through this exhaustive guide for setting up Python (and optionally, virtual environments like other commenters have recommended) on OS X.

Ben Quigley
  • 727
  • 4
  • 18