I'm trying to follow the tutorial about how to set sphinx and Readthedocs together for project. I used Sphinx back in the day while in a internship, with ubuntu and the setup was quite seamless. I've just launched the sphinx-quickstart on my anaconda power shell. When I try to run make html the following error appears:
(base) PS D:\code\RaspberryServer\docs> make html
make : The term 'make' 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
+ make html
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command make was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\make". See "get-help about_Command_Precedence" for more details.
Firstly I thought it was because I had never installed MinGW. But even after doing so I don't seem to fix the problem and I have no clue to how to start looking into it. My python installation is fully based on Anaconda.
Expand the comment above.
The default site generated by sphinx assumes you use make html on multiple operating systems to generate HTML pages.
That's achieved by typical assumption that,
You are on macOS or Linux with (GNU) make installed, so make html executes the task defined in Makefile.
You are on Windows and at command prompt (cmd.exe), so make html actually calls to make.bat.
However, you are launching PowerShell console ("PS D:" indicates that), so you cannot get make html working properly. PowerShell does not know what to do with make, and won't call make.bat automatically. You need to call .\make.bat html instead.
You may try to use sphinx-build. As far as I know it gets the job done and does not depend on the OS you use.
sphinx-build <sourcedir> <outputdir>
Related
I have an application development server that is automatically updated every night with a massive shell script that we run with crontab. The script specifies #!/bin/sh at the top of the file and I am not able to change that. The basic purpose of the script is to go through the machine and download the latest code in each of the directories that we list in the script. After all of the repositories are updated, we execute a number of scripts to update the relevant databases using the appropriate virtual environment (Django manage.py commands) by calling that virtualenv's python directly.
The issue that I am having is that we have all the necessary Sphinx plugins installed in one of the virtual environments to allow us to build the documentation from the code at the end of the script, but I cannot seem to figure out how to allow the make command to run inside of the virtualenv so that it has access to the proper packages and libraries. I need a way to run the make command inside of the virtual environment and if necessary deactivate that environment afterwards so that the remainder of the script can run.
My current script looks like the below and gives errors on the latter 3 lines, because sh does not have workon or deactivate, and because make can't find the sphinx-build.
cd ${_proj_root}/dev/docs
workon dev
make clean && make html
deactivate
I was able to find the answer to this question here. The error message that is shown when you attempt to build the sphinx documentation from the root is as follows, and leads to the answer that was provided there:
Makefile:12: *** The 'sphinx-build' command was not found. Make sure
you have Sphinx installed, then set the SPHINXBUILD environment
variable to point to the full path of the 'sphinx-build' executable.
Alternatively you can add the directory with the executable to your
PATH. If you don't have Sphinx installed, grab it from
http://sphinx-doc.org/. Stop.
The full command for anyone looking to build sphinx documentation through a cron when all tools are installed in various virtual environments are listed below. You can find the location of your python and sphinx-build commands by using which while the environment is activated.
make html SPHINXBUILD='<virtualenv-path-to>/python <virtualenv-path-to>/sphinx-build'
I'm trying to write the basic plugin for wireshark.
I wrote the basic # foo # dissector(packet-foo.c) as per
https://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html
and then I added and Modified all the file as per
doc/README.plugins
After Modifying all the files It says to Run autogen.sh.
I run it on my command prompt like
C:\Development\Wireshark>./autogen.sh
It says
'.' is not recognized as an internal or external command,
operable program or batch file.
** Am I missing something ? **
Am I missing something ?
Yes, you're missing the fact that Windows and UN*Xes are different operating systems with different toolchains and different build systems, which means that the autotools (automake, autoconf, etc.) aren't used on Windows. :-)
And README.plugins is missing that fact as well. :-( I've filed Wireshark bug 11236 on that.
Try just running nmake -f Makefile.nmake in the top-level directory.
I have had a few attempts at installing SASS on netbeans. I have followed the following tutorial:
http://kgagliardo.com/blog/netbeans-sass-windows-7
I get the below error when creating and trying to save the SASS file and no CSS file is created.
""C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
'"ruby.exe"' is not recognized as an internal or external command,
operable program or batch file. Done."
I've been stuck on this all morning, please help...
UPDATE
I've tried to follow the instructions provided below and it still does not work, although I did get a slightly different error message:
"C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
Syntax error: File to import not found or unreadable:
foundation/components/accordion.
Load path: C:/Users/Leanne/Documents/work/freelance/sites/fws_templates
(DEPRECATED)
on line 10 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\foundation.scss
from line 11 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss
Use --trace for backtrace. Done.
However Now I simply get the original error message again. No idea what to do. See image below showing that I have done everything according to the instructions (I think).
http://i.stack.imgur.com/Eekyt.png
Your path environment variable points to the wrong folder
Your Path to ruby is C:\Ruby193\bin
Go back and edit your path environment variable to point to C:\Ruby193\bin . At the moment you have C:\Ruby\192\bin
EDIT
And Now remove the backslash between Ruby and 193.
Your Path is set to : C:\Ruby\193\bin :-) !
your .bat is in Folder : C:\Ruby193\bin
TIP
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
You don't have path to ruby.exe which is c:\Ruby\192\bin in you PATH variable.
In Windows 7:
Right click on My computer and select Properties -> Go to
Advanced Tab -> Click on the Environmental Variables button
In the Environmental Variables window highlight PATH variable in
System variables section and click Edit
Append ;c:\Ruby\192\bin to the end (the semicolon is intentional)
Restart command prompt
You don't have path to ruby.exe
As simple, reinstall ruby, use ruby installer for windows.
When you go through the installation wizard, you’ll come to this options screen:
From what I can tell, the only option that you need to check on that one is the middle option, which helps your command-line instructions recognize where to find (as it says) “Ruby executables”. Otherwise, you’ll get the error message “ruby is not recognized as an internal or external command” when you try to install Sass in the command prompt.
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
For more information go to Setting Up Sass on Windows
They are all right in the above message. The problem is that Netbeans is not designed to pick up these changes instantaneously. Once you make the changes above, you have to RESTART Netbeans, so that the changes will be applied. This worked for me. Let me know if it works for you.
Thanks
Once sphinx-apidoc has been run the command C:\path\to\doc\make html produces an error beginning:
The 'sphinx-build' command was not found [snip]
However the command does exist and the relevant environment variables are set.
More detail:
1 - Trying to run sphinx_apidoc:
'C:\path\to\jython\bin\sphinx-apidoc' is not recognised as an internal or external command
2 - Called using Jython works: jython C:\path\to\jython\bin\sphinx-apidoc with sensible options produces the documentation *.rst files, conf.py, etc files.
3 - make html then produces the following error:
The 'sphinx-build' command was not found [snip]
It then recommends setting the SPHINXBUILD environment variable, and even the PATH. I already have these two environment variables set, proven to myself by calling echo %PATH% and echo %SPHINXBUILD%.
This is where I get stuck. It appears that the files that Sphinx uses (sphinx-apidoc and sphinx-build in this case), which are in the C:\path\to\jython\bin\ directory, do not have any file suffixes. When called directly from Jython they work as expected (see point 2 above), however when called as part of another process (e.g. make html) they are not recognised and the execution fails (see points 1 and 3 above).
Does anyone know the what, why and most importantly 'how to fix' of this problem?
My setup process is on an unnetworked Windows 7 computer. Jython (2.5.2) was installed using the Jython installer. Then each of the following packages (except setuptools) was installed by extracting it locally and then running jython setup.py install in its extracted directory:
setuptools: by calling jython ez_setup.py with setuptools-1.4.2.tar.gz in the same directory (so there is no attempt to download it)
Jinja2 (2.5)
docutils (0.11)
Pygments (1.6)
Sphinx (1.2.1)
numpydoc (0.4) - Only mentioned because it is also isntalled on the machine.
I have managed to get it working. The problem was that the manual installation and the use of Jython meant that certain environment variables that were expected were not in place. Also, the use of Windows 7 (and I believe MS Windows in general) means that Python scripts without an extension cannot be run without calling them explicitly through Jython (Windows doesn't check for shebangs). Finally, file associations had not been set up (as happens automatically with CPython installation, but has not happened with Jython).
For anyone else with similar problems the following setup works for me:
Locations:
Java Runtime: C:\Java\jre7
Jython: C:\Jython\jython2.5.2
User Environment Variables:
JRE_HOME: C:\Java\jre7
JAVA_HOME: %JRE_HOME%
CLASSPATH: .
JYTHON_HOME: C:\Jython\jython2.5.2
PATH: %JRE_HOME%\bin;%JYTHON_HOME%\bin
File Associations:
At the command prompt type assoc .py=Python.File to associate 'Python.File' with the '.py' extension.
At the command prompt type ftype Python.File=C:\Jython\jython2.5.2\jython.bat "%1" %* to associate the Jython command with files of type 'Python.File'.
Append '.py' (;.PY) to the PATHEXT system environment variable. This will make it possible to execute Python files without having to provide their '.py' extension. (N.B. This does not make it possible to run Python files that do not have a '.py' extension.)
File Extensions:
Rename the four Sphinx commands to include '.py' extensions. This is remarkably difficult with vanilla Windows 7 as it does everything it can to distance the user from such 'low level' details as file extensions, however the rename command at the command prompt does the job: type ren sphinx* sphinx*.py when in the Jython bin directory.
It should now be possible to call sphinx-apidoc or similar from anywhere. Once this is complete the command make html, when called from the documentation directory, should work as expected.
I'm following the instructions from various Wikis on how to compile Node so I can eventually get it running as a service on Windows.
My steps so far:
https://github.com/joyent/node/wiki/Installation
(which lead to...)
http://blog.tatham.oddie.com.au/2011/03/16/node-js-on-windows/
(successfully compiled via cygwin, but lead to...)
https://github.com/joyent/node/wiki/Building-node.js-on-mingw
(which apparently is better than the so far successful cygwin compile)
So - I've managed to compile Node.exe using Cygwin but not the preferred Mingw. I concur this isn't an ideal situation, building on Windows isn't the ideal. Nevertheless.
The error I see in Mingw, once I've followed all of the steps above, occurs when I try to ./configure --without-ssl. The error message is:
Danjah#PC /c/cygwin/home/Danjah/node-v0.4.7/node
$ ./configure –without-ssl
/usr/bin/env: python: No such file or directory
I understand from step 3's URL, that I must take steps to provide the environment variables for both Python and Git - using help from the provided URL I managed to input the Python path var, but I don't think I have the Git path var right. Either way, in no install directories for Python, Cygwin or Mingw32 do I see the path specified in the error msg: "/usr/bin/env".
Googling didn't really bring much to the table in terms of env variables or Mingw32, best I got was: PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin where my install directory is at C:\MingW\.
The path I added to Windows environment vars for Python was: PythonPath=C:\Python27;C:\Python27\DLLs;C:\Python27\Lib;C:\Python27\Lib\lib-tk where Python 2.7 is installed in C:\Python27\.
I hate it when a file path stops you from doing things, as I suspect is the problem here. So please set me straight here - is it a file path problem I have or something else? And if its something else, please try and help me to get Node up and running... keen as to get experimenting.
I should probably also mention that I do also have a previously installed version of Git on my Windows XP SP3 machine, but had not previously had Cygwin, Mingw32 or Python installed, and I do not have IIS running as a service - my usual testing environment is a WAMP stack.
Windows uses the PATH environment variable to locate programs that are invoked without a fully qualified file path, i.e. 'python' rather than 'C:\Python27\python'.
So you need to add python's home directory to the Windows PATH variable, as well as MinGW, git and anything else your script requires.
Also by setting the PATH variable explicitly in your shell session or script, you are overwriting its original contents (in the local context) which limits which programs your shell can find to only those available within the PATH which is usually a bad idea.
See http://www.java.com/en/download/help/path.xml for details on modifying your PATH so you can always run your Python scripts from the command line.