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

setting python venv does not automatically specify virtualenv shell path #2841

Closed
ipsod opened this issue Aug 31, 2015 · 9 comments
Closed
Labels

Comments

@ipsod
Copy link

ipsod commented Aug 31, 2015

I was unable to get spacemacs to use a python virtual environment, but found some help in the chat.

In order to get spacemacs to use a python virtual environment, it's required to run:
(setq python-shell-virtualenv-path "~/path/to/env/")

This should be noted in the documentation until pyvenv-workon sets the path automatically (as it ought to).

@CestDiego
Copy link
Contributor

Also why are we having pyvenv and pyenv if pyvenv works most of the time?

@TheBB
Copy link
Collaborator

TheBB commented Sep 1, 2015

Yeah, that is confusing.

@cpaulik
Copy link
Contributor

cpaulik commented Sep 1, 2015

pyvenv-workon does set the path correctly. At least for me. You need to have set the $WORKON_HOME environment variable however. pyvenv-activate on the other hand queries for a folder that is not dependent on this environment variable.

´pyenv` is also very handy. I would not remove one but maybe we can set one as default and let users choose the other one if they want to like with the python test runner.

@CestDiego
Copy link
Contributor

what does pyenv has that pyvenv doesn't?

On Tue, Sep 1, 2015 at 2:25 AM, Christoph Paulik notifications@github.com
wrote:

pyvenv-workon does set the path correctly. At least for me. You need to
have set the $WORKON_HOME environment variable however. pyvenv-activate
on the other hand queries for a folder that is not dependent on this
environment variable.

´pyenv` is also very handy. I would not remove one but maybe we can set
one as default and let users choose the other one if they want to like with
the python test runner.


Reply to this email directly or view it on GitHub
#2841 (comment)
.

@cpaulik
Copy link
Contributor

cpaulik commented Sep 1, 2015

pyenv can switch python versions without need for a virtualenv. It can also automatically switch python versions when you enter a folder.

See https://www.brianthicks.com/2015/04/10/pyenv-your-python-environment-automated/ for a practical example.

@autosquid
Copy link
Contributor

pyenv can switch python versions without need for a virtualenv.

AFAIK, pyenv and virtualenv serves different purpose, and I need virutalenv for environment isolation.

As @ipsod , the way to use only virtualenv should really be noted in the documentation.

I think pyenv should only be made an option in this layer for those like me who dislike pyenv every much due to mess in tackling system-side-package well.

There are too many packages for python in emacs, and too many are doing it wrong. A clean and right solution needs real experts.

Why is this issue closed? @TheBB I do not think it is solved yet.

@TheBB
Copy link
Collaborator

TheBB commented Jan 6, 2016

The reporter said

This should be noted in the documentation until pyvenv-workon sets the path automatically (as it ought to).

Pyvenv does this, and apparently already did at the time of reporting.

@autosquid
Copy link
Contributor

@TheBB but pyvenv-workon is not in doc. neither. so, there is actually nothing in the doc. on how to setup virtualenv except the two links of pyenv and pyvenv.

@TheBB
Copy link
Collaborator

TheBB commented Jan 6, 2016

Well... open a new issue then. I don't want to reopen old issues just because something else vaguely related to the original problem is still unsolved.

cpaulik added a commit to cpaulik/spacemacs that referenced this issue Jan 6, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
cpaulik added a commit to cpaulik/spacemacs that referenced this issue Jan 7, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
cpaulik added a commit to cpaulik/spacemacs that referenced this issue Jan 7, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
cpaulik added a commit to cpaulik/spacemacs that referenced this issue Jan 7, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
cpaulik added a commit to cpaulik/spacemacs that referenced this issue Jan 7, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
TheBB pushed a commit that referenced this issue Jan 8, 2016
Inspired by the discussion in
#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
d1egoaz pushed a commit to d1egoaz/spacemacs that referenced this issue Feb 6, 2016
Inspired by the discussion in
syl20bnr#2841 I thought it was
useful to improve the Documentation and provide keybindings for all the
useful `pyvenv` functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants