read-the-docs: ImportError despite dependency being set in setup.py - python-sphinx

Consider this build error:
I see lines like: ImportError: No module named swisseph and invalid signature for automodule (u'jyotisha\n :members:'). My setup.py does include pyswisseph as a dependency already.. What's a good fix?
PS: My local sphinx build seems fine.

Following #steve-piercy's tip and the FAQ, I was able to get past this error - I just needed to to enable the virtualenv feature in the Admin page of my project.
The install then fails for another (as yet undebugged reason) - but that's separate.

Related

Sphinx Documentation (autodoc) not working after uploading to Github

I have built sphinx documentation for my package.
It is working fine when testing localhost. But after uploading it to Github and building docs on readthedocs.org the documentation page is not working which uses autodoc.
Here is the link to the Github repository.
https://github.com/SparkDrago05/quick_sqlite
Here is the link to the documentation.
https://quick-sqlite.readthedocs.io/en/latest/index.html
Any help will be appreciated!
In your log file, it states WARNING: autodoc: failed to import class 'QuickSqlite' from module 'quick_sqlite'; the following exception was raised: No module named 'quick_sqlite'
You need to tell RTD to install your module. See: https://docs.readthedocs.io/en/stable/tutorial/index.html#making-warnings-more-visible
The reason sphinx.ext.autosummary and sphinx.ext.autodoc fail to import the code is because it is not installed. Luckily, the .readthedocs.yaml also allows you to specify which requirements to install.
.readthedocs.yaml
python:
# Install our python package before building the docs
install:
- method: pip
path: .

go get fyne/io/driver/gl#v1.0.1 unrecognized import path

Trying to follow the installation guide here and most of the process is working. I'm having an issue with building it however.
When trying to build I'm getting this message:
C:...\gameboy.live>go build -o gbdotlive main.go
......\go\pkg\mod\fyne.io\fyne#v1.0.1\driver\gl\gl.go:20:2: missing go.sum entry for module providing package github.com/goki/freetype (imported by fyne.io/fyne/driver/gl); to add:
go get fyne.io/fyne/driver/gl#v1.0.1
Running the suggested command however raises another prompt:
C:...\gameboy.live>go get fyne.io/driver/gl#v1.0.1
go get fyne.io/driver/gl#v1.0.1: unrecognized import path "fyne.io/driver/gl": reading https://fyne.io/driver/gl?go-get=1: 404 Not Found
I've tried going for the version 1.4.3 driver too which raises a different error:
C:...\gameboy.live>go get fyne.io/fyne/gl#v1.4.3
go get: module fyne.io/fyne#v1.4.3 found, but does not contain package fyne.io/fyne/gl
Anybody familiar with this issue? FYI I'm on Windows and have MinGw installed already.
Just run go mod tidy before exec go build -o gbdotlive main.go.Have a try.

How to fix library dependence in a conan package

I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5

Getting wrong when installing tensorflow from source

I had been trying to install tensorflow for a few day. However, cuda 7.5 is the version that tensorflow r0.10.0 supports default. So I can only install it from source. But I came after the following problem which bother me a lot.
.....
INFO: Reading options for 'clean' from /home/lhx/tensorflow-r0.10/tools/bazel.rc:
Inherited 'build' options: --force_python=py2 --host_force_python=py2 --python2_path=/usr/bin/python --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --define PYTHON_BIN_PATH=/usr/bin/python --spawn_strategy=standalone --genrule_strategy=standalone
Unrecognized option: --host_force_python=py2
ERROR: /home/lhx/tensorflow-r0.10/WORKSPACE:18:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: /home/lhx/tensorflow-r0.10/WORKSPACE:22:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: WORKSPACE file could not be parsed.
ERROR: package contains errors: third_party/boringssl.
ERROR: no such package 'external': Package 'external' contains errors.
Configuration finished
I just can't figure out what is going wrong and I have been trying for so long.
I experienced similar errors when my bazel was too outdated. You can try newer bazel version.

easy_install M2Crypto failing on Windows platform

I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following:
SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h'
SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h'
SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h'
SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h'
error: Setup script exited with error: command 'swig.exe' failed with exit status 1
I have read elsewhere that people have suggested easy_install openssl-devel, but that simply tells me that there are no packages found with that name. Is the name perhaps case-sensitive (I've tried various permutations without success), or does that advice not apply to Windows?
I'm not looking for alternatives to M2Crypto. I am picking up some existing code that uses it, so I need to get my development environment to be able to run what's already written.
As jay stated in his answer you should try to build it from source. And I tried. The setup.py does not recognize the --openssl option. Looking at the output from the default setup.py I realized that the search location was c:\pkg and not c:\pkg\openssl.
The solution:
Download and install OpenSSL from Win32 OpenSSL
Copy the lib and include folders to c:\pkg
Check that swig.exe is available in your path
Run easy_install M2Crypto
Worked for me like a charm.
Had a similar problem. After downloading the source package of M2Crypto and reading the INSTALL file I found the following:
Differences when installing on Windows
--------------------------------------
Before building from source, you need to install OpenSSL's include files,
import libraries and DLLs. By default setup.py assumes that OpenSSL include
files are in ``c:\pkg\openssl\include``, and the import libraries
in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
OpenSSL location with --openssl option to build_ext command.

Resources