Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python issues compiling in Linux #32

Open
M3-Coordinator opened this issue Jan 7, 2021 · 5 comments
Open

Python issues compiling in Linux #32

M3-Coordinator opened this issue Jan 7, 2021 · 5 comments
Labels

Comments

@M3-Coordinator
Copy link

I am getting errors when compiling on Ubuntu 20.04 concerning Python.h not found for behaviortracker and behaviortrackerworker.
Some sleuthing around the web leads me to believe that I am missing some python libraries.
I have python3-dev and numpy installed. Does behaviortracker require additional python libraries?

@daharoni
Copy link
Member

daharoni commented Jan 7, 2021

Hmm, interesting. The behaviortracker code just requires Python to be embedded. For Windows this just meant I needed to include:

INCLUDEPATH += C:/Users/dbaha/.conda/envs/basepy37/include
LIBS += -LC:/Users/dbaha/.conda/envs/basepy37/libs -lpython37

and
INCLUDEPATH += C:/Users/dbaha/.conda/envs/basepy37/Lib/site-packages/numpy/core/include
in the .pro file. It shouldn't require anything else.

The only other issue I had run into, but this has to do with actually running Python code within the software, is your numpy install must include a .libs folder which contains an important .dll file. This folder doesn't always show up when installing numpy through conda but does seem to always show up when using pip install.

@dysonsphere-startmail
Copy link

Hmm, OK. so I definitely have python installed:
kdys@serval-pop-os:~$ python3 --version Python 3.8.5

but for another application I had to set a symbolic link from "python" to direct to "python2" so:
kdys@serval-pop-os:~$ python --version Python 2.7.18

Maybe that is an issue as the path to python leads to the 2.7 location?

Also, I have numpy installed via pip3:
kdys@serval-pop-os:~$ pip3 install numpy Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)

I may have to direct the Qt .pro file to the correct python locations.
I tried by adding:

INCLUDEPATH += /usr/lib/python3/include
LIBS += -L/usr/lib/python3.8 -python3.8
INCLUDEPATH += /usr/lib/python3/dist-packages/numpy/core/include

with those directories holding the following files:

kdys@serval-pop-os:/usr/lib/python3/dist-packages/numpy/core/include/numpy$ ls -alh
total 396K
drwxr-xr-x 3 root root 4.0K Nov 16 15:47 .
drwxr-xr-x 3 root root 4.0K Nov 16 15:47 ..
-rw-r--r-- 1 root root  164 Jun 15  2019 arrayobject.h
-rw-r--r-- 1 root root 3.5K Jun 15  2019 arrayscalars.h
-rw-r--r-- 1 root root 1.9K Aug 30  2019 halffloat.h
-rw-r--r-- 1 root root  60K Feb 18  2020 __multiarray_api.h
-rw-r--r-- 1 root root  56K Feb 18  2020 multiarray_api.txt
-rw-r--r-- 1 root root  12K Oct 15  2019 ndarrayobject.h
-rw-r--r-- 1 root root  64K Nov  8  2019 ndarraytypes.h
-rw-r--r-- 1 root root 1.9K Jun 15  2019 _neighborhood_iterator_imp.h
-rw-r--r-- 1 root root 6.7K Aug 30  2019 noprefix.h
-rw-r--r-- 1 root root 4.7K Aug 30  2019 npy_1_7_deprecated_api.h
-rw-r--r-- 1 root root  15K Aug 30  2019 npy_3kcompat.h
-rw-r--r-- 1 root root  38K Nov  8  2019 npy_common.h
-rw-r--r-- 1 root root 3.8K Aug 30  2019 npy_cpu.h
-rw-r--r-- 1 root root 2.6K Aug 30  2019 npy_endian.h
-rw-r--r-- 1 root root 3.4K Aug 30  2019 npy_interrupt.h
-rw-r--r-- 1 root root  21K Nov  8  2019 npy_math.h
-rw-r--r-- 1 root root  567 Jun 15  2019 npy_no_deprecated_api.h
-rw-r--r-- 1 root root  817 Jun 15  2019 npy_os.h
-rw-r--r-- 1 root root 1010 Feb 18  2020 _numpyconfig.h
-rw-r--r-- 1 root root 1.2K Aug 30  2019 numpyconfig.h
-rw-r--r-- 1 root root 6.2K Jun 15  2019 old_defines.h
-rw-r--r-- 1 root root  708 Aug 30  2019 oldnumeric.h
drwxr-xr-x 2 root root 4.0K Nov 16 15:47 random
-rw-r--r-- 1 root root  12K Feb 18  2020 __ufunc_api.h
-rw-r--r-- 1 root root 6.8K Feb 18  2020 ufunc_api.txt
-rw-r--r-- 1 root root  13K Nov  8  2019 ufuncobject.h
-rw-r--r-- 1 root root  729 Aug 30  2019 utils.h
kdys@serval-pop-os:/usr/lib/python3.8$ ls -lah
total 4.8M
drwxr-xr-x  31 root root  20K Nov 16 15:47 .
drwxr-xr-x 154 root root  12K Jan  7 15:38 ..
-rw-r--r--   1 root root 4.4K Jul 28 08:59 abc.py
-rw-r--r--   1 root root  33K Jul 28 08:59 aifc.py
-rw-r--r--   1 root root  477 Jul 28 08:59 antigravity.py
-rw-r--r--   1 root root  95K Jul 28 08:59 argparse.py
-rw-r--r--   1 root root  19K Jul 28 08:59 ast.py
-rw-r--r--   1 root root  12K Jul 28 08:59 asynchat.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 asyncio
-rw-r--r--   1 root root  20K Jul 28 08:59 asyncore.py
-rwxr-xr-x   1 root root  20K Jul 28 08:59 base64.py
-rw-r--r--   1 root root  32K Jul 28 08:59 bdb.py
-rw-r--r--   1 root root  14K Jul 28 08:59 binhex.py
-rw-r--r--   1 root root 2.2K Jul 28 08:59 bisect.py
-rw-r--r--   1 root root 1.8K Jul 28 08:59 _bootlocale.py
-rw-r--r--   1 root root  13K Jul 28 08:59 bz2.py
-rw-r--r--   1 root root  25K Jul 28 08:59 calendar.py
-rwxr-xr-x   1 root root  33K Jul 28 08:59 cgi.py
-rw-r--r--   1 root root  12K Jul 28 08:59 cgitb.py
-rw-r--r--   1 root root 5.4K Jul 28 08:59 chunk.py
-rw-r--r--   1 root root  15K Jul 28 08:59 cmd.py
-rw-r--r--   1 root root  36K Jul 28 08:59 codecs.py
-rw-r--r--   1 root root 6.2K Jul 28 08:59 codeop.py
-rw-r--r--   1 root root  11K Jul 28 08:59 code.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 collections
-rw-r--r--   1 root root  26K Jul 28 08:59 _collections_abc.py
-rw-r--r--   1 root root 4.0K Jul 28 08:59 colorsys.py
-rw-r--r--   1 root root 8.6K Jul 28 08:59 _compat_pickle.py
-rw-r--r--   1 root root  14K Jul 28 08:59 compileall.py
-rw-r--r--   1 root root 5.3K Jul 28 08:59 _compression.py
drwxr-xr-x   4 root root 4.0K Nov 16 14:38 concurrent
drwxr-xr-x   2 root root 4.0K Nov 17 15:39 config-3.8-x86_64-linux-gnu
-rw-r--r--   1 root root  54K Jul 28 08:59 configparser.py
-rw-r--r--   1 root root  25K Jul 28 08:59 contextlib.py
-rw-r--r--   1 root root  129 Jul 28 08:59 contextvars.py
-rw-r--r--   1 root root 8.5K Jul 28 08:59 copy.py
-rw-r--r--   1 root root 7.0K Jul 28 08:59 copyreg.py
-rwxr-xr-x   1 root root 6.5K Jul 28 08:59 cProfile.py
-rw-r--r--   1 root root 3.6K Jul 28 08:59 crypt.py
-rw-r--r--   1 root root  16K Jul 28 08:59 csv.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 ctypes
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 curses
-rw-r--r--   1 root root  49K Jul 28 08:59 dataclasses.py
-rw-r--r--   1 root root  87K Jul 28 08:59 datetime.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 dbm
-rw-r--r--   1 root root  320 Jul 28 08:59 decimal.py
-rw-r--r--   1 root root  83K Jul 28 08:59 difflib.py
-rw-r--r--   1 root root  21K Jul 28 08:59 dis.py
drwxr-xr-x   4 root root 4.0K Nov 16 14:38 distutils
-rw-r--r--   1 root root 103K Jul 28 08:59 doctest.py
-rw-r--r--   1 root root 2.8K Jul 28 08:59 dummy_threading.py
-rw-r--r--   1 root root 5.9K Jul 28 08:59 _dummy_thread.py
drwxr-xr-x   4 root root 4.0K Nov 16 14:38 email
drwxr-xr-x   3 root root  16K Nov 16 14:38 encodings
-rw-r--r--   1 root root  35K Jul 28 08:59 enum.py
-rw-r--r--   1 root root 9.6K Jul 28 08:59 filecmp.py
-rw-r--r--   1 root root  15K Jul 28 08:59 fileinput.py
-rw-r--r--   1 root root 4.0K Jul 28 08:59 fnmatch.py
-rw-r--r--   1 root root  15K Jul 28 08:59 formatter.py
-rw-r--r--   1 root root  24K Jul 28 08:59 fractions.py
-rw-r--r--   1 root root  34K Jul 28 08:59 ftplib.py
-rw-r--r--   1 root root  37K Jul 28 08:59 functools.py
-rw-r--r--   1 root root 5.0K Jul 28 08:59 __future__.py
-rw-r--r--   1 root root 4.9K Jul 28 08:59 genericpath.py
-rw-r--r--   1 root root 7.4K Jul 28 08:59 getopt.py
-rw-r--r--   1 root root 5.9K Jul 28 08:59 getpass.py
-rw-r--r--   1 root root  27K Jul 28 08:59 gettext.py
-rw-r--r--   1 root root 5.6K Jul 28 08:59 glob.py
-rw-r--r--   1 root root  21K Jul 28 08:59 gzip.py
-rw-r--r--   1 root root 9.6K Jul 28 08:59 hashlib.py
-rw-r--r--   1 root root  23K Jul 28 08:59 heapq.py
-rw-r--r--   1 root root 6.5K Jul 28 08:59 hmac.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 html
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 http
-rw-r--r--   1 root root  53K Jul 28 08:59 imaplib.py
-rw-r--r--   1 root root 3.8K Jul 28 08:59 imghdr.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 importlib
-rw-r--r--   1 root root  11K Jul 28 08:59 imp.py
-rw-r--r--   1 root root 116K Jul 28 08:59 inspect.py
-rw-r--r--   1 root root 3.5K Jul 28 08:59 io.py
-rw-r--r--   1 root root  70K Jul 28 08:59 ipaddress.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 json
-rw-r--r--   1 root root  945 Jul 28 08:59 keyword.py
drwxr-xr-x   5 root root 4.0K Nov 16 14:43 lib2to3
drwxr-xr-x   2 root root  12K Nov 16 15:47 lib-dynload
-rw-r--r--   1 root root  13K Jul 28 08:59 LICENSE.txt
-rw-r--r--   1 root root 5.3K Jul 28 08:59 linecache.py
-rw-r--r--   1 root root  77K Jul 28 08:59 locale.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 logging
-rw-r--r--   1 root root  13K Jul 28 08:59 lzma.py
-rw-r--r--   1 root root  77K Jul 28 08:59 mailbox.py
-rw-r--r--   1 root root 8.0K Jul 28 08:59 mailcap.py
-rw-r--r--   1 root root  15K Jul 28 08:59 _markupbase.py
-rw-r--r--   1 root root  22K Jul 28 08:59 mimetypes.py
-rw-r--r--   1 root root  24K Jul 28 08:59 modulefinder.py
drwxr-xr-x   4 root root 4.0K Nov 16 14:38 multiprocessing
-rw-r--r--   1 root root 5.5K Jul 28 08:59 netrc.py
-rw-r--r--   1 root root  43K Jul 28 08:59 nntplib.py
-rw-r--r--   1 root root  28K Jul 28 08:59 ntpath.py
-rw-r--r--   1 root root 2.6K Jul 28 08:59 nturl2path.py
-rw-r--r--   1 root root  11K Jul 28 08:59 numbers.py
-rw-r--r--   1 root root 5.7K Jul 28 08:59 opcode.py
-rw-r--r--   1 root root  11K Jul 28 08:59 operator.py
-rw-r--r--   1 root root  59K Jul 28 08:59 optparse.py
-rw-r--r--   1 root root  39K Jul 28 08:59 os.py
-rw-r--r--   1 root root  20K Jul 28 08:59 _osx_support.py
-rw-r--r--   1 root root  51K Jul 28 08:59 pathlib.py
-rwxr-xr-x   1 root root  62K Jul 28 08:59 pdb.py
-rw-r--r--   1 root root   64 Jul 28 08:59 __phello__.foo.py
-rw-r--r--   1 root root  63K Jul 28 08:59 pickle.py
-rw-r--r--   1 root root  92K Jul 28 08:59 pickletools.py
-rw-r--r--   1 root root 8.8K Jul 28 08:59 pipes.py
-rw-r--r--   1 root root  21K Jul 28 08:59 pkgutil.py
-rwxr-xr-x   1 root root  40K Jul 28 08:59 platform.py
-rw-r--r--   1 root root  31K Jul 28 08:59 plistlib.py
-rw-r--r--   1 root root  15K Jul 28 08:59 poplib.py
-rw-r--r--   1 root root  16K Jul 28 08:59 posixpath.py
-rw-r--r--   1 root root  21K Jul 28 08:59 pprint.py
-rwxr-xr-x   1 root root  23K Jul 28 08:59 profile.py
-rw-r--r--   1 root root  27K Jul 28 08:59 pstats.py
-rw-r--r--   1 root root 4.7K Jul 28 08:59 pty.py
-rw-r--r--   1 root root 6.1K Jul 28 08:59 _py_abc.py
drwxr-xr-x   2 root root  12K Nov 16 14:38 __pycache__
-rw-r--r--   1 root root  15K Jul 28 08:59 pyclbr.py
-rw-r--r--   1 root root 8.1K Jul 28 08:59 py_compile.py
-rw-r--r--   1 root root 224K Jul 28 08:59 _pydecimal.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 pydoc_data
-rwxr-xr-x   1 root root 106K Jul 28 08:59 pydoc.py
-rw-r--r--   1 root root  91K Jul 28 08:59 _pyio.py
-rw-r--r--   1 root root  12K Jul 28 08:59 queue.py
-rwxr-xr-x   1 root root 7.1K Jul 28 08:59 quopri.py
-rw-r--r--   1 root root  29K Jul 28 08:59 random.py
-rw-r--r--   1 root root 5.2K Jul 28 08:59 reprlib.py
-rw-r--r--   1 root root  16K Jul 28 08:59 re.py
-rw-r--r--   1 root root 7.0K Jul 28 08:59 rlcompleter.py
-rw-r--r--   1 root root  12K Jul 28 08:59 runpy.py
-rw-r--r--   1 root root 6.3K Jul 28 08:59 sched.py
-rw-r--r--   1 root root 2.0K Jul 28 08:59 secrets.py
-rw-r--r--   1 root root  19K Jul 28 08:59 selectors.py
-rw-r--r--   1 root root 8.4K Jul 28 08:59 shelve.py
-rw-r--r--   1 root root  14K Jul 28 08:59 shlex.py
-rw-r--r--   1 root root  50K Jul 28 08:59 shutil.py
-rw-r--r--   1 root root 2.3K Jul 28 08:59 signal.py
-rw-r--r--   1 root root 3.1K Jul 28 08:59 _sitebuiltins.py
lrwxrwxrwx   1 root root   31 Jul 28 08:59 sitecustomize.py -> /etc/python3.8/sitecustomize.py
-rw-r--r--   1 root root  22K Jul 28 08:59 site.py
-rwxr-xr-x   1 root root  34K Jul 28 08:59 smtpd.py
-rwxr-xr-x   1 root root  44K Jul 28 08:59 smtplib.py
-rw-r--r--   1 root root 7.0K Jul 28 08:59 sndhdr.py
-rw-r--r--   1 root root  35K Jul 28 08:59 socket.py
-rw-r--r--   1 root root  27K Jul 28 08:59 socketserver.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 sqlite3
-rw-r--r--   1 root root  27K Jul 28 08:59 sre_compile.py
-rw-r--r--   1 root root 7.0K Jul 28 08:59 sre_constants.py
-rw-r--r--   1 root root  40K Jul 28 08:59 sre_parse.py
-rw-r--r--   1 root root  50K Jul 28 08:59 ssl.py
-rw-r--r--   1 root root  39K Jul 28 08:59 statistics.py
-rw-r--r--   1 root root 5.4K Jul 28 08:59 stat.py
-rw-r--r--   1 root root  13K Jul 28 08:59 stringprep.py
-rw-r--r--   1 root root  11K Jul 28 08:59 string.py
-rw-r--r--   1 root root  25K Jul 28 08:59 _strptime.py
-rw-r--r--   1 root root  257 Jul 28 08:59 struct.py
-rw-r--r--   1 root root  76K Jul 28 08:59 subprocess.py
-rw-r--r--   1 root root  18K Jul 28 08:59 sunau.py
-rw-r--r--   1 root root 2.1K Jul 28 08:59 symbol.py
-rw-r--r--   1 root root 7.4K Jul 28 08:59 symtable.py
lrwxrwxrwx   1 root root   35 Jul 28 08:59 _sysconfigdata__linux_x86_64-linux-gnu.py -> _sysconfigdata__x86_64-linux-gnu.py
-rw-r--r--   1 root root  26K Jul 28 08:59 _sysconfigdata__x86_64-linux-gnu.py
-rw-r--r--   1 root root  25K Jul 28 08:59 sysconfig.py
-rwxr-xr-x   1 root root  12K Jul 28 08:59 tabnanny.py
-rwxr-xr-x   1 root root  92K Jul 28 08:59 tarfile.py
-rw-r--r--   1 root root  23K Jul 28 08:59 telnetlib.py
-rw-r--r--   1 root root  32K Jul 28 08:59 tempfile.py
drwxr-xr-x   5 root root 4.0K Nov 16 14:38 test
-rw-r--r--   1 root root  19K Jul 28 08:59 textwrap.py
-rw-r--r--   1 root root 1003 Jul 28 08:59 this.py
-rw-r--r--   1 root root 7.1K Jul 28 08:59 _threading_local.py
-rw-r--r--   1 root root  50K Jul 28 08:59 threading.py
-rwxr-xr-x   1 root root  14K Jul 28 08:59 timeit.py
drwxr-xr-x   3 root root 4.0K Nov 16 15:47 tkinter
-rw-r--r--   1 root root  26K Jul 28 08:59 tokenize.py
-rw-r--r--   1 root root 2.4K Jul 28 08:59 token.py
-rw-r--r--   1 root root  23K Jul 28 08:59 traceback.py
-rw-r--r--   1 root root  17K Jul 28 08:59 tracemalloc.py
-rwxr-xr-x   1 root root  30K Jul 28 08:59 trace.py
-rw-r--r--   1 root root  879 Jul 28 08:59 tty.py
-rw-r--r--   1 root root 141K Jul 28 08:59 turtle.py
-rw-r--r--   1 root root 9.5K Jul 28 08:59 types.py
-rw-r--r--   1 root root  68K Jul 28 08:59 typing.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 unittest
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 urllib
-rw-r--r--   1 root root  30K Jul 28 08:59 uuid.py
-rwxr-xr-x   1 root root 6.8K Jul 28 08:59 uu.py
drwxr-xr-x   4 root root 4.0K Nov 16 14:38 venv
-rw-r--r--   1 root root  20K Jul 28 08:59 warnings.py
-rw-r--r--   1 root root  18K Jul 28 08:59 wave.py
-rw-r--r--   1 root root  21K Jul 28 08:59 weakref.py
-rw-r--r--   1 root root 5.7K Jul 28 08:59 _weakrefset.py
-rwxr-xr-x   1 root root  24K Jul 28 08:59 webbrowser.py
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 wsgiref
-rw-r--r--   1 root root 5.8K Jul 28 08:59 xdrlib.py
drwxr-xr-x   7 root root 4.0K Nov 16 14:38 xml
drwxr-xr-x   3 root root 4.0K Nov 16 14:38 xmlrpc
-rw-r--r--   1 root root 7.4K Jul 28 08:59 zipapp.py
-rw-r--r--   1 root root  86K Jul 28 08:59 zipfile.py
-rw-r--r--   1 root root  31K Jul 28 08:59 zipimport.py
kdys@serval-pop-os:/usr/lib/python3/dist-packages/numpy/core$ ls -lah
total 4.4M
drwxr-xr-x  6 root root 4.0K Nov 16 15:47 .
drwxr-xr-x 16 root root 4.0K Nov 16 15:47 ..
-rw-r--r--  1 root root 197K Nov  8  2019 _add_newdocs.py
-rw-r--r--  1 root root    0 Nov  7  2019 _aliased_types.py
-rw-r--r--  1 root root  60K Nov  8  2019 arrayprint.py
-rw-r--r--  1 root root 9.8K Nov  8  2019 _asarray.py
-rw-r--r--  1 root root  413 Jun 15  2019 cversions.py
-rw-r--r--  1 root root  70K Nov  8  2019 defchararray.py
-rw-r--r--  1 root root 3.4K Nov  8  2019 _dtype_ctypes.py
-rw-r--r--  1 root root 9.5K Nov  7  2019 _dtype.py
-rw-r--r--  1 root root  15K Feb 18  2020 _dummy.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root  51K Nov  8  2019 einsumfunc.py
-rw-r--r--  1 root root 4.5K Nov  8  2019 _exceptions.py
-rw-r--r--  1 root root 113K Nov  8  2019 fromnumeric.py
-rw-r--r--  1 root root  17K Nov  8  2019 function_base.py
-rw-r--r--  1 root root 7.3K Aug 30  2019 generate_numpy_api.py
-rw-r--r--  1 root root  19K Nov  8  2019 getlimits.py
drwxr-xr-x  3 root root 4.0K Nov 16 15:47 include
-rw-r--r--  1 root root 4.6K Nov  7  2019 info.py
-rw-r--r--  1 root root 4.7K Nov  8  2019 __init__.py
-rw-r--r--  1 root root  26K Nov  8  2019 _internal.py
drwxr-xr-x  3 root root 4.0K Nov 16 15:47 lib
-rw-r--r--  1 root root  11K Nov  8  2019 machar.py
-rw-r--r--  1 root root  12K Nov  8  2019 memmap.py
-rw-r--r--  1 root root 8.3K Nov  8  2019 _methods.py
-rw-r--r--  1 root root  52K Nov  8  2019 multiarray.py
-rw-r--r--  1 root root 114K Feb 18  2020 _multiarray_tests.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root 3.2M Feb 18  2020 _multiarray_umath.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root  71K Nov  8  2019 numeric.py
-rw-r--r--  1 root root  18K Nov  8  2019 numerictypes.py
-rw-r--r--  1 root root  15K Feb 18  2020 _operand_flag_tests.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root 7.2K Nov  8  2019 overrides.py
drwxr-xr-x  2 root root 4.0K Nov 16 15:47 __pycache__
-rw-r--r--  1 root root  44K Feb 18  2020 _rational_tests.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root  31K Nov  8  2019 records.py
-rw-r--r--  1 root root  18K Feb 18  2020 setup_common.py
-rw-r--r--  1 root root  42K Nov  8  2019 setup.py
-rw-r--r--  1 root root  29K Nov  8  2019 shape_base.py
-rw-r--r--  1 root root 2.8K Aug 30  2019 _string_helpers.py
-rw-r--r--  1 root root  15K Feb 18  2020 _struct_ufunc_tests.cpython-38-x86_64-linux-gnu.so
drwxr-xr-x  4 root root 4.0K Nov 16 15:47 tests
-rw-r--r--  1 root root 9.0K Aug 30  2019 _type_aliases.py
-rw-r--r--  1 root root  14K Nov  8  2019 _ufunc_config.py
-rw-r--r--  1 root root 1.9K Nov  8  2019 umath.py
-rw-r--r--  1 root root  27K Feb 18  2020 _umath_tests.cpython-38-x86_64-linux-gnu.so
-rw-r--r--  1 root root  455 Aug 30  2019 umath_tests.py

Still get the same errors:

/home/kdys/Apps/Miniscope-Qt/Miniscope-DAQ-QT-Software-1.10/source/behaviortrackerworker.h:17: error: Python.h: No such file or directory
In file included from ../source/behaviortrackerworker.cpp:1:
../source/behaviortrackerworker.h:17:11: fatal error: Python.h: No such file or directory
   17 |  #include <Python.h>
      |           ^~~~~~~~~~

@dysonsphere-startmail
Copy link

I have tried the INCLUDEPATH statements both inside and out of the win32 braces:

win32 {
    # Path to your openCV .lib file(s)
    LIBS += -LC:/opencv-4.4.0/build/lib/Release -lopencv_world440

#    LIBS += -LC:/opencv-4.4.0/build/lib/Debug -lopencv_world440d

    # Path to openCV header files
    INCLUDEPATH += C:/opencv-4.4.0/build/install/include
} else {
        CONFIG += link_pkgconfig
        PKGCONFIG += opencv4
    }

    # Do we need DEPENDPATH ????
#    #DEPENDPATH +=

    # For libusb
#    LIBS += -LC:/libusb-1.0.23/MS64/dll/ -llibusb-1.0
#    INCLUDEPATH += C:/libusb-1.0.23/include/libusb-1.0
    # For Python
    INCLUDEPATH += /usr/lib/python3/include
    LIBS += -L/usr/lib/python3.8 -python3.8
#   INCLUDEPATH += C:/Users/dbaha/.conda/envs/basepy37/include
#   LIBS += -LC:/Users/dbaha/.conda/envs/basepy37/libs -lpython37

#   For numpy
    INCLUDEPATH += /usr/lib/python3/dist-packages/numpy/core/include

If I comment out

 else {
        CONFIG += link_pkgconfig
        PKGCONFIG += opencv4
    }

Then I get missing opencv errors. So my guess is that for linux the path statements do not need system specific braces and should just be as I have them above.

The error is looking for Python.h. I don't see a file or directory of that name in any of the INCLUDEPATHs above. So this might be the issue then. Where is that file/directory in Windows?

@dysonsphere-startmail
Copy link

OK. I might have figured it out.
On my system Python.h is in /usr/include/python3.8
I edited the .pro code section to this:

win32 {
    # Path to your openCV .lib file(s)
    LIBS += -LC:/opencv-4.4.0/build/lib/Release -lopencv_world440

#    LIBS += -LC:/opencv-4.4.0/build/lib/Debug -lopencv_world440d

    # Path to openCV header files
    INCLUDEPATH += C:/opencv-4.4.0/build/install/include
} else {
        CONFIG += link_pkgconfig
        PKGCONFIG += opencv4
    }

    # Do we need DEPENDPATH ????
#    #DEPENDPATH +=

    # For libusb
#    LIBS += -LC:/libusb-1.0.23/MS64/dll/ -llibusb-1.0
#    INCLUDEPATH += C:/libusb-1.0.23/include/libusb-1.0
    # For Python
    INCLUDEPATH += /usr/include/python3.8
    INCLUDEPATH += /usr/lib/python3/include
    LIBS += -L/usr/lib/python3.8 -lpython3.8
#   INCLUDEPATH += C:/Users/dbaha/.conda/envs/basepy37/include
#   LIBS += -LC:/Users/dbaha/.conda/envs/basepy37/libs -lpython37

#   For numpy
    INCLUDEPATH += /usr/lib/python3/dist-packages/numpy/core/include

The program compiles without errors and I can launch the application.
I need to test it with miniscope and camera still, as I am at home without access to the equipment.
I will test it out on Monday.

@dysonsphere-startmail
Copy link

OK. So For some reason when I tried to load a config file the program crashed. So I tried re-compiling with debug. At which point I was unable to reproduce the build that I previously had.
After examining the .pro file I found that there is a difference in the code following:
# Move user and device configs to build directory
between 1.02 and 1.10
I changed the 1.10 code to be the same as 1.02 and, voila, a build!
I tested it with the config file for webcam only, using my laptop camera and it worked flawlessly!
I still need to test with v3 and v4 miniscopes (monday).
Here is the .pro file I used to compile for Linux:

QT += qml quick widgets
CONFIG += c++11

QT += 3dcore

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

#DEFINES += DEBUG
#DEFINES += USE_USB
DEFINES += USE_PYTHON

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        backend.cpp \
        behaviorcam.cpp \
        behaviortracker.cpp \
        behaviortrackerworker.cpp \
        controlpanel.cpp \
        datasaver.cpp \
        main.cpp \
        miniscope.cpp \
        newquickview.cpp \
        tracedisplay.cpp \
        videodevice.cpp \
        videodisplay.cpp \
        videostreamocv.cpp

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

# Add Icon
RC_ICONS = miniscope_icon.ico

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

HEADERS += \
    backend.h \
    behaviorcam.h \
    behaviortracker.h \
    behaviortrackerworker.h \
    controlpanel.h \
    datasaver.h \
    miniscope.h \
    newquickview.h \
    tracedisplay.h \
    videodevice.h \
    videodisplay.h \
    videostreamocv.h

DISTFILES += \
    ../Python/DLCwrapper.py \
    ../Scripts/DLCwrapper.py \
    ../deviceConfigs/behaviorCams.json \
    ../deviceConfigs/miniscopes.json \
    ../deviceConfigs/userConfigProps.json \
    ../deviceConfigs/videoDevices.json


CONFIG += link_pkgconfig
PKGCONFIG += opencv4

# For Python
INCLUDEPATH += /usr/include/python3.8
LIBS += -L/usr/lib/python3.8 -lpython3.8

# For numpy
INCLUDEPATH += /usr/lib/python3/dist-packages/numpy/core/include


# Move user and device configs to build directory
copydata.commands = $(COPY_DIR) \"$$shell_path($$PWD\\..\\deviceConfigs)\" \"$$shell_path($$OUT_PWD\\deviceConfigs)\"
copydata2.commands = $(COPY_DIR) \"$$shell_path($$PWD\\..\\userConfigs)\" \"$$shell_path($$OUT_PWD\\userConfigs)\"
copydata3.commands = $(COPY_DIR) \"$$shell_path($$PWD\\..\\Scripts)\" \"$$shell_path($$OUT_PWD\\Scripts)\"
first.depends = $(first) copydata copydata2 copydata3
export(first.depends)
export(copydata.commands)
export(copydata2.commands)
export(copydata3.commands)

QMAKE_EXTRA_TARGETS += first copydata copydata2 copydata3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants