简体   繁体   English

在 Windows 上运行 python 模块命令

[英]Run python module commands on Windows

I installed Sphinx using pip install sphinx command in Windows Terminal and I want to run sphinx-quickstart to make documentation in my docs directory but it doesn't work.我在 Windows 终端中使用pip install sphinx命令安装了 Sphinx,我想运行sphinx-quickstart在我的docs目录中制作文档,但它不起作用。

I get this error instead:我收到了这个错误:

sphinx-quickstart : The term 'sphinx-quickstart' 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.

If I try to run it via GitBash or using py or python at the beginning that says:如果我尝试通过 GitBash 或在开头使用pypython运行它,则说明:

\path_to_python\python.exe: can't open file '\My_working_directory\docs\sphinx-quickstart': [Errno 2] No such file or directory 

How can I solve this problem?我怎么解决这个问题?

The easiest way to do it is to create simple virtual environment and you will able to install packages you want and run it.最简单的方法是创建简单的虚拟环境,您将能够安装所需的软件包并运行它。

Just create folder and run command to create virtual environment then just activate it using .bat file.只需创建文件夹并运行命令来创建虚拟环境,然后使用.bat文件激活它。

Read the docs but it can differ in future versions of Python.阅读文档,但在 Python 的未来版本中可能会有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Windows到Linux的Iron Python中的openssh模块,以运行命令 - openssh module in iron python from windows to linux to run commands 有没有办法在Windows上的python中运行命令? - is there a way to run commands in python on windows? 通过Python运行Windows CMD命令 - Run Windows CMD commands via Python 如何在 Windows 中运行 python 模块 - How to run python module in Windows 当我们打开一个交互式python3解释器并运行一些命令时,是否在某个模块中运行这些命令? - When we open an interactive python3 interpreter and run some commands, do we run the commands in some module? 无法使用python子进程模块运行带有*的shell命令 - Unable to run shell commands with * using python subprocess module 如何使用python中的命令模块在后台运行命令? - How do I run a command in background using commands module in python? 如何在Windows中运行python模块andrewning / sortphotos - How to run python module andrewning/sortphotos in Windows bash shell commands run through python to be universal with windows, mac, and linux - bash shell commands run through python to be universal with windows, mac, and linux 执行自定义命令以在Windows中运行python插件时出错 - Error while executing custom commands to run python plugin in windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM