问题介绍 语言版本:Python 3.8 操作系统:Windows 10 任何其他相关软件:Jupyter Notebook 和 html-requests
语境:
我正在尝试安装 pipenv 并按照本教程使用 pipenv。我只能在添加“-m”后才能成功安装请求(如下面的第二段代码所示)。我什至不知道“-m”是什么意思,也不知道我是怎么知道的。我的目标和预期结果是打开一个 pipenv shell。
实际结果:
之后,当我尝试打开 pipenv shell 时收到此错误:
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
我尝试过的事情:我在错误之前插入的代码:
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.