pipenv - 'pew'不被识别为内部或外部命令,可操作程序或批处理文件

时间:2018-02-22 15:07:12

标签: python pipenv

为什么我无法输入pipenv shell

PS C:\Users\...\desktop\projects\myproject> pip freeze
backports.shutil-get-terminal-size==1.0.0
certifi==2018.1.18
chardet==3.0.4
configparser==3.5.0
Django==1.11
django-debug-toolbar==1.9.1
django-extensions==1.9.9
django-extra-views==0.9.0
djangorestframework==3.7.7
djaodjin-survey==0.1.7
enum34==1.1.6
flake8==3.5.0
idna==2.6
jsonfield==2.0.2
mccabe==0.6.1
pathlib==1.0.1
pew==1.1.2 <---------------------------------- it's right bloody here
pipenv==9.0.3
psutil==5.3.1
psycopg2==2.7.3.2
pycodestyle==2.3.1
pyflakes==1.6.0
pytz==2017.3
rebar==0.1
requests==2.18.4
shutilwhich==1.1.0
six==1.11.0
sqlparse==0.2.4
typing==3.6.2
urllib3==1.22
virtualenv==15.1.0
virtualenv-clone==0.2.6

所以pew肯定已安装。

PS C:\Users\...\desktop\projects\myproject> pipenv shell
Creating a virtualenv for this project…
New python executable in C:\Users\...\.virtualenvs\myproject-bRnmVZJC\Scripts\python.exe
Installing setuptools, pip, wheel...done.

Virtualenv location:
'pew' is not recognized as an internal or external command,
operable program or batch file.

但不知何故,当我输入pipenv shell时(以便我可以安装未使用pipenv安装的软件包)

1 个答案:

答案 0 :(得分:0)

问题是我使用Python 2.7安装了pipenv

要修复,我installed both Python 2.7 and 3.4并为两者设置路径,以便python2运行2.7,python3运行3.4。

然后我使用python3安装了pipenv,并在python 2.7中启动了pipenv

python3 -m pip install --user pipenv
cd C:\Users\...\desktop\projects\myproject>

然后我set my user base's binary directory to my PATH并添加了

C:\Users\Username\AppData\Roaming\Python36\Scripts

到我的PATH,然后

pipenv --two install
pipenv shell

和voilà!

Launching subshell in virtual environment. Type 'exit' to return.
Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.