I am trying to install pygraphviz but received the following error - networkx

I am trying to install pygraphviz, I tried to do so with the following command but unfortunately it is not working. Can anyone help how to fix it?
C:\Python27\Lib\site-packages\pygraphviz-1.2>python setup.py build -c mingw32
library_path=c:\Program Files (x86)\Graphviz 2.28\bin
include_path=c:\Program Files (x86)\Graphviz 2.28\include\graphviz
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\pygraphviz
copying pygraphviz\agraph.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\graphviz.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\release.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\version.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\__init__.py -> build\lib.win32-2.7\pygraphviz
creating build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\__init__.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\attributes.txt -> build\lib.win32-2.7\pygraphviz\test
copying pygraphviz\tests\graph.txt -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\layout_draw.txt -> build\lib.win32-2.7\pygraphviz\tes
copying pygraphviz\tests\unicode.txt -> build\lib.win32-2.7\pygraphviz\tests
running build_ext
building 'pygraphviz._graphviz' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\pygraphviz
gcc -mno-cygwin -mdll -O -Wall "-Ic:\Program Files (x86)\Graphviz 2.28\include
raphviz" -Ic:\python27\include -Ic:\python27\PC -c pygraphviz/graphviz_wrap.c
build\temp.win32-2.7\Release\pygraphviz\graphviz_wrap.o
error: command 'gcc' failed: No such file or directory

Missing gcc C compiler? There are some tips for compiling PyGraphviz with Windows at Installing PygraphViz on Windows, Python 2.6

Related

Pygobject build fails

I am trying to install Pygobject on my 64-bit Ubuntu 16.04 by following instructions given here: https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html
It recommends using jhbuild to build pygobject. So I install jhbuild (something I've never seen before following instructions given here: https://developer.gnome.org/jhbuild/unstable/getting-started.html.en) which worked out fine.
Initially I had to run jhbuild sysdeps --install to install missing dependencies which took a LONG time. After it was done it said Nothing to install which I presume means it found everything it needed.
Then the
jhbuild bootstrap command said *** success *** [1/1]. OK.
The jhbuild sanitycheck gives no output, (supposedly) meaning all is well.
Then, I run the command jhbuild build pygobject and get error:
Checking if "C_IN in public headers (no arpa/nameser_compat.h needed)"
compiles: NO
Checking if "arpa/nameser_compat.h needed for C_IN" compiles: NO
gio/meson.build:35:6: ERROR: Problem encountered: Could not find
required includes for ARPA C_IN
A full log can be found at
/home/anshulvj/.cache/jhbuild/build/glib/meson-logs/meson-log.txt
*** Error during phase configure of glib: ########## Error running
meson --prefix /home/anshulvj/jhbuild/install --libdir lib -
Dlibmount=false --buildtype=debugoptimized -Dgtk_doc=false
/home/anshulvj/jhbuild/checkout/glib *** [6/10]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
choice:
Doesn't matter what I choose, it either ends the build or gives errors like the following, if I choose [2]:
*** Building glib *** [6/10]
ninja
ninja: error: loading 'build.ninja': No such file or directory
*** Error during phase build of glib: ########## Error running ninja
*** [6/10]
.
.
.
and then
configure: error: Package requirements (glib-2.0 >= 2.57.1) were not met:
Requested 'glib-2.0 >= 2.57.1' but version of GLib is 2.48.2
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
*** Error during phase configure of gobject-introspection: ########## Error running /home/anshulvj/jhbuild/checkout/gobject-introspection/autogen.sh --prefix /home/anshulvj/jhbuild/install --disable-Werror --with-python=python3 --disable-static --disable-gtk-doc *** [9/10]
Which is weird because I cannot find anything related to installing glib2.57 or greater online. (https://github.com/GNOME/glib)
The documentation at https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html does not deal with these errors and I'm completely lost. I googled a lot but did not find anyone who was facing the same issue. If this does not work I'm going to give up on Python3+GTK3+.
Any help/pointers are appreciated.
EDIT: Today I tried installing based on instructions given here https://pygobject.readthedocs.io/en/latest/getting_started.html using pip. It doesn't matter if I use pip or pip3 I get the following error.
(venv) anshulvj#anshulvj-HP-ZBook-15-G3:~/IRS2-415-Python$ pip3 install pygobject
Collecting pygobject
Using cached https://files.pythonhosted.org/packages/e0/e8/1e4f21800015a9ca153969e85fc29f7962f8f82fc5dbc1ecbdeb9dc54c75/PyGObject-3.28.3.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in ./venv/lib/python3.6/site-packages (from pygobject) (1.17.1)
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
Complete output from command /home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.6/pygtkcompat
creating build/lib.linux-x86_64-3.6/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.6/gi
copying gi/module.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.6/gi
copying gi/types.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.6/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.6/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.6/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.6/gi
creating build/lib.linux-x86_64-3.6/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.6/gi/repository
creating build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.6/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 840, in <module>
main()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 835, in main
zip_safe=False,
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/setuptools-28.8.0-py3.6.egg/setuptools/command/install.py", line 61, in run
File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 684, in run
self._setup_extensions()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 680, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 665, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 582, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 532, in find_new_api
import cairo
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
Command "/home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject" failed with error code 1 in /tmp/pip-install-kikh0jeu/pygobject/
Could not find much about
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
online. Any help is appreciated.

How to use wxWidgets on eclipse under Ubuntu

I am using ubuntu 15.04 under VMware Player.
I have eclipse 3.8.1 and wxWidgets 3.0.
I have installed wxWidgets by:
sudo apt-get install libwxbase3.0-0-unofficial libwxbase3.0-dev libwxgtk3.0-0-unofficial libwxgtk3.0-dev wx3.0-headers wx-common libwxbase3.0-dbg libwxgtk3.0-dbg wx3.0-i18n wx3.0-examples wx3.0-doc
I open a new c++ project with the following setting:
Project -> Properties -> C/C++ Build -> Settings -> Cross G++ Compiler -> Miscellaneous -> Other flags -> append "`wx-config --cxxflags`"
Project -> Properties -> C/C++ Build -> Settings -> Cross G++ Linker -> Miscellaneous -> Linker flags -> append "`wx-config --libs`"
Project -> Properties -> C/C++ Build -> Settings -> Cross G++ Compiler -> Includes -> add "/usr/include/wx-3.0-unofficial/"
I then copy the example from here. The problem is that those declaration of the variables defined by wxWidgets did not found. Anyone knows how to solve it?

Can't run Celery with Jython 2.7.0 - no module named multiprocessing

The celery documentation states that I should be able to run it with Jython. Unfortunately I just can't get it to work. Here's the error that I get when I try to run it:
Traceback (most recent call last):
File "/home/linoor/jython2.7.0/bin/celery", line 11, in
sys.exit(main())
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/__main__.py", line 29, in main
from celery.bin.celery import main
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/bin/__init__.py", line 3, in
from .base import Option
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/bin/base.py", line 86, in
from celery import VERSION_BANNER, Celery, maybe_patch_concurrency
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/five.py", line 307, in __getattr__
module = __import__(self._object_origins[name], None, None, [name])
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/app/__init__.py", line 14, in
from celery import _state
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/_state.py", line 20, in
from celery.utils.threads import LocalStack
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/utils/__init__.py", line 27, in
from celery.exceptions import CPendingDeprecationWarning, CDeprecationWarning
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/exceptions.py", line 15, in
from billiard.exceptions import ( # noqa
File "/home/linoor/jython2.7.0/Lib/site-packages/billiard/__init__.py", line 60, in
from .process import Process, current_process, active_children
File "/home/linoor/jython2.7.0/Lib/site-packages/billiard/process.py", line 25, in
from multiprocessing import process as _mproc
ImportError: No module named multiprocessing
So I tried installing multiprocessing, but then this happened:
Downloading/unpacking multiprocessing
Downloading multiprocessing-2.6.2.1.tar.gz (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_linoor/multiprocessing/setup.py) egg_info for package multiprocessing
Installing collected packages: multiprocessing
Running setup.py install for multiprocessing
building 'multiprocessing._multiprocessing' extension
error: Compiling extensions is not supported on Jython
Complete output from command /home/linoor/jython2.7.0/bin/jython -c "import setuptools, tokenize;__file__='/tmp/pip_build_linoor/multiprocessing/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EnQW3c-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.java1.7.0_79-2.7
creating build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/queues.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/tests.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/sharedctypes.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/synchronize.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/heap.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/pool.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/connection.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/util.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/process.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/reduction.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/managers.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/forking.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/patch.py -> build/lib.java1.7.0_79-2.7/multiprocessing
creating build/lib.java1.7.0_79-2.7/multiprocessing/dummy
copying Lib/multiprocessing/dummy/connection.py -> build/lib.java1.7.0_79-2.7/multiprocessing/dummy
copying Lib/multiprocessing/dummy/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing/dummy
creating build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_benchmarks.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_synchronize.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_workers.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_newtype.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_distributing.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_webserver.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_pool.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
running build_ext
building 'multiprocessing._multiprocessing' extension
error: Compiling extensions is not supported on Jython
From what I read it's not possible to use the package multiprocessing in Jython because it requires C extensions (link to SO question).
So is it at all possible to run celery with Jython after all?
Thanks!
There is a discussion here: https://github.com/celery/celery/issues/96 about running celery on jython using threads instead of multiprocessing

netbeans cannot open shared library during RUN comm

everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:
dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared
libraries: libcudart.so.5.0: cannot open shared object file: No such
file or directory
RUN FAILED (exit value 127, total time: 191ms)
the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error.
I was able to run it few minutes ago, what might happened?
I have added file my_lib to ld.so.conf.d containing such text:
/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64
can it be a link issue libcudart.so.5.0 -> licudart.so?
there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib)
why it complains about .so.5.0? mayve link like:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
is necessary
it is related to link to shared library I think
root#comp:# echo $LD_LIBRARY_PATH
/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib
isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing.
the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always
add to the Project -> Properties -> Run -> Environment
Name: LD_LIBRARY_PATH
Value:
$LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
Thank you all. I don't know what happened before as it worked just fine.

Why is Eclipse ignoring my Cross GCC tool prefix?

I am attempting to build a sample project using the ARM Embedded GCC toolchain; for this, I am using Eclipse's internal builder.
In the settings, Project Properties -> C/C++ Build -> Settings -> Tool Settings -> Cross Settings, Prefix is set to arm-none-eabi- and Path is set to the path of the ARM toolchain (C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2012q4\bin).
When I attempt to build the project, I get something that looks like this:
17:58:13 **** Incremental Build of configuration Debug for project template_test ****
Info: Internal Builder is used for build
gcc -IC:/foo/Libraries/STM32F0xx_StdPeriph_Driver/inc -IC:/foo/Libraries/CMSIS/Device/ST/STM32F0xx/Include -IC:/foo/Libraries/CMSIS/Include -O0 -g3 -Wall -c -fmessage-length=0 -o "Libraries\\STM32F0xx_StdPeriph_Driver\\src\\stm32f0xx_adc.o" "..\\Libraries\\STM32F0xx_StdPeriph_Driver\\src\\stm32f0xx_adc.c"
Cannot run program "gcc": Launching failed
... and then an error about how gcc is not found in my path. Which, of course, it is not. There is in my path, however, an arm-none-eabi-gcc.exe, but for some reason, Eclipse is not inclined to run that one.
Why not?
I have discovered that if I change the "Command" for "Cross GCC Compiler" (Project Properties -> C/C++ Build -> Settings -> Tool Settings -> Cross GCC Compiler -> Command) to "gc" (from "gcc") then Eclipse attempts to run "arm-none-eabi-gc" instead of "gc". I feel like that's an important clue, but I don't understand it.
Its looks like an update problem. When I include the prefix in the command, it then tried to use the prefix twice. I removed the prefix from the command and now it works as intended.
I had a similar problem. I added the path to the prefix and it seemed to work. You could also try using a short windows file path: c:/Progra~2/ ...