I have a problem with streams in python. when I run a script with more than 350 threads, it gives me an error.
Traceback (most recent call last):
File "start.py", line 1487, in <module>
uagents, referers, proxies).start()
File "/usr/local/lib/python3.7/threading.py", line 852, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
saw a solution for ubuntu, it consists in changing the configs of the systemd package. But I never figured out how to do it.
Related
I am trying to build a slam algorithm using python scripts and ROS. I have a top-level workspace which has two packages, one is the (rplidar_ros) package from GitHub and the other is the (slam) package I built using catkin_create_pkg which has an src directory that has two python files icp.py and mapping.py, a msg directory with a custom topic defined in Custom.msg and a launch directory with icp.launch.My problem is that when I use roslaunch to launch all three nodes, the rplidar_ros and icp_node launch fine and keep alive. map_node though dies immediately as soon as its started and then respawns and then dies again and continues this cycle.
When each node is run independently not using roslaunch, if the icp_node is run before map_node, map_node produces the same cycle of shutting and starting. But if map_node is started before icp_node it gives this error -
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 154, in run
(client_sock, client_addr) = self.server_sock.accept()
File "/usr/lib/python2.7/socket.py", line 206, in accept
sock, addr = self._sock.accept()
File "/usr/lib/python2.7/socket.py", line 174, in _dummy
raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
Any idea what could be causing this error?
I've used Pyinstaller and cx_freeze to convert a Python code to .exe and with both of them, I get an error when I run the executable. It's a CLI OpenCV program and works properly from source code.
I'm using Windows 10 and the version of Python is 3.6.4. I've tried this in Linux and there it works.
Output:
1. Generate Dataset. (No data has been generated yet.)
2. Exit
3. Enter Camera Address
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\__init__.py", line 296, in listen
_os_keyboard.listen(self.direct_callback)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\_winkeyboard.py", line 562, in listen
prepare_intercept(callback)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\_winkeyboard.py", line 555, in prepare_intercept
keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_callback, GetModuleHandleW(NULL), NULL)
ctypes.ArgumentError: argument 3: <class 'OverflowError'>: int too long to convert
I'm getting a procedure not found error when trying to call gimp_freaky_bw "from gimpfu" pdb.plug_in_gmic. This worked with an earlier installation of GIMP. I have just installed GIMP 2.8.22 and G'MIC 2.1.1. The error is:
Traceback (most recent call last):
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 736, in response
dialog.res = run_script(params)
File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 361, in run_script
return apply(function, params)
File "C:\Users\tommy\.gimp-2.8\plug-ins\DIEGO_ARTISTIC_JamackSketch.py", line 124, in JamackSketch
pdb.plug_in_gmic(newImage, FreakyBW, 1, # 1=input only active layer
error: procedure not found
In recent versions of the GMIC plugin the entry point is:
pdb.plug_in_gmic_qt(image, drawable, input, output, command)
and not plug_in_gmic as in the reported error. So, fix the python script, or contact the author to get it fixed.
I am running a python 2.7.10 script in my Asus AC68 box. I just call speedtest-cli.py (the speedtest.net py script) from inside a script of mine.
It was working before I rebooted it and now every time I run it I have this error:
Testing download speed.......Exception in thread Thread-1:
Traceback (most recent call last):
File "/opt/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/opt/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/jffs/scripts/LaMetric/speedtestcli.py", line 268, in producer
thread.start()
File "/opt/lib/python2.7/threading.py", line 745, in start
_start_new_thread(self.__bootstrap, ())
error: can't start new thread
Just to be clear, my Asus runs Merlin, an enhanced version of Asuswrt - the firmware used by all recent Asus routers.
The code can be found here: https://github.com/sivel/speedtest-cli
Some tests on ulimit (thanks Google) and setting
ulimit -s 256
solved it...
Just anybody can confirm there might be any side effects?
When I run bottle development server, I notice some warning showing up.
Can any one figure it out what exactly is the problem?
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.6/dist-packages/bottle-0.8.1-py2.6.egg/bottle.py", line 1406, in run
if path: files[path] = mtime(path)
File "/usr/local/lib/python2.6/dist-packages/bottle-0.8.1-py2.6.egg/bottle.py", line 1401, in <lambda>
mtime = lambda path: os.stat(path).st_mtime
OSError: [Errno 20] Not a directory: '/usr/local/lib/python2.6/dist-packages/github2-0.1.2-py2.6.egg/github2/issues.py'
This is a bug in bottle (solved in 0.8.2). The reloading feature checks for modified module files and is confused by paths that point into egg archives. Update to 0.8.2 or disable the reloading-feature to solve this.