syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Spacemacs on a system with pyenv can't use system Python #10934

Closed aeberspaecher closed 4 years ago

aeberspaecher commented 6 years ago

Description :octocat:

nil considered a valid Python interpreter.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

On a system with pyenv and pyenv-which-ext that uses system Python, spacemacs/pyenv-executable-find returns nil instead of a path to the system Python executable. SPC m c c on a Python file calls nil as the Python interpreter.

Expected behaviour: :heart: :smile:

Script executes using system Python/IPython.

System Info :computer:

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
sebhahn commented 6 years ago

Is related to #10898?

aeberspaecher commented 6 years ago

@sebhahn, I don't think so as I can select virtual environments.

The problem still persists in recent master (e33638d9). I am certain the problem is in spacemacs/pyenv-executable-find because my problem is fixed if I comment out all the logic besides the closing (executable-find command).

Can anyone take me through the function's intentions? Perhaps @cpaulik who wrote the code? What is considered the correct executable path to return in case pyenv uses system Python?

cpaulik commented 6 years ago

The original intention was to not fall back to the system executable automatically. See https://github.com/syl20bnr/spacemacs/pull/9348

If a user has selected the system interpreter in ´pyenv´ then the function should return the system version of the executable.

cpaulik commented 6 years ago

Looking at the function again it does at the moment indeed return ´nil´ if the executable is not in the same path as the activated pyenv environment. So we might need a special case in the function for treating the ´system´ environment.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!