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

pyvenv workon ignoring conda env paths #79

Open
frodera opened this issue Aug 5, 2018 · 3 comments
Open

pyvenv workon ignoring conda env paths #79

frodera opened this issue Aug 5, 2018 · 3 comments

Comments

@frodera
Copy link

frodera commented Aug 5, 2018

Env:

Spacemacs ignores the Python version set via pyvenv (SPC-m-V-w, pyvenv-workon) and just uses system's default.

In my case my venv is a Conda environment:

> /Users/frodera/miniconda3/envs/python37/bin/python --version                                                                                                         
Python 3.7.0

After setting the env via SPC-m-V-w, emacs reports that the path of that env is the first one listed in Spacemacs' PATH and it even reports the name of the apparently loaded env (python37) in the status bar. However, when running a python script via SPC-m-c-c it reverts to system's default (2.7.15). See image attached.

getenv "PATH" -> /Users/frodera/miniconda3/envs/python37/bin:/usr/local/opt/coreutils/...

In order to get access the conda environments I have added this to my .spacemacs:

(defun dotspacemacs/user-config ()
  (use-package pyvenv
    :ensure t
    :init
    (setenv "WORKON_HOME" "/Users/frodera/miniconda3/envs")
    (pyvenv-mode 1))
  )

screen shot 2018-08-05 at 11 05 18

@frodera
Copy link
Author

frodera commented Aug 5, 2018

Not sure if related but I have noticed this error message in the messages buffer, when invoking python execution of the test.py file:

evil-line-move: End of buffer [9 times]
save-current-buffer: Symbol’s value as variable is void: python-shell--interpreter
Inferior Python finished
compilation ok.

python-shell--interpreter? Seems like that variable has an extra dash in it, and I cannot find it set anywhere in my Spacemacs installation, only references to similar variables are to python-shell-interpreter

@frodera
Copy link
Author

frodera commented Aug 5, 2018

Interestingly, if I do a python-shell-send-buffer it does open an ipython shell in the conda env running python 3.7.0, as expected:

In [6]: * Python version:		3.7.0 (default, Jun 29 2018, 20:13:13) 
[Clang 9.1.0 (clang-902.0.39.2)]
* Executable:		/Users/frodera/miniconda3/envs/python37/bin/python

Also, this does not trigger any Symbol’s value as variable is void: python-shell--interpreter messages.

@yssource
Copy link

yssource commented Jun 2, 2019

The same problem happens to me also.
SPC-m-c-c always calls the python by pyenv global version, instead of the pyvenv-activate version.
This only happens to SPC-m-c-c.
But I think may be it is caused by spacemacs, instead of pyvenv.

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

2 participants