PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 2, 2022

[FIXED] Need MAMP to use (an older version of) Python

 January 02, 2022     macos, mamp, python     No comments   

Issue

One of my sites requires python and cherrypy. Locally, I need to get all of this running with MAMP. I have the site running in MAMP with the exception of features reliant on Python. I need to run python 2.5. My OS version is 2.7.

How do I set this up? I seem to have 2.5 installed in addition to 2.7 and 2.6

which python
/usr/bin/python

which python2.5
/usr/bin/python2.5

but the usr/bin/python2.5 is an alias to: System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5

How do I make python2.5 available to MAMP without screwing up the vers OSX needs?

It's a drupal site, MAMP is handling everything php related, and perhaps I wrongfully assumed it needed to have anything to do with the python scripts of the site. As I read more about cherrypy, it seems cherrypy serves the python scripts, and I do have cherrypy running (localhost:8080 test works anyway), so perhaps all I need to do is make sure python2.5 is being used instead of the default? (2.7)


Solution

You've got the right idea. You definitely want to leave the OS python version alone. Or you could be breaking multiple dependencies. We launch our cherrypy instances in our rc.local script at boot. This is where you specify which version of python to use when executing your cherrypy app.

Our rc.local script looks like this:

/opt/Python-3.2/python /var/www/html/appname/webapp.py > stdout.log &


Answered By - Andrew Kloos
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing