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 7916397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:47:33+00:00 2026-06-03T14:47:33+00:00

>> which python /usr/bin/python >> python –version Python 2.4.x My problem is very simple,

  • 0
>> which python
/usr/bin/python
>> python --version
Python 2.4.x

My problem is very simple, how do I run a python program on a different installation of python (e.g. /usr/bin/python26)?

I want to be able to run Scrapy with a different python installation than the default, but the question is meant for any program written in Python running on a Unix-like system.

EDIT: To clarify, I want to run an installed program which someone else wrote and is usually run like so:

scrapy crawl blaha

NOT like so:

python scrapy crawl blaha
  • 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-06-03T14:47:34+00:00Added an answer on June 3, 2026 at 2:47 pm

    Normally, under Unix systems, you have multiple Python executables, for example, on my system:

    which python
    /usr/bin/python
    which python2
    /usr/bin/python2
    

    The name of the executable gives the version of the application. This is the standard for different versions of Python, as defined in PEP 394. To hint at which version your script should use, the normal thing to do is provide a hashbang. For example, on my system, Python 3.x is the default Python, so if I write a 2.x script, I add:

    #!/usr/bin/env python2
    

    Then, when my script is run (./some_script.py) it will use Python 2.7.3.

    You should avoid using just #!/usr/bin/env python as it will do different things on different systems. If they are following the specifications, #!/usr/bin/env python2 should point to 2.x and #!/usr/bin/env python3 should point to 3.x – under Arch this works correctly (with just python pointing to 3.x (unusually) as well).

    Update for your edit:

    If you want to do that, the easiest route is to make an executable in your system path that simply runs the command python some_script ....

    This is done regularly, for example, eclipse on my system actually runs /usr/bin/eclipse – a bash script that contains:

    #!/bin/bash
    export ECLIPSE_HOME=/usr/share/eclipse
    export GDK_NATIVE_WINDOWS=true
    ${ECLIPSE_HOME}/eclipse "$@"
    

    So for your problem, just make a script somewhere in your path (let’s say /usr/bin/scrapy) which contains:

    #!/bin/bash
    python2 scrapy "$@"
    

    I would note that in future, you should try to give as much information about your problem as possible up front, not changing it after getting answers.

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

Sidebar

Related Questions

I wrote the following script, which generates a SyntaxError : #!/usr/bin/python print Enter the
I have been trying to create a simple program with Python which uses OpenCV
I recently installed ActivePython 2.7. So I've got a symbolic link in /usr/local/bin/python which
I have a simple hello world python script: #!/usr/bin/python print Content-Type: text/html print print
When I type which python, I get the following result: /Library/Frameworks/Python.framework/Versions/Current/bin/python when I type
With this code, urllib2 make a GET request: #!/usr/bin/python import urllib2 req = urllib2.Request('http://www.google.fr')
I need to run Python 2.7 on my Mac Snow Leopard, which has Python
I have 2 Python scripts which are main_menu.py and inputip.py. The problem occurs when
I have the following contents in the file demo.py:- // executable bit set #!/usr/bin/python
I have a login python script in which i want to take the username

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.