bash 狮身人面像快速入门不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26876525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sphinx-quickstart doesn't work
提问by pmjn6
I am trying to install sphinx on a remote machine.
我正在尝试在远程机器上安装 sphinx。
Since I don't have an access to the root, I did this:
由于我无权访问根目录,因此我执行了以下操作:
$bash
$mkdir -p ~/local/lib/python2.7/site-packages
$export PYTHONPATH=$PYTHONPATH:~/local/lib/python2.7/site-packages
$export PATH=$PATH::~/local/lib/python2.7/site-packages
$easy_install -U --prefix=$HOME/local Sphinx
But apparently, $easy_install
doesn't build sphinx-quickstart; when I type
但显然,$easy_install
并没有构建 sphinx-quickstart;当我打字时
$sphinx-quickstart
I get the following message:
我收到以下消息:
bash: sphinx-quickstart: command not found
I tried
我试过
find $HOME -name sphinx-quickstart
and no result was found. However, I can import sphinx inside python:
并没有找到结果。但是,我可以在 python 中导入 sphinx:
$python
And then
进而
>>import sphinx
works. Any idea why sphinx-quickstart
doesn't work?
作品。知道为什么sphinx-quickstart
不起作用吗?
采纳答案by pmjn6
I found the solution in this webpage:
我在这个网页中找到了解决方案:
In section 3. Python 2.6+he mentioned that the command line commands are in
在第3节Python 2.6+中,他提到命令行命令在
~/local/bin
Although I had put ~/local/lib/python2.7/siste-packages
in the path, the ~/local/bin
directory was not in the path. So all I did
虽然我已经~/local/lib/python2.7/siste-packages
输入了路径,但~/local/bin
目录不在路径中。所以我所做的一切
$export PYTHONPATH=$PYTHONPATH:~/local/bin
and now it works.
现在它起作用了。
I don't know why find $HOME -name sphinx-quickstart
did not find sphinx-quickstart
不知道为什么find $HOME -name sphinx-quickstart
没有找到sphinx-quickstart
回答by jdknight
An alternative way to invoke sphinx-quickstart
is to explicitly load Sphinx's quickstart module. For Sphinx v1.7+:
另一种调用方法sphinx-quickstart
是显式加载 Sphinx 的快速启动模块。对于 Sphinx v1.7+:
python -m sphinx.cmd.quickstart
For older versions of Sphinx:
对于旧版本的 Sphinx:
python -m sphinx.quickstart
For example:
例如:
$ /c/Python35/python -m sphinx.quickstart
Welcome to the Sphinx 1.6.2 quickstart utility.
...
回答by Gonzalo Garcia
In MacOS (Catalina) and zsh:
在 MacOS (Catalina) 和 zsh 中:
I installed sphinx with brew and had the same problem as you.
我用 brew 安装了 sphinx,遇到了和你一样的问题。
Solution:
Installed it with conda as conda install sphinx
and now it works for me
解决方案:使用 conda as 安装它,conda install sphinx
现在它对我有用
$ sphinx-quickstart
Welcome to the Sphinx 2.3.0 quickstart utility.