4
0

More than 3 years have passed since last update.

pipenv shellが使えなくなった...どうする?

Last updated at Posted at 2020-07-08

pipenv shellが効かなくなった.さぁどうしようか.

心の声

いや,こんなこと初めてですよ笑

$ pipenv shell

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2020.6.2/libexec/bin/pipenv", line 5, in <module>
    from pipenv import cli
ModuleNotFoundError: No module named 'pipenv'

へ?細かいエラーはよくわからんのでとりあえず試したやり方がうまくいったので記述していきます.

解決方法

手順その1

とりあえずpipenvがなんでいないの?ってことで

brew list

そしたら自分の環境ではちゃんといるんですよね笑

手順その2

とりあえず入れ直してみるかぁってことで

brew reinstall pipenv

すると

==> Downloading https://homebrew.bintray.com/bottles/pipenv-2020.6.2.catalina.bottle.tar.gz
Already downloaded: /Users/hoge/Library/Caches/Homebrew/downloads/4d0e7223005e0a1d0846471afb6356cb634de5855ad4102613aa6b0cc94c3bbc--pipenv-2020.6.2.catalina.bottle.tar.gz
==> Reinstalling pipenv 
==> Pouring pipenv-2020.6.2.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

普通に再インストール成功...

再度

pipenv shell

すると

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Launching subshell in virtual environment…
 . /Users/hoge/.local/share/virtualenvs/hoge-hogehoge/bin/activate  

普通に動くようになるんかい笑
いったいなんで急に動かなくなったことやら...

おまけ

pipenvを再インストールしたことでjupyter notebookでTerminal上に出ていたWarningも表示されなくなりました.

最後まで見てくださりありがとうございました!!

4
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0