[Twisted-Python] Minor fixes in the “Customizing twistd logging” section

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Mar 14 23:42:16 MDT 2017


> On Mar 14, 2017, at 6:28 AM, Роман Мещеряков <romanmescheryakov at yandex.ru> wrote:
> 
> I installed libffi-dev and libssl-dev Raspbian packages, and run "tox -e narrativedocs" again. Now the error was about missing "sphinx-build" executable. So I activated virtualenv where Sphinx was previously installed and again issued "tox -e narrativedocs". Now the output was:
>  
> (twisted-dev-env) pi at zyuzino11:~/ColourDreams/Twisted-dev $ tox -e narrativedocs
> GLOB sdist-make: /home/pi/ColourDreams/Twisted-dev/setup.py
> narrativedocs inst-nodeps: /home/pi/ColourDreams/Twisted-dev/build/dist/Twisted-17.1.0dev0.zip
> narrativedocs installed: appdirs==1.4.3,asn1crypto==0.21.1,attrs==16.3.0,Automat==0.5.0,constantly==15.1.0,enum34==1.1.6,idna==2.5,incremental==16.10.1,ipaddress==1.0.18,packaging==16.8,pycparser==2.17,pyflakes==1.5.0,pyparsing==2.2.0,requests==2.13.0,six==1.10.0,Twisted==17.1.0.dev0,zope.interface==4.3.3
> narrativedocs runtests: PYTHONHASHSEED='496434055'
> narrativedocs runtests: commands[0] | python -c import sys; print(sys.prefix)
> /home/pi/ColourDreams/Twisted-dev/build/narrativedocs
> narrativedocs runtests: commands[1] | python -c import sys; print(sys.exec_prefix)
> /home/pi/ColourDreams/Twisted-dev/build/narrativedocs
> narrativedocs runtests: commands[2] | python -c import sys; print(sys.executable)
> /home/pi/ColourDreams/Twisted-dev/build/narrativedocs/bin/python
> narrativedocs runtests: commands[3] | python --version
> Python 2.7.9
> narrativedocs runtests: commands[4] | sphinx-build -aW -b html -d /home/pi/ColourDreams/Twisted-dev/docs/_build /home/pi/ColourDreams/Twisted-dev/docs /home/pi/ColourDreams/Twisted-dev/docs/_build/
> WARNING:test command found but not installed in testenv
>   cmd: /home/pi/twisted-dev-env/bin/sphinx-build
>   env: /home/pi/ColourDreams/Twisted-dev/build/narrativedocs
> Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.
> Running Sphinx v1.5.3
>  
> Exception occurred:
>   File "conf.py", line 45, in <module>
> ImportError: No module named twisted
> The full traceback has been saved in /tmp/sphinx-err-s9PZVd.log, if you want to report the issue to the developers.
> Please also report this if it was a user error, so that a better error message can be provided next time.
> A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
> ERROR: InvocationError: '/home/pi/twisted-dev-env/bin/sphinx-build -aW -b html -d /home/pi/ColourDreams/Twisted-dev/docs/_build /home/pi/ColourDreams/Twisted-dev/docs /home/pi/ColourDreams/Twisted-dev/docs/_build/'
> __________________________________________________________ summary __________________________________________________________
> ERROR:   narrativedocs: commands failed
> (twisted-dev-env) pi at zyuzino11:~/ColourDreams/Twisted-dev $
>  
> The error is "twisted" module missing. How could I fix that? Should I install Twisted Python package to my virtualenv? Now I only have Twisted Python package installed globally.

From what I've seen here, it doesn't look like you've done anything wrong - this should work.  So it's going to require some investigation.

I don't know why it would be choosing to 'inst-nodeps' when the deps clearly aren't installed yet.  When I do this, what I see is:

GLOB sdist-make: /Users/glyph/Projects/Twisted/setup.py
narrativedocs create: /Users/glyph/Projects/Twisted/build/narrativedocs
narrativedocs inst: /Users/glyph/Projects/Twisted/build/dist/Twisted-17.1.0.dev0.zip
narrativedocs installed: alabaster==0.7.10,amptrac==0.1,appdirs==1.4.3,asn1crypto==0.21.1,astroid==1.4.9,attrs==16.3.0,Automat==0.5.0,Babel==2.3.4,cffi==1.9.1,colorama==0.3.7,constantly==15.1.0,cryptography==1.8.1,docutils==0.13.1,enum34==1.1.6,epydoc==3.0.1,extras==1.0.0,fixtures==3.0.0,idna==2.5,imagesize==0.7.1,incremental==16.10.1,ipaddress==1.0.18,Jinja2==2.9.5,lazy-object-proxy==1.2.2,linecache2==1.0.0,logilab-common==1.2.1,MarkupSafe==1.0,packaging==16.8,pbr==2.0.0,pyasn1==0.2.3,pyasn1-modules==0.0.8,pycodestyle==2.0.0,pycparser==2.17,pydoctor==16.3.0,pyflakes==1.5.0,Pygments==2.2.0,pylint==1.5.6,pyOpenSSL==16.2.0,pyparsing==2.2.0,python-mimeparse==1.6.0,python-subunit==1.2.0,pytz==2016.10,requests==2.13.0,service-identity==16.0.0,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.5.3,testtools==2.2.0,traceback2==1.4.0,treq==16.12.0,Twisted==17.1.0.dev0,twisted-dev-tools==0.0.2,twistedchecker==0.7.1,unittest2==1.1.0,wrapt==1.10.10,zope.interface==4.3.3
narrativedocs runtests: PYTHONHASHSEED='3320851011'
narrativedocs runtests: commands[0] | python -c import sys; print(sys.prefix)
/Users/glyph/Projects/Twisted/build/narrativedocs/bin/..
narrativedocs runtests: commands[1] | python -c import sys; print(sys.exec_prefix)
/Users/glyph/Projects/Twisted/build/narrativedocs/bin/..
narrativedocs runtests: commands[2] | python -c import sys; print(sys.executable)
/Users/glyph/Projects/Twisted/build/narrativedocs/bin/python
narrativedocs runtests: commands[3] | python --version
Python 2.7.12
narrativedocs runtests: commands[4] | sphinx-build -aW -b html -d /Users/glyph/Projects/Twisted/docs/_build /Users/glyph/Projects/Twisted/docs /Users/glyph/Projects/Twisted/docs/_build/
Running Sphinx v1.5.3
making output directory...
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/3.3/objects.inv...
intersphinx inventory has moved: http://docs.python.org/3.3/objects.inv -> https://docs.python.org/3.3/objects.inv
loading intersphinx inventory from http://docs.python.org/2.7/objects.inv...
intersphinx inventory has moved: http://docs.python.org/2.7/objects.inv -> https://docs.python.org/2.7/objects.inv
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 135 added, 0 changed, 0 removed
reading sources... [100%] words/index                                                              
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] words/index                                                               
generating indices... genindex
writing additional pages... search
copying images... [100%] web/howto/../img/web-process.png                                          
copying downloadable files... [ 58%] core/howto/tutorial/listings/finger/twisted/plugins/finger_tutcopying downloadable files... [ 84%] core/howto/listings/systemd/www.example.com.socketactivated.secopying downloadable files... [100%] core/howto/tutorial/listings/finger/fingerPBclient.py         
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.
_____________________________________________ summary _____________________________________________
  narrativedocs: commands succeeded
  congratulations :)


So, a few questions for you:

Are you running the latest `tox`? (tox --version == 2.6.0)
This is not the first time you've run 'tox', or it would have the 'narrativedocs create' line above.  Did you see what happened on the earlier runs?  Did they all fail?
Can you try re-creating the virtual environment?  Either `tox -r -e narrativedocs` or `rm -fr build/; tox -e narrativedocs`
Can you try doing this against a 'dev' install, i.e. `tox --develop -e narrativedocs`?
What happens if you make a new virtual environment and do `pip install .../path/to/twisted[dev]` (just .[dev] if you're in the twisted dir)?  Specifically: does sphinx get installed in that virtual environment?
Did you copy this development environment from another machine, or move it to a different folder?

Hopefully we can get to the bottom of this and learn something for future contributors about whatever pitfall you've encountered!

Thanks for your patience,

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20170314/9e9d0fbc/attachment-0002.html>


More information about the Twisted-Python mailing list