Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-tools was unable to find your machine's python executable. #300

Open
fgthct opened this issue Jun 21, 2022 · 6 comments
Open

python-tools was unable to find your machine's python executable. #300

fgthct opened this issue Jun 21, 2022 · 6 comments

Comments

@fgthct
Copy link

fgthct commented Jun 21, 2022

python-tools was unable to find your machine's python executable.

Please try set the path in package settings and then restart atom.

If the issue persists please post an issue on https://github.com/michaelaquilina/python-tools/issues/new

This is my path with python executable

import sys
print(sys.executable)
/usr/bin/python3

But the error persists.
why?

@jmobley0429
Copy link

I was able to fix this issue by leaving the python-tools custom executable blank and then using

ln -sf /usr/bin/python3 /usr/bin/python

to create a symbolic link with just python pointing to my python3 executable.

In the source code python-tools.coffee, line 90:

this.provider = require('child_process').spawn(
      'python', [__dirname + '/tools.py'], env: env
    )

The child_process.spawn is given just "python" as the executable name, so if you have a python3 in your env it will not work.

@kent-rasmussen
Copy link

Hmm..… if this is the correct answer, the settings info should be changed. It currently implies that e.g., python2.7 would be a reasonable entry to the path to python entry. Or is that supposed to just be the directory of the executable? Ubuntu still uses python3 as an executable name, so this should be resolved systematically.

@kent-rasmussen
Copy link

Neither /usr/bin/python3 (the result of which python3) nor /usr/bin/ (just the directory) in the python-tools settings "path to python directory" resolves this error. Since one of these should be the correct answer (on my machine) to the error message ("Please try set the path in package settings and then restart atom."), either the use of that field, or the error message telling us to use it, should be changed.

@kent-rasmussen
Copy link

perhaps the best answer for ubuntu users is sudo apt-get install python-is-python3, which does the symlink suggested by jmobley0429 above, but in a way that ubuntu would expect (as it will ultimately impact other system changes).

@9994444ggg
Copy link

9994444ggg commented Nov 3, 2022 via email

@9994444ggg
Copy link

9994444ggg commented Nov 3, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants