Exe built using pyinstaller on a Django with pylucene app giving JVM error - django

I am getting an error:
"Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries"
The error arises when I try to execute my exe file.
I have created exe file through pyinstaller on a django application. Application uses pylucine library. I think it may be the issue of error.
How to fix the error?

Since I can't be certain given you've provided very few details here is a shot in the dark to help solve your problem:
First, try removing the jvm.dll file that gets packaged with the pyinstaller -D youmodule.py command (for now work with the directory command rather than -F option). The reason why is here.
With that jvm.dll file gone, you should start seeing the actual error code - and with that the java class or dependency that isn't being loaded.
If it's a java class that isn't being properly loaded then you know instantly it must not be correcly represented in the classpath environment variable and you should do everything in your power to make sure it is:
e.g.: os.environ['CLASSPATH'] += 'the/path/to/the/jar'
Otherwise, consider bulking up your question with more details, especially if you can get a more meaningful error output.

I had the same error trying to run a .exe built with PyInstaller through wine.
My problem went away by adding C:\Program Files\Java\ [your jdk version here] \jre\bin\server to the PATH environment variable in wine - I suppose it might be the same in Windows.
It also reappeared if I tried to build with C:\Program Files\Java\ [your jdk version here] \jre\bin\server in my PATH, so I had to build without it and then append it before running it (I have no explanation as to why this happens).

Related

How can I solve this error in OMNest 5.5.1?

I get the following error:
Exception occurred executing command line.
Cannot run program "C:/OMNEST-5.5.1/samples/enera/lteAdvanced/enera.exe" (in directory "C:\OMNEST-5.5.1\samples\enera\lte"): CreateProcess error=2, The System cannot find the file.
I already built the project many times. I have tried to make a simplier already given example from omnet just to check if this is working. It is working. But if I copy this example in my Project it also doesn't work, so there is sth wrong with my Project file. But it seems to be correct. I just have one Connection and kept it really really simple. But it doesn't work. I have installed Omnest and inet correctly.
The most likely cause is that the EXE file cannot find the omnet++ dynamic libraries it tries the load. And the most likely reason is that you are trying to execute the executable from a CMD prompt instead of from the shell provided by the mingwenv.cmd script.
Everything you do in OMNeT++ (including starting the simulations) must be run from the mingwenv shell.

LNK1181 error when compiling V8 engine on Win10

I'm following this guide on building V8 but I am hitting some issues on the compilation step. I am running Windows 10 x64. I am trying to compile with options to embed the engine also.
Running the following command:
ninja -C out.gn/x64.release
Gives me this error:
ninja: Entering directory `out.gn/x64.release'
[1/471] LINK mksnapshot.exe mksnapshot.exe.pdb
FAILED: mksnapshot.exe mksnapshot.exe.pdb
C:/Workspace/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb #./mksnapshot.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'comdlg32.lib'
ninja: build stopped: subcommand failed.
Now I believe I have narrowed down the error to looking for the .lib files in the wrong directory. I have (had) multiple versions installed, so there were multiple folders in my Windows Kit install.
Windows Kits/10/Lib/10.0.16299.0
Windows Kits/10/Lib/10.0.15xxx.0
If I dragged and dropped the comdlg32.lib file from 10.0.16299.0 into the 10.0.15xxx.0 directory then the error changed to a LNK1181 error with a different input file. I did this a few times but I was unsure if this was going to cause issues with different versions and there was probably going to be a lot.
I uninstalled the 10.0.15xxx.0 version which left behind the folder I mentioned, so I removed that and after doing so I have started getting the LNK1181 error with a different input file (advapi32.lib I assume the very first file it can't find). This is how I came to the conclusion about the path being incorrect.
So I have tried a few things to change the path (I hoped just uninstalling the old version would fix it) such as:
Uninstalling the old version.
Going through registry entries to see if I can find an install path or something using that path, which I didn't. I did notice that there was still installation and data in the registry for the 10.0.15xxx.0 install, I might try deleting that from the registry directly as a last resort?
I have tried to explicitly set the path by setting <TargetUniversalCRTVersion>10.0.16299.0</TargetUniversalCRTVersion> in this file: C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
I have never used Ninja before so I tried looking for a way to set some kind of lib-path in the command but couldn't really find anything.
I looked through the python scripts being executed to try and locate something to do with the libs path but couldn't see anything.
I would be grateful for any help and suggestions. Thanks.
You can try to compile v8 using Visual Studio as explained here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#using-the-visual-studio-ide
By running the following commands:
$ gn gen --ide=vs out.gn/x64.release
$ cd out.gn/x64.release
$ msbuild all.sln
You can see a full example here: https://github.com/phpv8/v8js/issues/272#issuecomment-262848754
Apparently this method is not officially supported anymore, but I had the same problem as you have and this solved the issue for me.
Note that after this I had another issue, the unit tests failed to be compiled due to a linking error, but I had the necessary libraries to use v8. So there may be deeper problem that is causing all of this that I'm missing.
Edit:
Also, you could try to set the following parameters with gn args:
visual_studio_path = "..."
visual_studio_version = "2017"
wdk_path = "..."
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
To set those parameters, do:
gn args out.gn/x64.release
This will open a text editor where you can write the extra parameters you are interested in.
To see the full list of parameters you can specify:
gn args --list out.gn/x64.release
I was following this guide https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 and also ran into the error
LINK1181: cannot open input file 'advapi32.lib'
I'm pretty sure it was because I had the wrong versions of the Windows 10 SDK. Similar to you I had versions:
Windows Kits/10/Lib/10.0.10240.0
Windows Kits/10/Lib/10.0.16299.0
But according to https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Setting-up-Windows (Which I think is relevant) you need version 10.0.15063.0
After installing version 10.0.15063.0 (with the visual studio installer) to
Windows Kits/10/Lib/10.0.15063.0
I was able to continue with the build.

Where is "nvinfer.h" from tensorrt located?

I have been trying to compile a basic tensorRT project on a desktop host -for now the source is literally just the following:
#include <nvinfer.h>
class Logger : nvinfer1::public ILogger
{
} glogger;
Upon running make, though, I receive the following message:
fatal error: nvinfer.h: No such file or directory #include <nvinfer.h>
The error is correct, too - I used locate to try to find it, but there's nothing on my machine that matches. I followed the install instructions for desktop installation of TensorRT 2.1 as described here: https://developer.nvidia.com/nvidia-tensorrt-download
So my question is, does anyone know where nvinfer.h is supposed to be? In other words, am I missing a needed package that contains it, or did I miss something else that's essential?
Small addendum: one thing I noticed is that libgie1 is not installed, and it was not included as a debian with the provided TensorRT download like the other packages such as gie-dev were.
Before using locate, if you recently added new files is a good practice to run sudo updatedb, if the file is on the pc you should see it after.
Anyway googling a bit it looks like the header your looking for is NvInfer.h, caps matters.

Xamarin iOS deploy to device results in 'mscorlib.dll couldn't not be found'

While deploying my application on iOS Simulator it works without any problems, but when I attached iPhone 5 on the Mac, deploying to that device results in following errors from Visual Studio's debug console:
Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution started with arguments: --cache [... paths and arguments ...]
AOT Compilation exited with code 1, command:
MONO_PATH= [...path...]
The assembly mscorlib.dll was not found or could not be loaded.
1> It should have been installed in the `/Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/builds/install/cross64/lib/mono/4.5/mscorlib.dll' directory.
Xamarin.iOS.Common.targets(696,3): error : Could not AOT the assembly '/Users/blagoja/Library/Caches/Xamarin/mtbs/builds/MobApp.iOS/1be55aeb91c215df9342d3daa452982b/C:/Users/xxx/AppData/Local/Temp/vsF8C6.tmp/iPhone/Debug/mtouch-cache/64/Build/System.dll'
So fifth sentence (or sixth line) is saying that 'mscorlib.dll' could not be found at specified path, but from showed path where it should reside, on my mac i see only first directory 'Users'... nothing else.
So yeah, i belive i should put there the 'mscorlib.dll' but copy-paste is the right choice?
Also i managed to find multiple versions for mscorlib.dll into Developer/Frameworks/Mono.framework/Versions/{version}/lib/mono/{mono_versions}/mscordlib.dll. So maybe the configuration has path mismatches?

Python subprocess is unstable on Windows 10?

p = subprocess.Popen([executable_file])
This is only code that I am using to run the python subprocess. However, it has unknown issue that cause my program cannot open the executable file as expected.
executable_file is one file link (PATH) that locate executable program.
Ex. C:\Users\SharkIng\Dev\WhatEverSystem\Builds\Windows\program-123456789-123456789.exe
The python subprocess.Popen should run the program. However, sometime it works and sometime it is not (I did not change any code between this two situation)
OS: Windows 10
Python: 2.7.*
Error: [Error 2] The system cannot find the file specified
BUT: It is working if you manually run subprocess.Popen([executable_file_path_string]) (with same file and path) it work.
WHY this happen?? Is that because some problem with Windows Python? or it is because my setting mess me up?
UPDATE: It is not some reason such as NOT FULL PATH. I can have it working with exact same code. If I ran same code in a python shell, by typing each line of code. It works. But if I put exact same code in a .py file and run it with python file.py, it showing the error
UPDATE 2: Another team member have same error with Windows 7 and Python 2.7.* This code used to work this morning. AGAIN I didn't change anything. That is way I am asking if it is unstable.
There is no problem with subprocess. If you want to run a specified executable, you need to give the full path to that file. The most likely reason you're seeing variable behavior is that sometimes you're in the directory with the .exe, and other times you're not.