ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 31 Jan 2019 18:17:25 +0100Sage and pygraphviz helphttps://ask.sagemath.org/question/45248/sage-and-pygraphviz-help/ Hi all!
I am trying to run pygraphviz on Sage8.6 (on Windows 10), but having some troubles.
When I run the Sage Shell as administrator, I can pip install graphviz without any problems. When I try to pip install pygraphviz, however, it comes with the following error message:
> Command
> "/opt/sagemath-8.6/local/bin/python2
> -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ApORib/pygraphviz/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-dJAQAU/install-record.txt
> --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ApORib/pygraphviz/
I have a screenshot of the full error code if that is helpful (but I am not sure how to post it as I do not have enough karma), and there was someone else who posted a similar question, but their solution did not seem to work for me (I would link to it but, again, not enough karma).
Please help!ZainAK283Thu, 31 Jan 2019 18:17:25 +0100https://ask.sagemath.org/question/45248/package pygraphviz Sagemath 8.6 (W10)https://ask.sagemath.org/question/45192/package-pygraphviz-sagemath-86-w10/
Hi
is it possible to use package pygraphviz in Sagemath 8.6 (W10) ?
if yes, how to ?
# Author: Aric Hagberg (hagberg@lanl.gov)
# Copyright (C) 2004-2018 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
# and the following code block is not needed
# but we want to see which module is used and
# if and why it fails
try:
import pygraphviz
from networkx.drawing.nx_agraph import write_dot
print("using package pygraphviz")
except ImportError:
try:
import pydot
from networkx.drawing.nx_pydot import write_dot
print("using package pydot")
except ImportError:
print()
print("Both pygraphviz and pydot were not found ")
print("see https://networkx.github.io/documentation/latest/reference/drawing.html")
print()
raise
G = nx.grid_2d_graph(5, 5) # 5x5 grid
write_dot(G, "grid.dot")
print("Now run: neato -Tps grid.dot >grid.ps")ortolljSat, 26 Jan 2019 20:44:11 +0100https://ask.sagemath.org/question/45192/problem installing pygraphviz in sage 6.2https://ask.sagemath.org/question/24016/problem-installing-pygraphviz-in-sage-62/I'm trying to install the python package pygraphviz in sage 6.2 through the following procedure.
sage -i dot2tex
sage -i graphviz
sage -sh <<< "easy_install --verbose pip"
sage -sh <<< "pip --verbose install pygraphviz"
The first three commands are successful. The last one, however, outputs the following. Any help will be appreciated.
Thanks.
Starting subshell with Sage environment variables set. Don't forget
to exit when you are done. Beware:
* Do not do anything with other copies of Sage on your system.
* Do not use this for installing Sage packages using "sage -i" or for
running "make" at Sage's root directory. These should be done
outside the Sage shell.
Bypassing shell configuration files...
Note: SAGE_ROOT=/home/soft/sage/sage-6.2-i686-Linux
Traceback (most recent call last):
File "/home/soft/sage/sage-6.2-i686-Linux/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/setuptools-2.0.1-py2.7.egg/pkg_resources.py", line 352, in load_entry_point
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/setuptools-2.0.1-py2.7.egg/pkg_resources.py", line 2295, in load_entry_point
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/setuptools-2.0.1-py2.7.egg/pkg_resources.py", line 2009, in load
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 10, in <module>
from pip.util import get_installed_distributions, get_prog
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 15, in <module>
from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 96, in <module>
build_prefix = _get_build_prefix()
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 65, in _get_build_prefix
__get_username())
File "/home/soft/sage/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 60, in __get_username
return pwd.getpwuid(os.geteuid()).pw_name
KeyError: 'getpwuid(): uid not found: 2006'
Exited Sage subshell.
rcSun, 31 Aug 2014 20:04:49 +0200https://ask.sagemath.org/question/24016/