Estou usando uv
o Python como meu gerenciador de pacotes e tenho o seguinte comando para instalar um pacote com pip
:
$ pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" \
--install-option="--library-path=/usr/lib/graphviz"
Minha versão uv é 0.6.14
, e a versão Python é 3.10
.
Como posso obter a mesma instalação em uv
?
O que eu tentei
uv adicionar pacote
$ uv add pygraphviz
Saída
× Failed to build `pygraphviz==1.14` ├─▶ The build backend returned an error ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1) [stdout] running bdist_wheel running build running build_py ... gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall - fPIC -DSWIG_PYTHON_STRICT_BYTE_CHAR -I/root/.cache/uv/builds- v0/.tmpgLYPe0/include -I/usr/local/include/python3.12 -c pygraphviz/graphviz_wrap.c -o build/temp.linux-x86_64-cpython-312/pygraphviz/graphviz_wrap.o [stderr] ... pygraphviz/graphviz_wrap.c:9: warning: "SWIG_PYTHON_STRICT_BYTE_CHAR" redefined 9 | #define SWIG_PYTHON_STRICT_BYTE_CHAR | <command-line>: note: this is the location of the previous definition pygraphviz/graphviz_wrap.c:3023:10: fatal error: graphviz/cgraph.h: No such file or directory 3023 | #include "graphviz/cgraph.h" | ^~~~~~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 hint: This error likely indicates that you need to install a library that provides "graphviz/cgraph.h" for `[email protected]`
A postagem sugere a instalação
libgraphviz-dev
em todo o sistema, mas essa não é uma opção para mim devido a restrições de permissão. Por isso, preciso saber como especificar o caminho da biblioteca para poder colocar os arquivos necessários em um diretório ao qual tenho acesso.comando pip compatível com uv
$ uv pip install pygraphviz --install-option="--include-path=/myfolder/include/graphviz" \ --install-option="--library-path=/myfolder/lib/graphviz"
Saída
Output: error: unexpected argument '--install-option' found tip: a similar argument exists: '--reinstall' Usage: uv pip install --reinstall <PACKAGE|--requirements <REQUIREMENTS>|--editable <EDITABLE>|--group <GROUP>> For more information, try '--help'.