Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:29:23+00:00 2026-05-26T10:29:23+00:00

My CentOS 5.5 server has both Python 2.4 and Python 2.7 installed (to /opt/python2.7.2

  • 0

My CentOS 5.5 server has both Python 2.4 and Python 2.7 installed (to /opt/python2.7.2). In my ~/.bash_profile I have two aliases pointing to my Python 2.7 install and my PATH configured as:

alias python=/opt/python2.7.2/bin/python
alias python2.7=/opt/python2.7.2/bin/python
PATH=$PATH:/opt/python2.7/bin

There’s also a symbolic link I created as well:

ln -sf /opt/python2.7.2/bin/python /usr/bin/python2.7

I have a Makefile which has the following lines:

pythonbuild:
        python setup.py build

To my surprise I found that Python 2.4 is being invoked and not Python 2.7.

I have to explicitly specify python2.7:

pythonbuild:
        python2.7 setup.py build

Are bash aliases ignored by make? I am guessing make uses PATH to locate the first python executable (which happens to be Python 2.4) instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:29:23+00:00Added an answer on May 26, 2026 at 10:29 am

    From bash(1):

       Aliases are not expanded when the shell is not interactive,
       unless the expand_aliases shell option is set using shopt
       (see the description of shopt under SHELL BUILTIN COMMANDS
       below).
    

    While you might be able to use something like SHELL=/bin/bash -O expand_aliases in your Makefile, I think keeping an explicit dependency upon the newer Python in your Makefile is much better than keeping the dependency hidden in your user ~/.bash_profile file.

    Instead, put PYTHON=/opt/python2.7/bin/python into your Makefile, and then you can just use:

    pythonbuild:
        $(PYTHON) setup.py build
    

    in your rules.

    The best part is you can easily change which Python interpreter you use on the command line:

    make PYTHON=/tmp/python-beta/bin/python pythonbuild
    

    If you deploy it to another site, it is just one line in the Makefile that needs to be updated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ImageMagick installed on my CentOS linux server. I am trying to get
I have two servers, both running CentOS 5.7 and cPanel-CURRENT. One is x86 and
On my Centos server Python's mimetypes.guess_type(mobile.3gp) returns (None, None), instead of ('video/3gpp', None). Where
I have just installed CentOS, Apache and PHP. When I visit my site http://example.com/myapp/
I have a web site hosted in a CentOS 5-Plesk-Apache server. I have recently
I have been going nuts with this.. I have gnupg installed on my CentOS
I wrote a python script to monitor a log file on a CentOS server
I has installed my tomcat version 6 on centos 5.5 using jsvc as the
I have an svn repository on my dedicated server (Centos 5.5) at /var/svn/myRepository. I
I am using Tortoise1.6, SubversionEdge for SVN CMS and FileZilla3 (Test Server has CentOS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.