Unable to locate package python-gnomedesktop: Installing PyViz in ns3 - python

I am following the commands here to install PyViz.
I get the error:
~$ sudo apt-get install python-gnome2-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-gnome2-desktop is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python-wnck:i386 python-rsvg:i386 python-gnomekeyring:i386 python-wnck python-rsvg python-gnomekeyring
E: Package 'python-gnome2-desktop' has no installation candidate
I tried to search the solutions for the problem but all give the same error.
I have Ubuntu 15.04.

It is just python-gnome2:
python-gnome2
You can see with an apt-cache search:
$apt-cache search python-gnome2
python-gnome2 - Python bindings for the GNOME desktop environment
python-gnome2-desktop-dev - Python bindings for the GNOME desktop environment
python-gnome2-dev - Python bindings for the GNOME desktop environment - development files
python-gnome2-doc - Python bindings for the GNOME desktop environment
You actually need to install python-gnome2-desktop-dev, python-gnomedesktop will be installed with the dev package.
python-gnomedesktop (>= 2.32.0+dfsg-1)
Python bindings for the GNOME desktop library

Related

TortoiseHg (Mercurial) can not find hggit extension

I'm trying to get the hg-git extension to work with TortoiseHg (v5.8 on Win10). I have enabled the "hggit" extension in the settings. But when I try to push to github I get an error:
*** failed to import extension hggit: No module named hggit
Searching my drives I only have on hg executable in the TortoiseHg directory but can not find any hggit or hg-git binaries. Is there something else one have to do to get the extension working?
UPDATE - a beta release of THG 6.1.2 apparently has restored hggit and is available now:
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5752#note_185806
I haven't tried it yet myself.
That post also notes:
The plan is for a py3 installer to be available with the next major
release [in July 2022]
Original answer:
Apparently at the moment THG has the option to include hggit in the settings, but does not actually package hggit itself.
According to Matt Harbison, one of the contributors/maintainers of TortoiseHG:
I took [hggit] out because it was always lagging behind changes in core hg,
and its dependencies broke stuff.
He goes on to add:
install by simply running py -2 -m pip install hg-git --user if you
have python2 installed on your system.
Another person (Aurélien Campéas) states the following for using Python 3:
with python 3 and a plain "pip install mercurial hg-git" and it just
works
Further, this other post by Keith Turkowski describes a full installation of THG and hggit with Python3 on Windows:
Install python-3.9.2-amd64.exe (if you want to use Python 3 and have Python.exe in the path)
Install putty-0.74-installer.msi (for SSH support)
Install tortoisehg-5.7.0-x64.msi
Install python-2.7.18.amd64.msi (For current user, Python.exe not in path)
Win+R -> cmd (command prompt): py -2 -m pip install hg-git --user
Enable hggit in TortoiseHg Settings (Extensions)
I assume you could use newer versions of the THG, Python, etc. installers.

GDAL libraries, who does what

I'm struggling installing GDAL on ubuntu 16.04 to work with GeoDjango (Django 2.1, python3), so I need to understand what I'm actually installing.
What is the rôle of each library/package/module ?
apt
gdal-bin (A 'C' library containing the actual functions ?)
python-gdal (The same in python, or just some kind of bridge ?)
python3-gdal (see above, but for python3. Does it need python-gdal ?)
pip
gdal
pygdal
What is the link between pip modules and apt packages here ?
Every piece of info is available, if one is willing to search for it.
DEBs (installed system-wide):
gdal-bin ([Ubtu]: Package: gdal-bin) - a collection of gdal related binaries (tools and utilities)
python3-gdal ([Ubtu]: Package: python3-gdal) - Python 3 bindings, extensions (.sos) and some wrapper scripts, which enable gdal usage from Python
python-gdal - the same thing, but for Python 2 (totally unrelated to previous item)
WHLs (installed as Python modules to the interpreter used to launch pip):
GDAL ([PyPI]: GDAL) - the sources (.tar.gz) for #2. (and / or #3.). During pip install phase, they are built and installed for current Python
pygdal ([PyPI]: pygdal) - same thing (but for VEnv?) as previous item. It seems to be a lighter version (it doesn't contain the scripts)
But, all of the above depend on libgdal ([Ubtu]: Package: libgdal1i), which is the gdal library.

Install Freeimage plugin in Starcluster

How can I install the Freeimage library in a Starcluster cluster so that it can be used with the scikit-image module?
I set up a cluster on AWS using Starcluster and I want to run some script that requires loading .jp2 images with the scikit-image module, which can be done with the Freeimage library. The command to do this is:
skimage.io.imread("path/to/image.jp2", plugin='freeimage). This works when I run it on my machine.
I have installed the scikit-image in my cluster using the Python packages plugin in the Starcluster config file as indicated in the Starcluster documentation:
[plugin pypackages]
setup_class = starcluster.plugins.pypkginstaller.PyPkgInstaller
packages = networkx, scikit-learn, scikit-image
I also installed the following packages into my cluster following the instructions in the documentation
[plugin pkginstaller]
SETUP_CLASS = starcluster.plugins.pkginstaller.PackageInstaller
PACKAGES = libfreeimage3, libfreeimage-dev
But when I run skimage.io.imread("path/to/image.jp2", plugin='freeimage) in the cluster I get the following error message:
RuntimeError: Could not find a FreeImage library in any of:
/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins
/lib
/usr/lib
/usr/local/lib
/usr/lib
I am using OS X.
I was able to solve this by updating the Ubuntu installation on the Starcluster AMI to Ubuntu 14.04.
The problem was that Starcluster's AMIs are currently using Ubuntu 13 which, apparently is no longer supported. This means that installing packages through apt-get no longer works.
I was able to create an AMI with Ubuntu 14.04 following the instructions in the following video: https://www.youtube.com/watch?v=2RBupgpi_ec. Once I did that I was able to install libfreeimage3 and libfreeimage-dev as described in the question without problems.

Enthought Canopy Psycopg2 Install

I'm running into problems installing Psycopg2 using the package manager of Enthought Canopy. I get an error that says the following:
Action: install Psycopg2Database-0.2.0-1.egg
The package manager has encountered error
Loop in dependency graph
[u'DatabasePipe-2.2.1-1.egg', u'PipeStack-0.5.3-1.egg', u'Psycopg2Database-0.2.0-1.egg', u'SQLite3Database-0.2.0-1.egg']
I tried installing the packages listed in the error message, but they also don't install either. Seems like there is something messed up in the dependencies. I have tried installing both under Mac OS and Win 7, same error.
The Psycopg2Database package is not in the Canopy / EPD repository.
Rather, it is in the "Community" (PyPi mirror) repo (marked by the "PyPI" logo in the Package Manager), which contains 11,000 untested ("as is") packages. Most of the packages are current and we are in the process of updating the rest, as well as keeping it updated from now on. Please note that we do not test for nor necessarily provide dependencies.
Meanwhile, this may help:
"Installing external packages into Canopy Python"

Installing gevent in virtualenv

I am just starting with virtualenv, but I am trying to install gevent within a virtualenv environment (I am running Windows). When I use PIP from virtualenv, I get this error:
MyEnv>pip install gevent
Downloading/unpacking gevent
Running setup.py egg_info for package gevent
Please provide path to libevent source with --libevent DIR
The package index has MSIs and EXEs for installing on Windows (http://pypi.python.org/pypi/gevent/0.13.7), but I don't know how to install those into a virtualenv environment (or if that is even possible). When I try pip install gevent-0.13.7.win32-py2.7.exe from the virtualenv promp, I get an error as well:
ValueError: ('Expected version spec in', 'D:\\Downloads\\gevent-0.13.7.win32-py2.7.exe', 'at', ':\\Downloads\\gevent-0.13.7.win32-py2.7.exe')
Does someone know how to do this?
Pip doesn't support installing binary packages, yet. If you want to install from binary package you have to use easy_install - easy_install gevent-0.13.7.win32-py2.7.exe
Microsoft Windows XP [Wersja 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
Z:\>virtualenv z:\venv\gevent-install
New python executable in z:\venv\gevent-install\Scripts\python.exe
Installing distribute..................................................................................................
............................................................................................done.
Installing pip.................done.
Z:\>venv\gevent-install\Scripts\activate
(gevent-install) Z:\>easy_install c:\python\packages\gevent-0.13.7.win32-py2.7.exe
Processing gevent-0.13.7.win32-py2.7.exe
creating 'c:\docume~1\pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg' and adding 'c:\docume~1
pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg.tmp' to it
creating z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Extracting gevent-0.13.7-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding gevent 0.13.7 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Processing dependencies for gevent==0.13.7
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading https://github.com/python-greenlet/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.3.4-py2.7-win32.egg#md5=9941aa246358c586bb274812e
130629
Processing greenlet-0.3.4-py2.7-win32.egg
creating z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Extracting greenlet-0.3.4-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding greenlet 0.3.4 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Finished processing dependencies for gevent==0.13.7
(gevent-install) Z:\>
See Can I install Python windows packages into virtualenvs? Another option is to install from source and you can do this with pip but this requires setting up compiler and environment which is much harder than the simple command above.
From the error message, it would appear you need libevent source code. I would imagine you need to go a step further and compile/install libevent system-wide so pip can find it.
I would start by downloading the latest stable source from http://libevent.org/.
Compile and install it using instructions in the README: https://github.com/libevent/libevent#readme
To compile it on Windows, you'll need to use GNU-style build utilities like make and autoconf. I recommend http://www.mingw.org/.
Once you've installed libevent system-wide, I imagine pip will find it and proceed with gevent installation.
In the msi for gevent-0.13.7 there's an option to select an alternate installation point. point it to the root dir of your particular virtual environment (just above where /Lib and /Scripts are located). That should install it correctly.
You also need to make sure greenlets are installed. For that you can use Piotr's suggested method with easy_install on the .exe.

Categories