How to find the correct version of PyBindGen for Python Bindings - python-2.7

Currently, I am working on the Ns3 simulator and now trying to enable the pyviz visualizer. According to the doc, I have downloaded the three dependencies which are
py27-pygtk
py27-pygoocanvas
py27-pygraphviz
Now in order to use this, I still need to enable the python bindings which I used /usr/bin/python2.7 ./waf configure wanna to check what needs for enabling python bindings. The result shows that
Python Bindings : not enabled (PyBindGen version not correct and newer version could not be retrieved)
So I checked the Doc and downloaded PyBindGen (version 0.18.0). The output shows
Installed /Library/Python/2.7/site-packages/PyBindGen-0.18.0-py2.7.egg
Processing dependencies for PyBindGen==0.18.0
Finished processing dependencies for PyBindGen==0.18.0
After I ran the configuration check the results still showed that PyBindGen version not correct and newer version could not be retrieved
So I presume that is that because I installed the wrong version of PyBindGen? If so how can I get the suitable version for enabling Python Binding?
I would appreciate if there is someone who can help me figure it out. Many thanks.
S.

According to the Google Group
Here is the resolution(tested it worked):
follow the instruction
hg clone http://code.nsnam.org/ns-3-allinone
cd ns-3-allinone && ./download.py
This will solve the Python Binding problem

Updated: after downloading this version of ns3. Solving the python binding problem. Then there will be another problem after running
./waf configure
it will show the result like this:
PyViz visualizer: not enabled (Missing python modules: gtk, goocanvas, pygraphviz)
Even though I have installed all of the three dependencies. So after some researches I found that there has another questions post So there is a guy gave the guessing that
" Waf found the standard Python here (/usr/bin/python is the Apple path), and you installed the python libraries using MacPorts.
Most probably you'll need to configure Python to point to the MacPort-based Python, or it will not see what you installed."
So according to How to: Macports select python
here is the solution:
port select --list python
sudo port select --set python python27
Hope it will help anyone come afterwards to use this.
S.

Related

How to install Rasa Stack in Windows 10?

Maybe someone else asked the same question too. But this question is difficult. I tried everything. The place I am stuck is with installing dependencies. Some of the dependencies are old and not easily available. But I managed to install them.
The problems lies here.. There are dependencies that need to get the build from their source code. I already installed Visual C++ Build and MSMPI. Also installed HDF5 for H5PY but it doesn't let me build old versions of H5PY. So, I tried installing the latest version of H5PY but still, I am stuck at errors like file not found. Some of the files which the build process cannot find are "h5py/h5f.pyx", "mpi_c", "mpi.h". Solving error for one missing file leads to other and so on..
On trying hard to solve such errors and installing one or the other package to do the same task, I am tired up.. Something I found, at last, was that "mpi_c" file was replaced with some other file in newer versions of MPI4PY. But my dependencies depend on older version. I tried installing an older version of MPI4PY but HDF5 won't let me install that giving other errors. At last, I quit the task with my whole day wasted after this.
So can someone here please provide a step by step guideline for installing Rasa Stack on Windows Machine?
Windows 10 with Python 3.7.. Let me know if I need to downgrade python as well.. It was my first time building some project from source with python on windows. Thanks...
Please try the below steps to install Rasa:
Install Conda
Create a virtual environment:
conda create -n myenv python=3.5
Activate the virtual environment
conda activate myenv
pip install rasa_nlu rasa_core

Installing graph-tool - ubunutu 14.04 - anaconda - jupyter notebook - python 2.7

So I have been trying to install the graph-tool module on my Ubuntu system all day now. I just cant seem to figure it out. Basically I want to use the package in jupyter notebook (in an anaconda enviroment). I followed several installation instructions, but nothing seems to work.
This for example: https://gist.github.com/dlozeve/ed59bba8bc8cb9b21e2af36cc9766938
I get to the configuration (adjusting for the fact that I am using python2.7),
./configure --prefix=/home/timo/anaconda2/envs/graph/ --with-python-module-path=/usr/local/lib/python2.7/site-packages
yielding:
configure: error: *** A compiler with support for C++14 language features is required.
Does anyone know what I might be doing wrong? Or as a simpler way to get graph-tool to work in my jupyter notebook?
Thank you very much!
The configure script is telling you exactly what is wrong: You need a compiler with C++14 support. This just means that your GCC is too old.
(You haven't told us any pertinent detail, such as the compiler version you have, library versions, etc, so we can only guess. But luckily, the configure diagnostics is crystal clear.)
A simpler way to install graph-tool would be for you to upgrade your distro (14.04 is outdated) and use the Ubuntu packages, as described here: https://git.skewed.de/count0/graph-tool/wikis/installation-instructions#debian-ubuntu
As graph-tool does not seems to run in an anaconda environment and Ubuntu 14.04 does not have support the latest C++ compiler that is needed, I did install Ubuntu 16.04 and followed firstly [https://www.google.de/amp/s/www.rosehosting.com/blog/how-to-install-jupyter-on-an-ubuntu-16-04-vps/amp/] and then finally installed graph-tool as described on the homepage.
This way I get to use jupyter notebook and am still able to import graph-tool.

Cannot get started with Vpython

I am a new to python. I am have installed Python27 and Vpython on my windows 64-bit W8.1 laptop.
The python version was Py27 32-bits and Vpython 32-bits. After installation I thought I could directly run an example program from the VIDLE (File -> Open -> bounce). But I realized there is lot more to install to get this working.
So I googled the errors and found that I has to install Numpy and WxPython which I was able to complete successfully. But now I have this error shown below
"The Polygon module is not installed,
so the text and extrusion objects are unavailable.
The ttfquery and/or FontTools modules are not installed,
so the text object is unavailable."
I googled for this but was not able to arrive at anything.
Should I install Polygon module, FontTools and ttfquery module?
I was not able to fond a proper link to do any of the above. Kindly help me out. I have a hit a wall.
Thanks!!
Hopefully was able to solve the issue.
The problem was with the way how I installed Vpython. I should have accidentally selected "custom installation" instead of "full installation".
Also the version of numpy that comes with default set-up did not support for me. Hence I used the pip to update the version and now everything is up and running.
I am able to get the example programs to work.
Also the 64-bit version is not working still. So its always safe to stick on to 32-bit version even if your machine is 64-bit
You're working with an older version of VPython that is no longer supported. See the first page of vpython.org.

Python version settings

I work on Ubuntu with Wingware Python IDE. The version, which we use by our projects is 2.7.X
This morning I updated the IDE, and it became a version >3.x.x
Now I want to install the old version 2.7.3, after I read TFM and try to define PYTHONPATH, I check my Python version on Ubuntu with the command:
python --version
and got the answer 2.7.3. Now I can not understand, why I have version 3.x.x in Wingware and how exactly (the import file is not clear) I can change my version after setting Python manually described here
Actually: It depends on wingware, because I can execute Python 2.7.3 in IPython and in console.
EDIT: I solved this problem myself. Here's my solution:
Following the manual:
Use Python - Executable
Use Interpreter to find right path (in my way it was /usr/bin/python3.2)
Go in /usr/bin/
Select right Python version. This path has ALL Python versions, you should just select the right one
I solve this problem someself. I post now my solution for other people.
After [manual][2] using:
Use Python - Executable
Use Interpreter to find right path (in my way it was /usr/bin/python3.2)
Go in /usr/bin/
Select right python version. This path has ALL Python version, you should just select the right one

Install Spatialite for python (GeoDjango) on OS X

I am tearing my hair out trying to install Spatialite for GeoDjango!
I am already using Homebrew, it's generally easy and convenient so I initially tried to follow the Homebrew instructions for GeoDjango.
But this stops short of installing any database, i.e. Spatialite. The next step is to try and install Spatialite itself, but there are no Homebrew-specific instructions provided by Django docs.
I found this tutorial which looks perfect - a Homebrew and virtualenv-friendly install of Spatialite for GeoDjango.
But it doesn't work... it appears that my pysqlite is linked against the non-spatial-enabled version of SQLite that comes with OS X, rather than the Spatial-ised one I installed from Homebrew, I get this error when Django tried to connect to the db:
"The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite."
The author of pysqlite hasn't responded to my pleas for help on Github and I haven't found anything via Google.
So I went back to the drawing board and decided to follow the "Mac OS X-specific instructions" in the GeoDjango docs... by installing the various geo libs from the KyngChaos binary packages.
The docs say "Install the packages in the order they are listed above" but I found I couldn't install UnixImageIO without installing PROJ first. The link in the docs to download Spatialite binaries (http://www.gaia-gis.it/spatialite-2.3.1/binaries.html) is broken so I used the "Spatialite Tools v4.1" from KyngChaos instead.
Proceeding to the next step I get this error:
$ spatialite geodjango.db "SELECT InitSpatialMetaData();"
SQLite header and source version mismatch
2013-10-17 12:57:35 c78be6d786c19073b3a6730dfe3fb1be54f5657a
2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef
Not really sure what's wrong at this point.
There is someone else here on SO who has gone the KyngChaos route and just ends up with the same "Both SQLite and pysqlite must be configured to allow the loading of extensions" error I got from the Homebrew route anyway.
I found this ticket #17756 for adding pyspatialite support to Django - pyspatialite is supposed to be an easier way to pip install everything but unfortunately it doesn't work either (see comments towards bottom of ticket).
I'm a bit reluctant to start trying to build everything from source by hand as it seems likely I'll just run into the same problems again, but spending hours Googling for info about cryptic compiler errors, magic flags and paths etc along the way.
I'm about ready to give up and just use Postgres/PostGIS.
I was able to get this working now, using the tip here:
https://github.com/ghaering/pysqlite/issues/60#issuecomment-50345210
I'm not sure if it was using the real paths that fixed it, or just the Homebrew kegs or underlying packages have been updated and now install cleanly. Still, it works now.
I reproduce below the steps I took:
brew update
brew install sqlite # 3.8.5
brew install libspatialite # 4.2.0
brew install spatialite-tools # 4.1.1
git clone https://github.com/ghaering/pysqlite.git
cd pysqlite
(where brew reported I had existing versions I unlinked them and installed the latest as commented above)
then edited setup.cfg to comment out #define=SQLITE_OMIT_LOAD_EXTENSION and specify the paths:
include_dirs=/usr/local/opt/sqlite/include
library_dirs=/usr/local/opt/sqlite/lib
activated the virtualenv where I want it installed, then
python setup.py build
python setup.py install
(build_static still fails with clang: error: no such file or directory: 'sqlite3.c')
(maybe I should have done pip install . as suggested in the github issue)
now the spatialite geodjango.db "SELECT InitSpatialMetaData();" succeeds, albeit with an ignorable error:
InitSpatiaMetaData() error:"table spatial_ref_sys already exists"
i.e. it's probably not even necessary to run that command
When I was istalling this i follow this instructions https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/spatialite/#pysqlite2
pysqlite2
If you’ve decided to use a newer version of pysqlite2 instead of the sqlite3 Python stdlib module, then you need to make sure it can load external extensions (i.e. the required enable_load_extension method is available so SpatiaLite can be loaded).
This might involve building it yourself. For this, download pysqlite2 2.6, and untar:
$ wget https://pypi.python.org/packages/source/p/pysqlite/pysqlite-2.6.3.tar.gz
$ tar xzf pysqlite-2.6.3.tar.gz
$ cd pysqlite-2.6.3
Next, use a text editor (e.g., emacs or vi) to edit the setup.cfg file to look like the following:
[build_ext]
#define=
include_dirs=/usr/local/include
library_dirs=/usr/local/lib
libraries=sqlite3
#define=SQLITE_OMIT_LOAD_EXTENSION
I had the same error: SQLite header and source version mismatch.
For me it was enough to update libsqlite3-dev.
After that invoking $ spatialite geo.db "SELECT InitSpatialMetaData();" creates proper database.