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.58k stars 4.9k forks source link

Cannot activate pipenv when the file gets opened via projectile #13101

Open chama-chomo opened 4 years ago

chama-chomo commented 4 years ago

Description :octocat:

When I open a file with dired, using ranger layer or run emacs 'file' directly from the terminal pipenv can be activated normally

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

No virtualenv has been created for this project yet!
pipenv --venv exited abnormally with code 1
pipenv-activate: Wrong type argument: stringp, nil

Expected behaviour: :heart: :smile: pipenv activates virtual env.

System Info :computer:

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
Trapez commented 4 years ago

Set python-pipenv-activate to t.

chama-chomo commented 4 years ago

nope, it doesn't help

     (python :variables
             python-backend 'lsp
             python-lsp-server 'pyls
             ;; python-lsp-server 'mspyls
             ;; python-backend 'anaconda
             python-fill-column 99
             python-enable-yapf-format-on-save nil
             python-sort-imports-on-save nil
             python-pipenv-activate t
Trapez commented 4 years ago

Take a look at your .spacemacs.env file, any references to virtualenvs should be removed and make sure the path looks sane. That has usually been the reason for any strange behavior in the python layer for me.

chama-chomo commented 4 years ago

Unfortunately, I haven't found any references, I'm using pipenv all the time and 3-4 weeks ago it was normally working, I guess something has changed upstream

mpcogito commented 4 years ago

It may be that your module is too deeply nested, which seems to be a problem with pipenv. Try the code in this gist: https://gist.github.com/mpcogito/d6f2a2fb5595bf10e6109143071eee5b

k-jell commented 3 years ago

Is there any way this can be fixed while still using python-pipenv-activate? I'm not sure how to modify the code in the gist to do that.

lebensterben commented 3 years ago

@k-jell do that in shell

k-jell commented 3 years ago

@lebensterben Could you explain a bit further what I should do in shell? Setting the default-directory? Sorry if I'm missing something obvious here.

lebensterben commented 3 years ago

@k-jell

https://pipenv.pypa.io/en/latest/basics/#example-pipenv-workflow

github-actions[bot] commented 1 year 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!

github-actions[bot] commented 2 months 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!