首页 > 解决方案 > python3 的 pipenv,只是创建 python3 shell,即使参数 --two 被传递。.我们需要为两个python安装pipenv吗?

问题描述

campaign_response sidvis$ pipenv --two shell
:
✔ Successfully created virtual environment! 
:
(campaign_response) bash-3.2$

现在 pipenv campaign_response 已经设置好了!但由于 python3.6 依赖关系,它失败了。

(campaign_response) bash-3.2$ pipenv install x
Installing x…
Adding silverpop to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed! 
.
..
...
    from typing import TYPE_CHECKING
  File "/anaconda3/lib/python3.6/site-packages/typing.py", line 133
    def __new__(cls, name, bases, namespace, *, _root=False):

而python3作为默认python出现:

(campaign_response) bash-3.2$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 

标签: pythonpipenv

解决方案


它发生的原因是因为 pipenv 正在选择 python3 pipenv.oops!您需要在 python2 pipenv 中使用 lib,方法是将其传递为:python2 -m pipenv install x


推荐阅读