runsnake fails in ubuntu with error in squaremap - python

When I start runsnake with
$ runsnake test.profile
the window opens, but with no graphics and no source code (only the list of calls, etc. is present). On the console, I see the following error message:
11:18:17: Debug: Adding duplicate image handler for 'PNG file'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "/usr/lib/python3/dist-packages/runsnakerun/runsnake.py", line 701, in load
self.SetModel(self.loader)
File "/usr/lib/python3/dist-packages/runsnakerun/runsnake.py", line 738, in SetModel
self.squareMap.SetModel(tree, self.adapter)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 221, in SetModel
self.UpdateDrawing()
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 247, in UpdateDrawing
self.Draw(dc)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 257, in Draw
font = self.FontForLabels(dc)
File "/usr/lib/python3/dist-packages/squaremap/squaremap.py", line 267, in FontForLabels
font.SetPointSize(scale * font.GetPointSize())
TypeError: Font.SetPointSize(): argument 1 has unexpected type 'float'
I installed runsnake using
sudo apt-get install runsnake
The versions of the dependencies are, according to pip list:
RunSnakeRun 2.0.5
SquareMap 1.0.5
wxPython 4.0.7
My system is
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"

A quick hack is to change the code that you run by modifying the code:
$ sudo $EDITOR /usr/lib/python3/dist-packages/squaremap/squaremap.py
Go to line 267
Then replace the line with:
font.SetPointSize(int(scale * font.GetPointSize()))
or hardcode someting:
font.SetPointSize(18)

Related

Ansible no longer works

I have been learning Ansible on Windows 10 through WSL (using Pengwin, a Debian-based Linux) and it's been working fine up until last night. This morning, it's as though it doesn't exist any more:
❯ ansible
Traceback (most recent call last):
File "/usr/bin/ansible", line 34, in <module>
from ansible import context
ModuleNotFoundError: No module named 'ansible'
Literally nothing has changed since last night. Even my computer has remained on. The only difference is that I had logged out of my terminal program.
I tried running pengwin-setup to re-install Ansible, but the issue persists.
Finally, I tried installing it via the instructions on Ansible's own site. However, things got even worse:
❯ sudo apt install software-properties-common
[sudo] password for sturm:
Reading package lists... Done
Building dependency tree
Reading state information... Done
software-properties-common is already the newest version (0.96.20.2-2.1).
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
❯ sudo apt-add-repository --yes --update ppa:ansible/ansible
gpg: keybox '/tmp/tmpg2r1t8x7/pubring.gpg' created
gpg: /tmp/tmpg2r1t8x7/trustdb.gpg: trustdb created
gpg: key 93C4A3FD7BB9C367: public key "Launchpad PPA for Ansible, Inc." imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 386, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 273, in add_ppa_signing_key
cleanup(tmp_keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 234, in cleanup
shutil.rmtree(tmp_keyring_dir)
File "/usr/lib/python3.8/shutil.py", line 715, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.8/shutil.py", line 672, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib/python3.8/shutil.py", line 670, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apt/cache.py", line 570, in update
res = self._cache.update(fetch_progress, slist,
apt_pkg.Error: E:The repository 'http://ppa.launchpad.net/ansible/ansible/ubuntu groovy Release' does not have a Release file.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/apt-add-repository", line 168, in <module>
if not sp.add_source_from_shortcut(shortcut, options.enable_source):
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 759, in add_source_from_shortcut
cache.update(sources_list=new_debsrc_entry.file)
File "/usr/lib/python3/dist-packages/apt/cache.py", line 573, in update
raise FetchFailedException(e)
apt.cache.FetchFailedException: E:The repository 'http://ppa.launchpad.net/ansible/ansible/ubuntu groovy Release' does not have a Release file.
Now I'm out of options. How can I get Ansible running again?
Your issue is coming from the fact that you are using the instructions to install Ansible on an Ubuntu distribution, when, as you stated it, Pengwin is a Debian based one.
So you should use the chapter on how to install Ansible on Debian and not how to install Ansible on Ubuntu.
Better, still, because Pengwin is a very particular distribution, since it is a WSL one, you might want to try the installation via pip:
Ansible can be installed with pip, the Python package manager. If
pip isn’t already available on your system of Python, run the
following commands to install it:
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py --user
Then install Ansible:
$ pip install --user ansible
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-with-pip

Enthought Canopy Package Manager error on MacOs High Sierra

I have a problem with installing packages via the built in Package Manager of enthought Canopy. I tried to use the "Upgrade all packages", but it failed.
Beforehand, I tried to solve my problem according to this post, but it did not functionating.
The Package Manager returns with the message:
Warming up...
Traceback (most recent call last):
File "build/bdist.macosx-10.6- x86_64/egg/canopy_dashboard/packman/package_action_worker.py", line 52, in run
File "build/bdist.macosx-10.6- x86_64/egg/canopy_dashboard/packman/package_action.py", line 196, in execute
File "build/bdist.macosx-10.6- x86_64/egg/canopy_dashboard/packman/packman.py", line 726, in <lambda>
File "build/bdist.macosx-10.6- x86_64/egg/canopy_dashboard/packman/packman.py", line 1116, in _upgrade_all
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/cpython_packages_manager.py", line 268, in upgrade_all_packages_prompt
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/cpython_packages_manager.py", line 334, in _upgrade_all_packages_prompt
PackageUpgradeAllError: upgrading all packages failed. Details below:
Traceback (most recent call last):
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/edm_api.py", line 65, in wrapper
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/edm_api.py", line 431, in upgrade_all_packages_command
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/edm_api.py", line 95, in wrapper
File "build/bdist.macosx-10.6- x86_64/egg/canopy_platform/edm_api.py", line 454, in _upgrade_all_command
File "build/bdist.macosx-10.6- x86_64/egg/edm/core/packages_manager.py", line 124, in decorator
File "build/bdist.macosx-10.6- x86_64/egg/edm/core/packages_manager.py", line 490, in upgrade_all_command
File "build/bdist.macosx-10.6- x86_64/egg/edm/core/packages_manager.py", line 505, in _upgrade_all_command
File "build/bdist.macosx-10.6- x86_64/egg/edm/core/packages_manager.py", line 774, in _actions_from_request
UnresolvableRequirements: Unable to satisfy requirements
Conflicting requirements:
Requirements: 'qt == 5.6.2-1'
Install command rule (+qt-5.6.2-1)
Requirements: 'pyside == 1.2.2-15' <- 'qt ^= 4.8.7' <- 'qt'
Can only install one of: (+qt-4.8.7-7 | +qt-5.6.2-1)
Requirements: 'pyside == 1.2.2-15' <- 'shiboken ^= 1.2.2' <- 'qt ^= 4.8.7'
shiboken-1.2.2-14 requires (+qt-4.8.7-4 | +qt-4.8.7-5 | +qt- 4.8.7-6 | +qt-4.8.7-7 | +qt-4.8.7-9 | +qt-4.8.7-10)
Requirements: 'shiboken == 1.2.2-14'
Install command rule (+shiboken-1.2.2-14)
For me, this screen isn't informative and so I am not able to figure out how to solve this problem.
Please uninstall pyside, shiboken, and qt, then try again. (Pyside is already installed using qt 4, and this cannot coexist with qt 5 in the same environment.) Alternatively, you could use Canopy's integrated EDM to create a new environment with pyqt 5, so you could still use pyside / qt 4 in your original user environment and use pyqt 5 in your new environment.

Python ide thonny installation error in ubuntu

I am facing the below issue while installing thonny ide for python.
Traceback (most recent call last):
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/workbench.py", line 287, in _init_runner runner.start()
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/running.py", line 67, instart self.reset_backend()
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/running.py", line 427, in reset_backend self._proxy = backend_class(configuraration_option)
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/running.py", line 596, in __init__ self._start_new_process()
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/running.py", line 762, in _start_new_process my_env["JEDI_LOCATION"] = self_prepare_jedi()
File "/home/shrivatsa/.local/lib/python3.5/site-packages/thonny/running.py", line 703, in _prepare_jedi import jedi ImportError: No module named 'jedi'
The application launches but no run button and dedug button is active.
As the error message shows you are missing the module named "jedi".
Try to install it before installing the IDE:
pip install jedi
According to Thonny blog, this IDE uses Jedi (autocompletion/static analysis library). So make sure it also installed (via pip, for example).

Incompatible libpng versions when running matplotlib

I'm trying to use facebook research's Detectron. When I run it, it gives me the following error:
libpng warning: Application built with libpng-1.6.21 but running with 1.5.12
Traceback (most recent call last):
File "tools/infer_simple.py", line 147, in <module>
main(args)
File "tools/infer_simple.py", line 139, in main
kp_thresh=2
File "/home/sid/DETECTRON/detectron/lib/utils/vis.py", line 391, in vis_one_image
fig.savefig(os.path.join(output_dir, '{}'.format(output_name)), dpi=dpi)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/figure.py", line 1834, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2267, in print_figure
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2595, in print_pdf
file.finalize()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 595, in finalize
self.writeImages()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 1430, in writeImages
ob.id, smaskObject)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 1416, in _writeImg
self._writePng(data)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 1366, in _writePng
_png.write_png(data, buffer)
RuntimeError: Could not create write struct
I'm running Ubuntu 16.04. I don't know where the application is finding the libpng 1.5.12 version. I could not find it in my system. I installed libpng16-16. It still gives me the same error. I tried out other solutions suggested on the platform but they didn't work
I guess the problem is that you sudo pip installed matplotlib and that the libpng version that is shipped with the manylinux installation package of matplotlib is confused with the libpng version that was installed by apt. I recommend using matplotlib inside a virtual environment.
# create venv
virtualenv ~/matplotlib-venv
# activate venv
source ~/matplotlib-venv/bin/activate
# install matplotlib
pip install matplotlib
pip install <everything else you need>
# run your script
python ~/path/to/your/srcript.py

Is there a JMESPath Terminal for windows 10?

I have installed python 3.5.2 on my windows 10 machine. I also installed JMESPath Terminal by using following command on windows command line:
pip install jmespath-terminal
Everything went smooth and it was successfully installed.
But when I type following:
jpterm
It says that 'jpterm' is not recognized.
Am I missing something or that above pip command only works on non-windows machines only?
TL;DR: this is currently (dec 2017) simply not supported on Windows.
The install is broken. You can get jpterm.py from the project's GitHub page here and pop it into your \pythonXX\Scripts\ folder.
Then you'll get this:
Traceback (most recent call last):
File "C:\Python36\Scripts\jpterm.py", line 239, in <module>
sys.exit(main())
File "C:\Python36\Scripts\jpterm.py", line 228, in main
screen = urwid.raw_display.Screen()
File "C:\Python36\lib\site-packages\Traceback (most recent call last):
File "C:\Python36\Scripts\jpterm.py", line 239, in <module>
sys.exit(main())
File "C:\Python36\Scripts\jpterm.py", line 228, in main
screen = urwid.raw_display.Screen()
File "C:\Python36\lib\site-packages\urwid\raw_display.py", line 85, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined\raw_display.py", line 85, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
**NameError: name 'fcntl' is not defined**
...and looking it up in the urwid project issues (the thing that draws "windows" in the terminal), you'll get this:
https://github.com/urwid/urwid/issues/152
which basically says 'urwid doesn't support Windows'.

Categories