Help us understand the problem. What is going on with this article?

2019年2月頭に Pipenv で新規環境作ろうとしたら出来なかった件の対応

More than 1 year has passed since last update.

タイトルの通り。先週頭は問題無かった気がするのだが、今日(2019年2月4日)になって新規でPipenvで環境作ろうとしたら以下のエラー

$ pipenv install --python 3.5 argparse tabulate
Creating a virtualenv for this project...
Pipfile: /Users/user/project/Pipfile
Using /Users/user/.anyenv/envs/pyenv/versions/3.5.6/bin/python3.5m (3.5.6) to create virtualenv...
〜中略〜
Locking [packages] dependencies...
lib/python3.7/site-packages/pipenv/utils.py", line 402, in resolve_deps
    req_dir=req_dir
  File "/usr/local/Cellar/pipenv/2018.7.1/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 250, in actually_resolve_deps
    req = Requirement.from_line(dep)
  File "/usr/local/Cellar/pipenv/2018.7.1/libexec/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 704, in from_line
    line, extras = _strip_extras(line)
TypeError: 'module' object is not callable

これは、俗に言う pipenv と pip のバージョンが合ってない問題だなーと思い、いつも通りこれ で見た pipenv run python -m pip install -U pip==18.0 を実行したがNG

確認すると下記の通り。

$ pip --version
pip 18.0 from /Users/user/.anyenv/envs/pyenv/versions/3.6.6/lib/python3.6/site-packages/pip (python 3.6)

$ pipenv run pip --version
pip 19.0.1 from /Users/usre/project/.venv/lib/python3.5/site-packages/pip (python 3.5)

多分バージョンだろうなーと思い、以下のようにしてvenv上のpipを一旦削除してから18.0を再インストールした。

$ pipenv run python -m pip uninstall pip
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ pipenv run python get-pip.py pip==18.0

これでちゃんと18.0になり、インストールもできた。

$ pipenv run pip --version
pip 18.0 from /Users/user/project/.venv/lib/python3.5/site-packages/pip (python 3.5)

対処療法ではあるんですが、備忘録。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした