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

How to use pipenv-venv #24

Open
ghost opened this issue Apr 22, 2018 · 5 comments
Open

How to use pipenv-venv #24

ghost opened this issue Apr 22, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Apr 22, 2018

I'm running in a pipenv venv, and I run M-x pipenv-venv, and I get a message that says Finished pipenv --venv, but I don't see the result of pipenv --venv anywhere. What's the right way to use this?

@pwalsh
Copy link
Owner

pwalsh commented Apr 29, 2018

Hi there @apnewberry

The result should be in the *Pipenv* buffer. If you can let me know your workflow I can try to address the "right way" to use this (and add to the docs if something is not clear). Generally, one would employ (pipenv-active) rather than (pipenv-venv).

@pwalsh pwalsh self-assigned this Apr 29, 2018
@pwalsh pwalsh added this to the Current milestone Apr 29, 2018
@ghost
Copy link
Author

ghost commented Apr 30, 2018

Ah, I hadn't noticed the *Pipenv* buffer, I was just looking in the minibuffer.

I'm having trouble getting emacs to respect the pipenv virtualenv unless I activate it in my shell before launching emacs.

M-! which python doesn't seem to be affected by pipenv-activate. So even though the *Pipenv* buffer reports that I have a particular env active, the rest of my emacs session does not seem to have access to it.

Similarly, if I navigate my shell to a python project, run pipenv shell, and emacs, then flycheck-pycheckers detects the packages available in the virtualenv, and I don't get any linting errors.

However, if I open emacs outside of a virtualenv, and open a python file in a pipenv project directory, I get all the pylint: Unable to import errors. Running pipenv-venv and looking in the *Pipenv* buffer shows the name of the correct virtualenv, and activating it manually with pipenv-activate doesn't help.

@ahonnecke
Copy link

I'm having the same trouble as @apnewberry

I think that it might be related to

pypa/pip#5154

/Users/ahonnecke/.pyenv/versions/web-6EpGRwxA
Process Pipenv finished

Process Pipenv exited abnormally with code 1
Checking PEP 508 requirements…Passed!
Checking installed package safety…An error occurred:
Traceback (most recent call last):
  File "/Users/ahonnecke/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/ahonnecke/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/__main__.py", line 8, in <module>
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 722, in __call__
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 697, in main
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 1066, in invoke
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 895, in invoke
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 535, in invoke
  File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/patched/safety.zip/safety/cli.py", line 52, in check
AttributeError: module 'pip' has no attribute 'get_installed_distributions'

Process Pipenv exited abnormally with code 1

@mandarvaze
Copy link

mandarvaze commented Dec 6, 2018

I have similar problem.

M-! which python shows /usr/local/bin/python but in the terminal from where I started emacs shows python from, shows correct path inside pipenv's venv bin folder.

@pwalsh
Copy link
Owner

pwalsh commented Dec 6, 2018

#45

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

3 participants