首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装python和Pipenv后无法识别pipenv外壳

安装python和Pipenv后无法识别pipenv外壳
EN

Stack Overflow用户
提问于 2020-10-05 12:48:05
回答 2查看 4.9K关注 0票数 0

问题简介语言版本:Python3.8操作系统: Windows 10任何其他相关软件:朱庇特笔记本和html-请求

上下文:

我正在尝试安装pipenv并与本教程介绍使用pipenv一起执行。在添加了"-m“之后,我才能够成功地安装请求(如下面的第二段代码所示)。我甚至不知道"-m“是什么意思,也不知道我是怎么做到的。我的目标和预期的结果是打开一个琵琶壳。

实际结果:

之后,当我试图打开pipenv shell时,我收到了这个错误:

代码语言:javascript
复制
PS C:\Users\Cullen Harris\desktop\cfeproj> pipenv shell
pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pipenv shell
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (pipenv:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我尝试过的事情:我在错误之前插入的代码:

代码语言:javascript
复制
PS C:\Users\Cullen Harris\desktop\cfeproj> pipenv install requests
pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pipenv install requests
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (pipenv:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Cullen Harris\desktop\cfeproj> python -m pipenv install requests
Creating a virtualenv for this project…
Pipfile: C:\Users\Cullen Harris\desktop\cfeproj\Pipfile
Using C:/Users/Cullen Harris/AppData/Local/Programs/Python/Python38-32/python.exe (3.8.6) to create virtualenv…
[=   ] Creating virtual environment...created virtual environment CPython3.8.6.final.0-32 in 2512ms
  creator CPython3Windows(dest=C:\Users\Cullen Harris\.virtualenvs\cfeproj-xPOGFEhb, clear=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Cullen Harris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv)
    added seed packages: pip==20.2.3, setuptools==50.3.0, wheel==0.35.1
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Successfully created virtual environment!
Virtualenv location: C:\Users\Cullen Harris\.virtualenvs\cfeproj-xPOGFEhb
Creating a Pipfile for this project…
Installing requests…
Adding requests to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
           Building requirements...
Resolving dependencies...
Success!
Updated Pipfile.lock (fbd99e)!
Installing dependencies from Pipfile.lock (fbd99e)…
  ================================ 0/0 - 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-10-23 18:12:25

我不知道为什么我会有这个问题。然而,一种解决方案是使用吡咯烷酮而不是终端。我不知道它为什么会起作用,但它成功了!

票数 -1
EN

Stack Overflow用户

发布于 2021-03-21 02:26:16

我也有同样的问题,并且花了一天的大部分时间来解决这个问题。我决心在没有PyCharm(通过VS代码)的情况下解决这个问题,所以如果有人需要它,这里就是这样的:

首先,确保点子在正确的位置。查看解释器从何处提取文件,然后确保文件存在。(我知道这听起来很愚蠢,但我有Python38和Python39文件夹,它们安装在一个文件夹中,然后从另一个文件夹中提取。Scripts folder应该包含以下皮尔斯

打开命令提示符,导航到文件夹并运行python -m venv env。然后,选择解释器-- it 应该包含env。最后,在终端中运行pipenv shell

如果您有任何问题,尝试重新加载窗口。您现在应该可以使用pipenv安装任何外部库了。

Visual代码中的其他资源。

编辑:确保您使用的是Power和/或Bash,可能不会在命令提示符下工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64208930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档