Sphinx can't find linuxdoc when building readthedocs project - python-sphinx

I am creating some documentation using readthedocs. I can make the html files locally, and when I open the html files with my browser the documentation looks exactly as I want it to. So, I push the source to github and try to build the project there - but that fails with the following error:
Running Sphinx v4.1.2
loading translations [en]... done
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 429, in load_extension
mod = import_module(extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'linuxdoc'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 237, in __init__
self.setup_extension(extension)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 393, in setup_extension
self.registry.load_extension(self, extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 433, in load_extension
err) from err
sphinx.errors.ExtensionError: Could not import extension linuxdoc.rstFlatTable (exception: No module named 'linuxdoc')
Extension error:
Could not import extension linuxdoc.rstFlatTable (exception: No module named 'linuxdoc')
I am using the linuxdoc.rstFlatTable module. I have installed linuxdoc locally and, as I mentioned, the local build of the html files works a treat, and the flat-tables appear as they should. But the build at readthedocs fails.
I suspect I may need to set the path to linuxdoc in conf.py, but I don't know what the path is.
I installed linuxdoc thus:
pip install git+http://github.com/return42/linuxdoc.git
I can't find where it was installed. Any guidance would be much appreciated.

Dependencies like that must be explicitly added to your requirements.txt file,
https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html#using-a-configuration-file
# File: docs/requirements.txt
# Defining the exact version will make sure things don't break
sphinx==3.4.3
sphinx_rtd_theme==0.5.1
readthedocs-sphinx-search==0.1.0
linuxdoc==20210324

Related

Anaconda broke itself upon updating

So, Anaconda suggested me to do a conda update -n base -c defaults conda after I created a new environment, which I did. It ran for a few minutes, with huge amounds of warnings saying it couldn't delete some files. Then stopped, and now everything is broken.
I cannot update anaconda anymore, I cannot run conda info nor conda env list, I can't do anything. I can't use my envs through VScode either for example.
The output of conda info is:
>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1082, in __call__
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 87, in _main
exit_code = do_call(args, p)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\index.py", line 15, in <module>
from .subdir_data import SubdirData, make_feature_record
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 54, in <module>
from conda_content_trust.common import (
File "C:\ProgramData\Anaconda3\lib\site-packages\conda_content_trust\common.py", line 63, in <module>
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\hazmat\primitives\asymmetric\ed25519.py", line 8, in <module>
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\exceptions.py", line 16, in <module>
class _Reasons(utils.Enum):
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\utils.py", line 115, in __getattr__
obj = getattr(self._module, attr)
AttributeError: module 'cryptography.utils' has no attribute 'Enum'
$ C:\ProgramData\Anaconda3\Scripts\conda-script.py info
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
I tried to install conda install anaconda-clean to erase it all cleanly, but I get the same error (cryptography).
It is really a problem in a moment when I need a functional python fast.
I am on Windows 10.
I am not so familiar with conda's inner working on a low level.
Please advise.
Thanks

Error while running ARA server on Alpine linux

I am trying to install the latest version of the Ansible Records Analyzer server on an alpine Linux I made sure that all requirements are well installed ( Django, GCC,python3, Pypi, ansible) the install went well except for a warning about the absence of root PATH on the PATH variable which I fixed:
The warning :
WARNING: The script pbr is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The fix:
~ # export PATH=/root/.local/bin:$PATH
So following the install guide on this step that intends to run the server I have an avalanche of errors as if the run command doesn't find the needed components to be executed although I'm sure all the components are installed :
~ # ara-manage runserver
[ara] No setting found for SECRET_KEY. Generating a random key...
Traceback (most recent call last):
File "/root/.local/bin/ara-manage", line 8, in <module>
sys.exit(main())
File "/root/.local/lib/python3.8/site-packages/ara/server/__main__.py", line 41, in main
if not os.path.exists(settings.ARA_SETTINGS):
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.local/lib/python3.8/site-packages/ara/server/settings.py", line 263, in <module>
ALLOWED_HOSTS=ALLOWED_HOSTS.to_list(),
AttributeError: 'list' object has no attribute 'to_list'
What could be the reason behind this behavior?
Well I managed to overcome this issue, the problem was in dynaconf the current version 3.1.3 doesn't read the conf files properly which fails in the server run.
Meanwhile, the only workaround is to install the previous version of dynaconf :
pip install 'dynaconf==3.1.2'
FYI dynaconf already has a fix proposed for the regression: rochacbruno/dynaconf#541
I've tested that it does resolve this issue and it will be released in dynaconf 3.1.4 soon.

OSError: [WinError 193] %1 is not a valid Win32 application (glumpy app)

Im getting this error while trying to run a code that uses glumpy library in python. Seems like the problem is when trying to run a command using "app". I'm using anaconda and python 3.6. I had hard time installing dlib and glumpy and I want to avoid installing them again on another environment. What can I do so i won't get this error? seems like the problem is in the package i guess?
Traceback (most recent call last):
File "C:/Users/טל קרני/PycharmProjects/untitled/graphicstry.py", line 64, in <module>
window = app.Window(color=(1, 1, 1, 1))
File "C:\anaconda\envs\env_dlib\lib\site-packages\glumpy\app\__init__.py", line 150, in __new__
backend = use(name)
File "C:\anaconda\envs\env_dlib\lib\site-packages\glumpy\app\__init__.py", line 116, in use
importlib.import_module(name)
File "C:\anaconda\envs\env_dlib\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\anaconda\envs\env_dlib\lib\site-packages\glumpy\app\window\backends\backend_glfw.py", line 82, in <module>
from glumpy.ext import glfw
File "C:\anaconda\envs\env_dlib\lib\site-packages\glumpy\ext\glfw.py", line 63, in <module>
_glfw = ctypes.CDLL(_glfw_file)
File "C:\anaconda\envs\env_dlib\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
This almost always means you're trying to load a 32-bit DLL into a 64-bit process, or vice versa. Are you running 64-bit Windows? Did you install 64-bit Python? Did you fetch the 64-bit person of glumpy?

ModuleNotFound error after sucessfully install cgal using conda?

I installed CGAL in windows using conda:
https://anaconda.org/conda-forge/cgal
But it gives error during importing modules.
>>> import CGAL
>>> print(CGAL.__version__)
4.14.0
>>> import CGAL.CGAL_AABB_tree
Traceback (most recent call last):
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 17, in <module>
_CGAL_AABB_tree = swig_import_helper()
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 16, in swig_import_helper
return importlib.import_module('_CGAL_AABB_tree')
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_CGAL_AABB_tree'
The issue is not the ModuleNotFoundError, but the underlying ImportError: DLL load failed:. Looking at your error message, you can see that your python does succesfully locate what you are trying to import at
C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py
but fails to load a dependent DLL.
I have reproduced your issue. It seems to be one that only effects the most current of cgal in conda forge, which is 4.14 When you install the 4.13 version everything works fine, so simply do:
conda remove cgal
conda install -c conda-forge cgal==4.13
I have created an issue on the conda-forge feedstock

Error occurs during installation of Robot Framework with Python on Windows 7

I have installed "python-3.3.0.msi" successfully and set up PATH as "C:\Python33;" on Windows 7. After that I tried to install Robot Framework by using "robotframework-2.7.7.win32.exe" (double click on the .exe file). At the last step of installation I found the following error:
File "<string>", line 35
except Exception, err:
^
SyntaxError: invalid syntax
I clicked on "Finish" button --> Installation wizard was disappeared. I set the PATH as "C:\Python33\Scripts". Then I checked the version by using the command "pybot --version" at command prompt. Below error was shown:
Traceback (most recent call last):
File "C:\Python33\lib\runpy.py", line 140, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "C:\Python33\lib\runpy.py", line 102, in _get_module_details
loader = get_loader(mod_name)
File "C:\Python33\lib\pkgutil.py", line 482, in get_loader
return find_loader(fullname)
File "C:\Python33\lib\pkgutil.py", line 499, in find_loader
pkg = importlib.import_module(pkg_name)
File "C:\Python33\lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 869, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "C:\Python33\lib\site-packages\robot\__init__.py", line 22, in <module>
from robot.rebot import rebot, rebot_cli
File "C:\Python33\lib\site-packages\robot\rebot.py", line 268, in <module>
from robot.conf import RebotSettings
File "C:\Python33\lib\site-packages\robot\conf\__init__.py", line 17, in <mo
from .settings import RobotSettings, RebotSettings
File "C:\Python33\lib\site-packages\robot\conf\settings.py", line 172
except EnvironmentError, err:
^
SyntaxError: invalid syntax
How can I solve the above error?
Robot Framework doesn't support Python 3 yet. You should try to use Python 2.7 instead. (Python 3 changes lots of things in the language syntax, including the syntax for catching exceptions shown in this traceback). So, follow the following installation steps:
Install Python2.7.3
Install robotframework2.7.7
set PATH as "C:\Python27\;C:\Python27\Scripts\"
Verify the installation by using the command "pybot --version" at command prompt. If everything is OK, the
following message will be displayed:
"Robot Framework 2.7.7 (Python 2.7.3 on win32)"
you should run "pip install robotframework-python3"
https://pypi.python.org/pypi/robotframework-python3

Resources