Python API DLL load failed while importing pyopenpose on Windows 10 - python

I can't run OpenPose in Python even though I've followed every step, BUILD_PYTHON is marked, I have the 3 files inside build/python/openpose/Release, and I am running the tutorial examples in the console command from build/examples/tutorial_api_python.
I have even tried copying the rest of .dll from the release version except for my generated "openpose.dll" to build/x64/Release.
Nothing has worked, I get the same error all the time: "DLL load failed while importing pyopenpose".
Also tried with Pythin 3.10.7 and 3.7.9, same result.

Related

cannot load CSVs or Excel files after some updates

I was trying to schedule a new python code by running with a BAT file, but was getting an error that the statsmodels package was not present. The package loaded fine in Spyder, but not when running from a BAT file. I followed a thread here that suggested updating my packages in console (pip command) which I did.
That led to a new error that NumPy was not loading. I noticed that I now had 2 versions of NumPy (1.19.1 and 1.19.2). Further searches yielded advise to uninstall and reinstall NumPy. I had to uninstall twice to get rid of both versions, then installing left me with 1.19.2.
Now, when I run my code in Spyder, I get a strange error on pd.read_csv:
"Only callable can be used as callback"
I couldn't find anyone getting this error from pd.read_csv. Next, I tried to run pd.read_excel in Spyder, but I get this error message:
"int() argument must be a string, a bytes-like object or a number, not '_NoValueType'"
This is code that worked fine yesterday on files that have not changed, so it is not the files. I even made a couple test files and get the same error. Trying to load statsmodels in Spyder now fails:
"from statsmodels.tsa.ar_model import AutoReg"
"AttributeError: module 'numpy.core' has no attribute 'records'"
Running the same code in BAT, reading csv and excel files DO work, but still hangs up on loading statsmodels.
I think at this point, I need to reload Anaconda, but I don't understand why code that works in Spyder does not work running from BAT file, when I am referencing the only copy of python that I have in Anaconda.
Thanks,
It seems to be fine today, so perhaps I needed a full reboot to implement the updates? I don't remember doing this in the past.
I'm still having the original issue with loading the statsmodels package when running from BAT file, but I will ask that in a new post.

How to include pytorch in pyinstaller app?

I am trying to use pyinstaller to "freeze" a python app I've written that uses pytorch. I see that pyinstaller has a hook for torch: https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/hooks/hook-torch.py
But it doesn't appear to work. I still get the following error:
File "torch/_utils_internal.py", line 53, in get_source_lines_and_file
OSError: Can't get source for . TorchScript requires source access in order to carry out
compilation, make sure original .py files are available. Original
error: could not get source code [28326] Failed to execute script
timeslide
I also tried this work-around with no success:
https://github.com/pyinstaller/pyinstaller/issues/2666#issuecomment-370789381
I just need a way to get pytorch to install in a pyinstaller app. It doesn't need to be clean or beautiful. Can anyone suggest a solution?
(macOS and python 3.7)

Transcrypt compilation error Python 3.7 Windows

I just tried the latest transcrypt on Python 3.7 Win7 with the simple program from https://github.com/bunkahle/Transcrypt-Examples/blob/master/alerts/alerts2.py but I got an compilation error:
C:\Python37\Programme\Transcrypt>transcrypt alerts2.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.7.16
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving target code in: C:/Python37/Programme/Transcrypt/__target__/org.transcrypt.__runtime__.js
Saving minified target code in: C:/Python37/Programme/Transcrypt/__target__/org.transcrypt.__runtime__.js
Error while compiling (offending file last):
File 'org.transcrypt.__runtime__', line 0, namely:
[WinError 2] The system cannot find the specified file
Aborted
Any idea what went wrong? I just get a directory named __target__
which holds one file called org.transcrypt.__runtime__.pretty.js but no alerts2.js whatsoever. BTW why did you change the __javascript__ name of the compilation directory from transcrypt 3.6 to __target__ in transcrypt 3.7?
OK, I finally found out myself what went wrong. In case you get that error most probably Java is not installed on your machine which is needed to minify the javascript code which transcrypt seems to try by default. So just invoke the command:
transcrypt -n alerts2.py
and it runs without any error because -n disables minification of the code. BTW it would be nice if transcrypt would output an error message like "Warning: No Java installed - minification is disabled. Install Java for code minification." or the like and still output the not minified code. Or even better not rely on Java at all for code minification. Should be a three liner in Python I think.

Pyinstaller creates working binary in container, but not in server

i have a larger project, based on python. there are some external modules like cement, PIL or boto3 in it as well as some own coded modules. everything working fine as it should.
my idea now was to compile the whole application to a single binary with pyinstaller. so i set up a docker container with ubuntu 14 (same version and 64 bit as on the server, where the script should be running in production). the compilation of the project was done with
pyinstaller --onefile app.py
After compiling the script works perfectly - but only on docker machines (i have tested this on several linux distributions and versions, no problem everywhere running fine).
After i put the script on the working server i got the error message:
Error -3 from inflate: incorrect header check
Error decompressing PIL._imaging.so
Failed to write all bytes for PIL._imaging.so
So i put it on 2 other servers based on Linux Ubuntu, where i got the same error.
My first idea was that there is a problem with the module which was mentioned in the error message. So i created a really stupid demo .py script which was just using the core os module and printed out some strings.
Again the binary worked fine on every of my docker containers but NOT on the servers. Now i got a similar error, which was:
Error -3 from inflate: incorrect header check
Error decompressing _bz2.so
Failed to write all bytes for _bz2.so
Has somebody had the same problem with that, or knows what is the problem here?
My Python Version i am using for compiling is 3.3 (is supported by Pyinstaller)
Thanks very much in advance

error due to copying nltk from 1 python version to another

while in visual studio, I downloaded nltk for python 3.5, then downloaded python 2.7. Instead of installing nltk library again, I copied it and its .dist-info file to python 2.7 directory. Now, working in python 2.7' I'm getting an import warning error. cElementTree.py opens up automatically, displaying an error at from element tree import line. I did Intellisense/Refresh DB and checked Import warning in Open Exceptions Settings -didn't help. Ignoring this error, my program compiles, but seeing it every time I press F5 is annoying.

Categories