I wrote a program in python, and was trying to compile it into a .exe file using pyinstaller. It gets converted successfully, and I can run the exe file on my device. However, but during compilation, I get many 'lib not found' warnings.
They are as follows:
165185 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\io\_pywrap_file_io.pyd
165210 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_op_def_util.pyd
165293 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_dispatcher.pyd
165329 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_device_lib.pyd
165363 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_tf_session.pyd
165389 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_debug_events_writer.pyd
165603 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\saved_model\experimental\pywrap_libexport.pyd
165627 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_errors_test_helper.pyd
165674 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\profiler\internal\_pywrap_profiler.pyd
165699 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_item.pyd
165727 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_checkpoint_reader.pyd
165772 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_nest.pyd
165832 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_tfprof.pyd
165856 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_utils.pyd
165881 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_kernel_registry.pyd
165992 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_stat_summarizer.pyd
166012 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\io\_pywrap_record_io.pyd
166038 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_events_writer.pyd
166066 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_dtypes.pyd
166085 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_cluster.pyd
166113 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_optimizer.pyd
166156 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_info.pyd
166183 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_op_def_registry.pyd
166211 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_op_gen.pyd
166256 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\profiler\internal\_pywrap_traceme.pyd
166278 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_tensor_float_32_execution.pyd
166293 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\data\experimental\service\_pywrap_server_lib.pyd
166319 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_transform_graph.pyd
166448 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_parameter_converter.pyd
166470 WARNING: lib not found: torch_python.dll dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\torch\_C.cp38-win_amd64.pyd
166546 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\core\_pywrap_py_func.pyd
166557 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\core\_pywrap_bfloat16.pyd
166568 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\platform\_pywrap_stacktrace_handler.pyd
All of them are related to tensorflow, except one which is torch_python.dll. The folder named tensorflow in site-packages exists, but the files are not there. Apart from this it shows warning for hidden imports for tensorflow again.
Following are the hidden import warnings:
130756 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.initializers" not found!
130898 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.layers.experimental.preprocessing" not found!
131048 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.layers" not found!
131050 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.v1" not found!
131057 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.backend" not found!
131057 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.datasets.reuters" not found!
131144 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.regularizers" not found!
131145 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.estimator.experimental" not found!
131146 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.premade" not found!
131147 WARNING: Hidden import "tensorflow._api.v2.compat.v2.estimator" not found!
131407 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.preprocessing.image" not found!
131456 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.datasets" not found!
131456 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.__internal__.backend" not found!
131458 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.__internal__" not found!
131458 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.losses" not found!
131464 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.inception_v3" not found!
131465 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.callbacks" not found!
131468 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.datasets.cifar100" not found!
131621 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.nasnet" not found!
131622 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.activations" not found!
131631 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.estimator" not found!
131631 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.optimizers" not found!
131633 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.v2" not found!
131635 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.applications.mobilenet_v2" not found!
131644 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.datasets.reuters" not found!
131646 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.optimizers" not found!
131647 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.__internal__.legacy" not found!
131829 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.callbacks.experimental" not found!
131830 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.applications" not found!
131832 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.xception" not found!
131833 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.utils" not found!
131905 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.datasets.cifar100" not found!
131906 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.experimental" not found!
131912 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.layers.experimental.preprocessing" not found!
131962 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.inception_resnet_v2" not found!
132010 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.optimizers.schedules" not found!
132101 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.premade" not found!
132105 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.__internal__.legacy.layers.experimental" not found!
132106 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.xception" not found!
132117 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.__internal__.legacy.layers.experimental" not found!
132118 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.__internal__" not found!
132126 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.vgg19" not found!
132214 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.mixed_precision" not found!
132215 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.inception_v3" not found!
132227 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.vgg19" not found!
132280 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.premade" not found!
132281 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.applications.mobilenet_v2" not found!
132291 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.preprocessing.image" not found!
132291 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.inception_resnet_v2" not found!
132292 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.imagenet_utils" not found!
132295 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.datasets.imdb" not found!
132395 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.datasets" not found!
132396 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.__internal__.utils" not found!
132398 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.utils" not found!
132404 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.datasets.boston_housing" not found!
132405 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.layers.experimental.preprocessing" not found!
132406 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.premade" not found!
132408 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.estimator.tpu.experimental" not found!
132583 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.callbacks" not found!
132584 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.layers" not found!
132592 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.mixed_precision" not found!
132637 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.applications.resnet" not found!
132643 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.datasets.cifar100" not found!
132643 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.datasets.imdb" not found!
132646 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.datasets.imdb" not found!
132647 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.estimator.tpu" not found!
132648 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.wrappers" not found!
132649 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.estimator" not found!
132650 WARNING: Hidden import "tensorflow._api.v2.compat.v2.v2" not found!
132661 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.losses" not found!
132672 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.imagenet_utils" not found!
132672 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.wrappers.scikit_learn" not found!
132674 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.applications.imagenet_utils" not found!
132683 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.preprocessing.text" not found!
132684 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.losses" not found!
132777 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.regularizers" not found!
132778 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.vgg19" not found!
132780 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.resnet_v2" not found!
Is there any way I can download them and paste them into the folder or if it can auto-download in any way? Will this create an issue when running the program on another device?
Yes, Add these two arguments in your pyinstaller command:
--add-data="c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow;."
--add-data="c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\torch\_C.cp38-win_amd64.pyd;."
I can run the exe file on my device
It means that you can run it on other devices without any issues
Is there anyway I can download them and paste them in the folder or if it can auto download in any way?
pip install tensorflow must work.
Update: Try building tensorflow manually. You can find full guides here. This will work for sure.
Related
I'm building a project using Vue 3 and nodejs. I need to include some configurations that should change depending on where I run the code. I found the config package that seems very promising, but I started to get a huge number of errors during the start of the project.
The first issue regards some missing packages.
Module not found: Error: Can't resolve 'util' ...
Module not found: Error: Can't resolve 'path' ...
Module not found: Error: Can't resolve 'fs' ...
Module not found: Error: Can't resolve 'os' ...
I solved them by adding this code in the config file:
resolve: {
fallback: {
fs: false,
os: false,
util: false,
path: false
}
}
Now the project starts, but I get these warnings:
warning in ./node_modules/config/lib/config.js
Critical dependency: the request of a dependency is an expression
warning in ./node_modules/config/parser.js
require.extensions is not supported by webpack. Use a loader instead.
When I surf to localhost:8080 I get:
Uncaught ReferenceError: process is not defined
Instead of using resolve.fallback, I also tried to install the dependencies:
npm install path fs os util
but I continue to get the error for fs:
Module not found: Error: Can't resolve 'fs' ...
Is there a way to use the config package easily along with Vue 3?
I created new project using ionic capacitor sync android and was trying to sign apk key for the app
After running build I'm getting below error in package name.ratson.cordova.admob; inside capacitor-cordova-android-plugins.
Can someone please guide me on where am I going wrong?
> Task :capacitor-cordova-android-plugins:compileReleaseJavaWithJavac
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AbstractExecutor.java:3: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:5: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:8: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
.
.
.
.
D:\app\android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\camera\CameraLauncher.java:800: error: cannot find symbol
Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
^
symbol: variable FileProvider
location: class CameraLauncher
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
86 errors
> Task :capacitor-cordova-android-plugins:compileReleaseJavaWithJavac FAILED
Thanks in advance.
I'm trying to incorporate the Google Drive API into one of my projects. The Node.js quick start guide requires me to import file-reading and googleapis libraries. However, when I try to do so, I run into issues when importing it into app.module.ts or any components:
Components import code:
import { Injectable } from '#angular/core';
import {google, drive_v3} from 'googleapis'
const drive = google.drive({version: 'v3'});
#Injectable({
providedIn: 'root'
})
export class SubscriptionService {
constructor () {}
}
Error:
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'child_process' in '...\node_modules\google-auth-library\build\src\auth'
ERROR in ./node_modules/google-auth-library/build/src/crypto/node/crypto.js
Module not found: Error: Can't resolve 'crypto' in '...\node_modules\google-auth-library\build\src\crypto\node'
ERROR in ./node_modules/jwa/index.js
Module not found: Error: Can't resolve 'crypto' in '...\node_modules\jwa'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'fs' in '...\node_modules\google-auth-library\build\src\auth'
ERROR in ./node_modules/google-p12-pem/build/src/index.js
Module not found: Error: Can't resolve 'fs' in '...\node_modules\google-p12-pem\build\src'
ERROR in ./node_modules/googleapis-common/build/src/discovery.js
Module not found: Error: Can't resolve 'fs' in '...\node_modules\googleapis-common\build\src'
ERROR in ./node_modules/gtoken/build/src/index.js
Module not found: Error: Can't resolve 'fs' in '...\node_modules\gtoken\build\src'
ERROR in ./node_modules/agent-base/patch-core.js
Module not found: Error: Can't resolve 'https' in '...\node_modules\agent-base'
ERROR in ./node_modules/https-proxy-agent/index.js
Module not found: Error: Can't resolve 'net' in '...\node_modules\https-proxy-agent'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'os' in '...\node_modules\google-auth-library\build\src\auth'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'path' in '...\node_modules\google-auth-library\build\src\auth'
ERROR in ./node_modules/gaxios/build/src/gaxios.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\gaxios\build\src'
ERROR in ./node_modules/google-auth-library/build/src/auth/oauth2client.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\google-auth-library\build\src\auth'
ERROR in ./node_modules/googleapis-common/build/src/apirequest.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\googleapis-common\build\src'
ERROR in ./node_modules/jws/lib/data-stream.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\jws\lib'ERROR in ./node_modules/jws/lib/sign-stream.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\jws\lib'ERROR in ./node_modules/jws/lib/verify-stream.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\jws\lib'ERROR in ./node_modules/https-proxy-agent/index.js
Module not found: Error: Can't resolve 'tls' in '...\node_modules\https-proxy-agent'
How do I properly import the googleapis library in Angular? I've tried adding the following script import to index.html as lots of people online suggest, but it doesn't seem to work (see comments).
<script src="https://apis.google.com/js/api.js"></script>
I have also made sure to perform the following installs:
npm install --save #types/gapi
npm install --save #types/gapi.auth2
npm install --save #types/gapi.client.drive
googleapis (and google-auth-library) is a NodeJS library. You can't use it in front-end projects as is. There're some workarounds - see https://medium.com/angular-in-depth/google-apis-with-angular-214fadb8fbc5 (but I didn't try it personally so can't recommend).
The other lib you mentioned - https://apis.google.com/js/api.js - is the right one, it's for front-end, but it's not modularized, it's just one big script that you need to load via script tag. That's because you cannot import it via import. To make TS compiler happy (providing you already installed types #types/gapi*) add this import in a file where you accessing gapi global object:
/// <reference types="gapi.client. drive" />
I've created a script in python that is using PyQt5. Now everything works when I'm launching the file from my editor - Studio Code in this case.
I'm having a problem when I try to deploy an exe using PyInstaller or py2exe it gives me error on missing dll's when it's building. It still finishes building anyway, but when I try to run the exe file the cmd window just flashes for a brief moment and nothing more happens.
I suppose this is due to missing dll's and if not than I have to sort this out first anyway.
I've tried searching for the dll's I'm missing on my computer and some I couldn't find at all e.g. Qt53DInput and one I could find in what I suppose is application made in Qt - Qt5Multimedia .
I'm currently using python 3.7.4 which I've already tried reinstalling. I think I didn't try to reinstall PyQt5, should I try doing that?
from PyQt5 import QtWidgets, uic, QtGui, QtCore, QtQuick
import sys
import os.path
import datetime
import shutil
I guess the only important part of my script in this case are the imports, so I've included them here.
python -m PyInstaller --paths C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin my_code.py
Somewhere I've read that it's good idea to include this path, but since the dll are not to be found anywhere, including this folder, then obviously didn't help at all.
This is the warning about the dll's I'm getting:
Looking for dynamic libraries
32805 WARNING: lib not found: Qt5MultimediaQuick.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtMultimedia\declarative_multimedia.dll
58554 WARNING: lib not found: Qt53DInput.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
58844 WARNING: lib not found: Qt53DAnimation.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
58989 WARNING: lib not found: Qt53DRender.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
59284 WARNING: lib not found: Qt53DLogic.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
59440 WARNING: lib not found: Qt53DCore.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
60365 WARNING: lib not found: Qt53DQuickScene2D.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
60680 WARNING: lib not found: Qt53DRender.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
60992 WARNING: lib not found: Qt53DCore.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
84256 WARNING: lib not found: api-ms-win-core-winrt-l1-1-0.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin\qt5bluetooth.dll
84545 WARNING: lib not found: api-ms-win-core-winrt-string-l1-1-0.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin\qt5bluetooth.dll
Maybe it's not complete answear to why PyInstaller or py2exe is not working, but I've found way to deploy my exe properly. I've used fman build system. It didn't work right off the bat though. I had to install windows 10 sdk and make small change to my code:
QFileDialog.getOpenFileName(appctxt)
This no longer worked, because for some reason it needed to be changed to:
QtWidgets.QFileDialog.getOpenFileName(appctxt)
Other than that everything including creation of an installer worked without a problem.
Trying to include a npm module in my jsx.
My dir structure is something like:
app/
node_modules/
webpack.config.json
package.json
main.js
react/
myreact1.jsx
myreact2.jsx
Note: purposely do not want a package.json & node_modules in react/
I've figured out that I have to do this for webpack2 config:
resolve: {
modules: ["node_modules", path.resolve(__dirname, "node_modules")
}
This forces webpack to first always try ./node_modules, then default to app/node_modules
However, for the module I'm trying to include in myreact.jsx (npm: "request"), this module uses alot of native node libraries like "fs" and "tls", etc.
webpack now gives me this error:
Abbreviated error:
ERROR in ./~/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/myproj/app/node_modules/request/lib'
# ./~/request/lib/har.js 3:9-22
# ./~/request/request.js
# ./~/request/index.js
# ../react/myreact1.jsx
# ./app.jsx
# ./main.js
Display-error-details version of the error:
ERROR in ./~/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/myproj/app/node_modules/request/lib'
resolve 'fs' in '/myproj/app/node_modules/request/lib'
How do I get webpack to correctly find the native node modules 'fs', 'tls', 'net' etc for 'request' module and the other 3rd party modules it uses inside it's own node_modules?
Thanks for any help