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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:48:13+00:00 2026-05-22T23:48:13+00:00

What does it take to replace regular /usr/bin/python with a custom python shell in

  • 0

What does it take to replace regular /usr/bin/python with a custom python shell in Emacs’ python-mode?

Basically I have a binary /usr/bin/mypython which does some initializations before starting python interpreter prompt, and for all interaction purposes, the resulting interpreter shell is equivalent to /usr/bin/python.

However, if I specify this binary in “python-python-command” (using python.el in Emacs 23.3), I get “Only Python versions >=2.2 and < 3.0 are supported”

  • 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-22T23:48:14+00:00Added an answer on May 22, 2026 at 11:48 pm

    I’m about to read the elisp to check, but I’d bet if you added a --version flag that gave the save results as /usr/bin/python, emacs would be happy.

    Update

    Here’s the code in python.el line 1555 et seq in EMACS 23.3.1:

    (defvar python-version-checked nil)
    (defun python-check-version (cmd)
      "Check that CMD runs a suitable version of Python."
      ;; Fixme:  Check on Jython.
      (unless (or python-version-checked
              (equal 0 (string-match (regexp-quote python-python-command)
                         cmd)))
        (unless (shell-command-to-string cmd)
          (error "Can't run Python command `%s'" cmd))
        (let* ((res (shell-command-to-string
                     (concat cmd
                             " -c \"from sys import version_info;\
    print version_info >= (2, 2) and version_info < (3, 0)\""))))
          (unless (string-match "True" res)
        (error "Only Python versions >= 2.2 and < 3.0 are supported")))
        (setq python-version-checked t)))
    

    What it’s doing is running a one-liner

    from sys import version_info;
    print version_info >= (2, 2) and version_info < (3, 0)
    

    that just prints “True” or “False”. Fix your script to handle the -c flag and you should be fine.

    Alternatively, you could take the hacker’s way out and force the value of python-version-checked to t, and it’ll never do the check.

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

Sidebar

Related Questions

What does it take to get C++ tr1 members (shared_ptr especially, but we'd like
What does it take for online documentation to be helpful and interesting to read?
Why does it take forever for ASP.NET to process a request the first time
How long does it take for an experienced Windows programmer to learn writing simple
It is my understanding that page level caching does not take into account that,
I need to use a function on a vector that does not take a
On average, how long does it take for Debian to package new versions of
I know dbsight allows synonyms and stop words for searching but does this take
When a compiler finds a signed / unsigned mismatch, what action does it take?
In Oracle (10g), when I use a View (not Materialized View), does Oracle take

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.