运行pipenv install时报错No such file or directory: 'Pipfile'
来源:15-3 使用官方推荐的pipenv创建虚拟环境(很好用哦~)。
qq__9428
2019-05-17
老师您好我在运行pipenv install时报错FileNotFoundError: [Errno 2] No such file or directory: ‘Pipfile’按道理在首次运行这个命令时系统会自动创建这个文件为何我的就提示没有这个文件呢我的环境是windos10
下面是具体报错信息
Traceback (most recent call last):
File "d:pythonlib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:pythonlib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:PythonScriptspipenv.exe__main__.py", line 9, in <module>
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 764, in __call__
return self.main(*args, **kwargs)
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 717, in main
rv = self.invoke(ctx)
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 555, in invoke
return callback(*args, **kwargs)
File "d:pythonlibsite-packagespipenvendorclickdecorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "d:pythonlibsite-packagespipenvendorclickcore.py", line 555, in invoke
return callback(*args, **kwargs)
File "d:pythonlibsite-packagespipenvendorclickdecorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "d:pythonlibsite-packagespipenvclicommand.py", line 254, in install
editable_packages=state.installstate.editables,
File "d:pythonlibsite-packagespipenvcore.py", line 1741, in do_install
pypi_mirror=pypi_mirror,
File "d:pythonlibsite-packagespipenvcore.py", line 567, in ensure_project
project.touch_pipfile()
File "d:pythonlibsite-packagespipenvproject.py", line 677, in touch_pipfile
with open("Pipfile", "a"):
FileNotFoundError: [Errno 2] No such file or directory: 'Pipfile'
写回答
1回答
-
7七月
2019-05-17
是这样的,pipenv install是用来安装具体的python包的,命令:pipenv install 包名,比如你想安装flask 就输入 pipenv install flask。 如果缺省 不加任何包名,那么实际上是安装pipfile这个文件里的所有的包的。因为这里是试看课程,所以就没有提供pipfile文件。Python Flask高级编程里因为开发了一个鱼书网站,所以要安装很多的包,就直接写在了pipfile里。你可以用pipenv install 包名 安装你想要的包。
112019-05-17
相似问题