PyQt5 error during "python3 configure.py": fatal error: 'qgeolocation.h' file not found - python

MAC OSX 10.9, Python 3.5, sip-4.17, PyQt-gpl-5.5.1, Qt5.5.1
Hi,
trying to build PyQt on my system I did the following steps:
download/install Qt5.5.1 libraries
download/unpack SIP
download/unpack PyQt
install SIP:
python3 configure.py -d /Library/Python/3.5/site-packages --arch x86_64
make
sudo make install
tried to install PyQt:
python3 configure.py -d /Library/Python/3.5/site-packages
--qmake /.../Qt5.5.1/5.5/clang_64/bin/qmake
Configuration stopped with:
/Users/werner/OpenSource/PyQt/sip/QtPositioning/qgeolocation.sip:28:10:
fatal >error: 'qgeolocation.h' file not found
#include <qgeolocation.h>
^
1 error generated.
make[1]: *** [sipQtPositioningcmodule.o] Error 1
make: *** [sub-QtPositioning-make_first-ordered] Error 2
I tried to finish installation doing
make
sudo make install
anyway. But the installation doesn't seem to be complete (e.g. uic, pyuic5 are missing). Here is what my installation directory looks like:
>ls /Library/Python/3.5/site-packages/PyQt5
QtBluetooth.so QtSensors.so
QtCore.so QtSerialPort.so
QtDBus.so QtSql.so
QtDesigner.so QtSvg.so
QtGui.so QtTest.so
QtHelp.so QtWebKit.so
QtMacExtras.so QtWebKitWidgets.so
QtMultimedia.so QtWidgets.so
QtMultimediaWidgets.so QtXml.so
QtNetwork.so QtXmlPatterns.so
QtOpenGL.so _QOpenGLFunctions_2_0.so
QtPrintSupport.so _QOpenGLFunctions_2_1.so
QtQml.so _QOpenGLFunctions_4_1_Core.so
QtQuick.so
I couldn't find any useful information when searching for other discussions, so I hope someone can give me a hint on what I'm (maybe stupidly) doing wrong. Thank you for taking the time to read this.

If you don't need this module, the better way to solve that is disabling it on configure.
python configure.py --disable=QtPositioning

Just yesterday, I also met such a problem. And this is what I do to solve it:
Create a header file qgeolocation.h in /PyQt-gpl-5.5.1/QtPositioning, and copy the content into it from this website. Then I go sudo make and sudo make install successfully.
Though I do not know whether it is right to solve this problem, fortunately, I installed the PyQt and entered eric6. Hope you make successfully, too.

Adding the location.h header file for me on OSX 10.11.1.
I had the problem in both PyQt-gpl-5.5.1 and PyQt-gpl-5.5.2, but after adding the
file, was able to build.

The way of creating a qgeolocation.h in /PyQt-gpl-5.5.1/QtPositioning worked for me. The QtPositioning.so was created.

You can also take the header file from your qt source folder (you have installed the source files together with binaries, right?), it is located here:
/Src/qtlocation/src/positioning/qgeolocation.h
and then just copy it into:
/PyQt-gpl-X.X.X/QtPositioning/qgeolocation.h
as follows. It should solve the problem in 99.9% cases.

Related

ta-lib replit python install problem, ERROR: No matching distribution found for talib-binary

I use it on my windows machine by downloading its binary. I also use it in Heroku from its herokus build pack. I don't know what operating system replit use. But I try every possible commed like.
!pip install ta-lib
!pip install talib-binary
It's not working with replit. I thought it work like google co-lab but its not the same.
can anyone use TA-LIB with replit. if so. How you install it?
Getting TA-Lib work on Replit
(by installing it from sources)
Create a new replit with Nix toolset with a Python template.
In main.py write:
import talib
print (talib.__ta_version__)
This will be our test case. If ta-lib is installed the python main.py (executed in Shell) will return something like:
$ python main.py
b'0.6.0-dev (Jan 1 1980 00:00:00)'
We need to prepare a tools for building TA-Lib sources. There is a replit.nix file in your project's root folder (in my case it was ~/BrownDutifulLinux). Every time you execute a command like cmake the Nix reports that:
cmake: command not installed. Multiple versions of this command were found in Nix.
Select one to run (or press Ctrl-C to cancel):
cmake.out
cmakeCurses.out
cmakeWithGui.out
cmakeMinimal.out
cmake_2_8.out
If you select cmake.out it will add a record about it into the replit.nix file. And next time you call cmake, it will know which cmake version to launch. Perhaps you may manually edit replit.nix file... But if you're going to add such commands in a my way, note that you must execute them in Shell in your project root folder as replit.nix file is located in it. Otherwise Nix won't remember your choice.
After all my replit.nix file (you may see its content with cat replit.nix) content was:
{ pkgs }: {
deps = [
pkgs.libtool
pkgs.automake
pkgs.autoconf
pkgs.cmake
pkgs.python38Full
];
env = {
PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
# Needed for pandas / numpy
pkgs.stdenv.cc.cc.lib
pkgs.zlib
# Needed for pygame
pkgs.glib
# Needed for matplotlib
pkgs.xorg.libX11
];
PYTHONBIN = "${pkgs.python38Full}/bin/python3.8";
LANG = "en_US.UTF-8";
};
}
Which means I executed libtool, autoconf, automake and cmake in Shell. I always choose a generic suggestion from Nix, without a specific version. Note: some commands may report errors as we executing them in a wrong way just to add to a replit.nix.
3.
Once build tools are set up we need to get and build TA-Lib C library sources. To do that execute in Shell:
git clone https://github.com/TA-Lib/ta-lib.git
then
cd ta-lib/
libtoolize
autoreconf --install
./configure
If configure script is completed without any problems, build the library with:
make -j4
It will end up with some compilation errors, but they are related to some additional tools which are used to add new TA-Lib indicators and build at the end, but not the library itself. The library will be successfully compiled and you should be able to see it with:
$ ls ./src/.libs/
libta_lib.a libta_lib.lai libta_lib.so.0
libta_lib.la libta_lib.so libta_lib.so.0.0.0
Now we have our C library built, but we can't install it to a system default folders. So we have to use the library as is from the folders where it was build. All we need is just one more additional preparation:
mkdir ./include/ta-lib
cp ./include/*.h ./include/ta-lib/
This will copy a library headers to a subfolder, as they are designed to be used from a such subfolder (which they don't have due to impossibility to perform the installation step).
4.
Now we have TA-Lib C library built and prepared to be used locally from its build folders. All we need after that - is to compile the Python wrapper for it. But Python wrapper will look for a library only in system default folders, so we need to instruct it where our library is.
To do this, execute pwd and remember the absolute path to your project's root folder. In my case it was:
/home/runner/FormalPleasedOffice
Then adjust the paths (there are two) in a following command to lead to your project path:
TA_INCLUDE_PATH=/home/runner/FormalPleasedOffice/ta-lib/include/ TA_LIBRARY_PATH=/home/runner/FormalPleasedOffice/ta-lib/src/.libs/ pip install ta-lib
This is one line command, not a two commands.If the paths would be shorter it would look like:
TA_INCLUDE_PATH=/path1/ TA_LIBRARY_PATH=/path2/ pip install ta-lib.
After execution of this command the wrapper will be installed with two additional paths where it will look for a library and its header files.
That's actually all.
An alternative way would be to clone the wrapper sources, edit its setup.py and install wrapper manually. Just for the record this would be:
cd ~/Your_project
git clone https://github.com/mrjbq7/ta-lib.git ta-lib-wrapper
cd ta-lib-wrapper
Here edit the setup.py. Find the lines include_dirs = [ and library_dirs = [ and append your paths to these lists. Then you just need to:
python setup.py build
pip install .
Note the dot at the end.
5.
Go to the project's folder and try our python script:
$python main.py
b'0.6.0-dev (Jan 1 1980 00:00:00)'
Bingo!
The #truf answer is correct.
after you add the
pkgs.libtool
pkgs.automake
pkgs.autoconf
pkgs.cmake
in the replit.nix dippendancies.
git clone https://github.com/TA-Lib/ta-lib.git
cd ta-lib/
libtoolize
autoreconf --install
./configure
make -j4
mkdir ./include/ta-lib
cp ./include/*.h ./include/ta-lib/
TA_INCLUDE_PATH=/home/runner/FormalPleasedOffice/ta-lib/include/ TA_LIBRARY_PATH=/home/runner/FormalPleasedOffice/ta-lib/src/.libs/ pip install ta-lib
Note : FormalPleasedOffice should be your project name
Done.
Here is the youtube video :
https://www.youtube.com/watch?v=u20y-nUMo5I

Cannot find installation of real FFmpeg (which comes with ffprobe)

I was trying to fit a generator into a model and I got this error:
AssertionError: Cannot find installation of real FFmpeg (which comes with ffprobe).
I have looked over many of the solutions on GitHub and other questions on Stack Overflow but none of them worked for me.
Here is one of the commands I ran:
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install frei0r-plugins
pip list also indicates the presence of ffmpeg-1.4
In addition, I tried force reinstalling and updating ffmpeg just in case any dependencies were not installed properly.
I also set the skvideo's path for ffmpeg manually:
skvideo.setFFmpegPath('/usr/local/lib/python3.6/dist-packages/ffmpeg/')
This returns: /usr/local/lib/python3.6/dist-packages/skvideo/__init__.py:306: UserWarning: ffmpeg/ffprobe not found in path: /usr/local/lib/python3.6/dist-packages/ffmpeg/
warnings.warn("ffmpeg/ffprobe not found in path: " + str(path), UserWarning)
By the way, when I try installing, it also returns this error, I don't know what to do about this:
Get:127 http://archive.ubuntu.com/ubuntu bionic/main amd64 vdpau-driver-all amd64 1.1.1-3ubuntu1 [4,674 B]
Fetched 60.4 MB in 7s (8,769 kB/s)
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/w/wavpack/libwavpack1_5.1.0-2ubuntu1.1_amd64.deb 404 Not Found [IP: 91.189.88.149 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I ran apt-get update --fix-missing and that didn't make anything better.
Is there a solution to this?
FYI it is best to share a minimal notebook that reproduces the entire issue you see to clarify what exactly you're trying to do and how it's going wrong. In this case you might be looking for the following:
!apt-get install --no-install-recommends ffmpeg && pip install ffmpeg scikit-video
import skvideo.io
import skvideo.datasets
bbb = skvideo.datasets.bigbuckbunny()
print('bigbuckbunny is in: {}'.format(bbb))
v = skvideo.io.vread(filename)
print('shape is: {}'.format(v.shape))
(if you've already apt/pip-installed a lot of things, esp. if you've "forced" installation of various packages, you might want to "Reset all runtimes" in colab to get a clean VM to run the above in)
For windows10 users
import skvideo
skvideo.setFFmpegPath('C:\ProgramData\Anaconda3\Lib\site-packages\skvideo\io')
Shortcut Way
ffmpeg link and unzip
You can do this in your code.
Make sure you put up to bin path of unzipped file
import skvideo
skvideo.setFFmpegPath("D:/ffmpeg-20170125-2080bc3-win64-static/ffmpeg-
20170125-2080bc3-win64-static/bin")
Permanent Way
One of the reasons might be that ffmpeg is not configured correctly,(its not always the case).
Step1:
Check ffmpeg is accessible from cmd, type ffmpeg in command line and see if it recognizes the command, if not download link and unzip and add it to the environment variable path Eg:
D:\ffmpeg-20170125-2080bc3-win64-static\ffmpeg-20170125-2080bc3-win64-static\bin
Step 2:
Use where ffmpeg in command line sometimes it could be pointing to wrong file, in my case imageMagick was installed, and system was referring to that
C:\Program Files\ImageMagick-7.0.8-Q16\ffmpeg.exe,
either delete imageMagick path or put it after
D:\ffmpeg-20170125-2080bc3-win64-static\ffmpeg-20170125-2080bc3-win64-static\bin in path environment variable
Step 3.
Close the terminal and reopen and check where ffmpeg, dont worry if it shows two path, but the first path should be of our installation
ffmpeg-20170125-2080bc3-win64-static\ffmpeg-20170125-2080bc3-win64-static\bin
if its okay, you are good to go
Do as follows:
import skvideo
skvideo.setFFmpegPath('your_environment/bin/')
import skvideo.io
videodata = skvideo.io.vread('your_video')
It is important to follow the sequence without mixing the steps.
Add this at the top of your script:
import skvideo
skvideo.setFFmpegPath('/usr/local/lib/python3.6/dist-packages/ffmpeg/')
You must set the FFmpeg path before you import skvideo.io, otherwise it will be ignored.
For windows, you must specify the ffmpeg path. Download ffmpeg for windows from here: https://ffmpeg.zeranoe.com/builds/
Make sure to download the shared version
(if this link dies when you see this, just search "ffmpeg windows" and you will find a download)
Extract it anywhere (eg. C:\\ffmpeg) and then point to it to skvideo like so:
import skvideo
skvideo.setFFmpegPath("C:\\ffmpeg") # you need this before the import
import skvideo.io
vid_data = skvideo.io.vread("data/mp4/train.mp4") # example path
print(vid_data.shape)
For windows:
1.download ffmpeg-...-shared
https://ffmpeg.zeranoe.com/builds/
2.set path to /bin
import skvideo
skvideo.setFFmpegPath('D:\\ProgramData\\ffmpeg\\ffmpeg-20190814-8fcc5d9-win64-shared\\bin')
For windows user this command works
conda install ffmpeg -c mrinaljain17

Unable to build SWIG.exe using MinGw

I am trying to install 'pocketsphinx' module in python which requires swig.exe. After a lot of searching I followed the steps mentioned in the swig site(http://www.swig.org/Doc3.0/Windows.html#Windows_swig_exe) to build an exe. But I am stuck at the last 2 steps.
When './autogen.sh' is executed, I get the following error message although the file 'aclocal' is present in the '/mingw/bin' directory.
vinay#DESKTOP-7LB2J5M /usr/src/swig
$ ./autogen.sh
+ test -d Tools/config
+ aclocal -I Tools/config
./autogen.sh: /mingw/bin/aclocal: No such file or directory
I renamed c:\MinGW\msys\1.0\etc\fstab.sample to c:\MinGW\msys\1.0\etc\fstab and also installed automake, libtool, autoconf, aclocal, autoheader dependencies from MinGW installation manager. What am I missing?
I am not familiar with MinGw or unix commands.

Error installing/compiling grpc on Ubuntu

I have protobuf compiler version 3.0 and need to install grpc and grpc python plugin. Following the tutorial, I added deb http://http.debian.net/debian jessie-backports main to my sources.list file and did sudo apt-get update and sudo apt-get install libgrpc-dev which returned
Package libgrpc-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libgrpc-dev' has no installation candidate
So, I decided to compile it from source as mentioned in INSTALL notes and did:
$ git clone https://github.com/grpc/grpc.git
$ cd grpc
$ git submodule update --init
$ make
$ [sudo] make install
However, on the make step, I get
[MAKE] Generating cache.mk
make: Circular /home/vagrant/grpc2/grpc/libs/opt/libboringssl.a <- /home/vagrant/grpc2/grpc/libs/opt/libboringssl.a dependency dropped.
[C] Compiling third_party/boringssl/crypto/bio/connect.c
third_party/boringssl/crypto/bio/connect.c: In function 'split_host_and_port':
third_party/boringssl/crypto/bio/connect.c:127:17: error: declaration of 'close' shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
make: *** [/home/vagrant/grpc2/grpc/objs/opt/third_party/boringssl/crypto/bio/connect.o] Error 1
On switching to the release-0_11 branch, running make results in
[HOSTCXX] Compiling src/compiler/csharp_generator.cc
src/compiler/csharp_generator.cc:47:43: error: 'google::protobuf::compiler::csharp::GetUmbrellaClassName' has not been declared
src/compiler/csharp_generator.cc: In function 'void grpc_csharp_generator::{anonymous}::GenerateServiceDescriptorProperty(grpc::protobuf::io::Printer*, const ServiceDescriptor*)':
src/compiler/csharp_generator.cc:237:62: error: 'GetUmbrellaClassName' was not declared in this scope
make: *** [/home/vagrant/grpc2/grpc/objs/opt/src/compiler/csharp_generator.o] Error 1
I can't figure out how to install this. Any help would be appreciated.
For me the issue got fixed after i made change in the file as:
diff --git a/src/compiler/csharp_generator.cc
b/src/compiler/csharp_generator.cc
index 7b497df..5a8746d 100644
--- a/src/compiler/csharp_generator.cc
+++ b/src/compiler/csharp_generator.cc
## -44,7 +44,7 ##
using google::protobuf::compiler::csharp::GetFileNamespace;
using google::protobuf::compiler::csharp::GetClassName;
-using google::protobuf::compiler::csharp::GetUmbrellaClassName;
+using google::protobuf::compiler::csharp::GetReflectionClassName;
using grpc::protobuf::FileDescriptor;
using grpc::protobuf::Descriptor;
using grpc::protobuf::ServiceDescriptor;
## -234,7 +234,7 ## void GenerateServiceDescriptorProperty(Printer* out, const ServiceDescriptor *se
out->Print("public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor\n");
out->Print("{\n");
out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n",
- "umbrella", GetUmbrellaClassName(service->file()), "index",
+ "umbrella", GetReflectionClassName(service->file()), "index",
index.str());
out->Print("}\n");
out->Print("\n");
More specifically, please open the file src/compiler/csharp_generator.cc and replace all references of GetUmbrellaClassName by GetReflectionClassName
Working backwards:
for release-0_11: it looks like you're trying to compile against the most recent protobuf. Since we're both in development right now there's occasional breakage - but grpc does track the version of protobuf it's tested against in third_party/protobuf. Try checking out and installing that version. I filed https://github.com/grpc/grpc/issues/4697 to update to the latest protobuf 3.0 version.
for master from github: which compiler and OS are you using? I recently checked in the boringssl integration work, so it's fresh, and not nearly as battle-tested. I'd like to get it battle-tested. That said, if you do a 'make EMBED_OPENSSL=false' then things should work out for you.
for the debian package problem: I'm not sure what's going on. I'm happy to try and spin up a VM with your OS and repro if you can let me know which OS it is.

Does anyone know how to compile Megahal on Ubuntu?

I have been trying to compile megahal for a few hours now and i dont seem to be getting anywhere. Has anyone had success with this?
http://megahal.alioth.debian.org/
I keep getting an error that says :
inlined from ‘load_personality.constprop’ at megahal.c:3283:8,
inlined from ‘change_personality.constprop’ at megahal.c:3332:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:293:2: warning: call to ‘__fread_chk_warn’ declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer
return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
^
cc1: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:44: recipe for target 'pythonmodule' failed
make: *** [pythonmodule] Error 1
I have installed python via sudo apt-get and i have been over every thread that talks about "'x86_64-linux-gnu-gcc' but I have found no solution
You are getting these errors just because you don't have the python development headers installed. You can install it using following command
sudo apt-get install python-dev ( for python 2.x )
sudo apt-get install python3-dev ( for python 3 )
you need the python developer module "python-dev".this will help you
error: command 'gcc' failed with exit status 1 while installing eventlet
after upgrading to vivid 15.04 on ubuntu i couldn't compile the module anymore so i tried something else. Since in the main folder there is a directory named Megahal with a Makefile in it, i tried to compile from there. First you need to go to that directory.
cd /home/user/Downloads/megahal-9.1.1/Megahal/
you need to go where you unzipped the archive and there you can read the README file and start compiling.
perl Makefile.PL
i copied the missing files i was able to find to that folder and from there
make
make test
but this didn't work for me and afther that
make install
i had to do
sudo make install
and that is all. unfortunately for me i have a problem with perl i think.
I keep getting this error from the module "PL_thr_key" after i load it to the eggdrop. The eggdrop works normally except for the module. No module, no AI and no fun :(

Categories

Resources