Situation:
I have created a simple dash Cytoscape application, compile it into an executable file using Pyinstaller and tried running it on different computers in the same network all without issues. However, when I tried running it on a different network, I got back an error msg as follows:
File "dash\dash.py", in run_server
self.server.run(host=host, port=port, debug=debug, **flask_run_options)
File "flask\app.py, in run
File "werkzeug\serving.py, in run_simple
File "werkzeug\serving.py, in inner
File "werkzeug\serving.py, in make_server
File "werkzeug\serving.py, in __init__
File "socketserver.py", in __init__
File "socket.py", in __init__
OSError: [WinError 10022] An invalid argument was supplied
Failed to execute script 'Application' due to unhandled exception!
Dash Cytoscape Application script that returns an error when running the executable file:
def open_browser():
webbrowser.open_new('http://127.0.0.1:5000/')
if __name__=='__main__'
Timer(2,open_browser).start()
app.run_server(port=5000, debug=False)
Just wondering why the other computer on the same network is able to launch the executable file but not those on another network? To add on the port 5000 is not in use. Hope to get some clarity and direction on StackOverflow. Appreciate all help.
Related
I am currently trying to set up a workflow to build Pytorch + Docker container such that I can train models elsewhere. I got the Pytorch image from the Nvidia registry and am trying to integrate docker into PyCharm, where my code currently is. Now I'm a bit confused. It is apparently possible to connect with docker and build containers which can be used as python interpreter (https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html). My idea is to get everything running and then export it again as image. I got the Pytorch container running as described but receive following error when I try to run code:
File "/opt/.pycharm_helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/opt/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 11, in execfile
stream = tokenize.open(file) # #UndefinedVariable
File "/opt/conda/lib/python3.8/tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: /home/...
I tried setting paths in the interpreter settings but that did not help. What am I doing wrong? I want to test code in the container and in the end get an image with everything. Is there a better way to do that?
When using the qtmoden library with python.
It works fine when running the code in VS Code.
But after using pyinstaller, it doens't anymore. When opening teh generated .exe file, it states that it does not have access to files located in - C:\Users\MyUsername\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\qtmodern\resources
When running the .exe aplication it errors stating:
Traceback (most recent call last):
File "my_filename.py", line 262, in (this number differs depending on my app/code)
File "qtmodern\styles.py", line 70, in dark
File "qtmodern\styles.py", line 23, in _apply_base_theme
FileNotFoundError: [Errno 2] No such file or directory: " 'C:\sers\MyName\AppData\Local\Temp_MEI166802\qtmodern\resources/styles.qss'
[36020] failed to execute script my_filename
Anybody any idea how to get this fixed?
How to make sure pyinstaller also takes these 2 stypes.py files into account?
I tried adding data with pyinstaller via the --add--data command and including paths with --paths command, But the error message stays the exact same.
I am a beginner in python and trying to convert a .py script into .exe using a derivative of pyinstaller known as fbs, so this question is probably dumb, I apologize in advance.
I used it following the instructions using python 3.6.7 and importing all the modules in the virtual environment as directed. the program run but fbs freeze didn't work. turning the 'Failed to execute script main' error. I run the fbs freeze --debug method and now I am finding this error:
Traceback (most recent call last):
File "lib\site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 172, in init
File "ctypes_init_.py", line 348, in init
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
'''''''''
''''''''''''''
'''''''''''''''''
File "lib\site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 174, in init
main.PyInstallerImportError: Failed to load dynlib/dll 'C:\Users\ALEXIS\Desktop\DEVELOP\target\Test5\sklearn.libs\vcomp140.dll'. Most probably this dynlib/dll was not found when the application was frozen.
[6916] Failed to execute script main
I have tried some solutions that suggested adding --path to the folder that contains Qt5Widgets.dll,"Qt5Core.dll"] and "Qt5Gui.dll" without success. I also tried to add these dll files in the json file as Hidden imports but it didn't work as well.
I hope you can point me in the right direction.
Thanks,
My answer on this thread might be of help to include various resources upon fbs freeze.
The 'google-api-python-client' distribution was not found and is required by the application with pyinstaller
I have a newbie question about creating osquery extensions using osquery-python. I Created a small extension that gets some additional RPM info from my linux system. Following the instructions in the docs, I added the path to the extension in /etc/osquery/extensions.load to get it to autoload. I restarted osqueryd and I see the extension running using ps ax.
If I interactively run osqueryi, I can see the table and get data. It all works perfectly.
However, when I run an osqueryi command 'one-liner' such as :
osqueryi .tables
I get a bunch of the following errors with my output:
#INFO:thrift.transport.TSocket:Could not connect to /root/.osquery/shell.em
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/thrift/transport/TSocket.py", line 104, in open
handle.connect(sockaddr)
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 2] No such file or directory
ERROR:thrift.transport.TSocket:Could not connect to any of ['/root/.osquery/shell.em']
What have I done wrong?
Extensions are run in a separate process. You can see the socket errors, which indicate the extension process cannot communicate with osquery process. Make sure osqueryd or osqueryi is running. Link: osquery doc page for extensions.
I'm not sure which log to look at, but in general, all the errors are the same as this paste. I recently upgraded my client machine to Python version 2.7.8, from 2.7.7. The app runs locally.
E 22:20:58.694
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 302, in _LoadHandler
raise err
ImportError: <module 'blog' from '/base/data/home/apps/s~eminent-augury-789/1.380687153152922933/blog.pyc'> has no attribute application
It didn't work under 2.7.7, I was getting the same error. I created another project, with a different project id, and it works. I'm guessing that the app.yaml file was corrupt and I just couldn't find the problem. I upgraded app engine before I started this. I use VIM, for editing. I used the same project id for different projects, just changed the version number, not sure if that was the problem, either. I don't know how to cut and paste in code samples, they get formatted differently, let me work on that and I'll paste the app.yaml file in.