How do I fix this error when trying to install pygraphviz - python

I am trying to install pygraphviz with these commands on Mac m1 Ventura 13.1:
conda install -c anaconda graphviz
brew install gmp
env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install pycddlib
I get this error after running the last line:
In file included from pygraphviz/graphviz_wrap.c:154:
/Users/ismaeelbashir/miniforge3/envs/lnn/include/python3.9/Python.h:25:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
error: command '/opt/homebrew/opt/llvm/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pygraphviz
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I am trying to install a python library inn https://github.com/IBM/LNN/#quickstart. and this commands were on the installation guide.

This error message suggests that there is a problem with the compiler finding the standard C library header file 'stdio.h'.
It seems to be an issue with the python installation environment and the package dependencies. Here are a few steps that you can try to resolve the issue:
Try updating the compiler
conda update clang
Try installing pygraphviz with a different version of Python:
conda create -n newenv python=3.8
conda activate newenv
pip install pygraphviz
3.Try installing pygraphviz without the "CFLAGS" environment variable:
pip install pygraphviz --no-use-pep517
If none of these solutions work, you might want to look into other potential solutions or raise an issue with the library's repository.

Related

Struggling to Install Cartopy

I'm struggling to Install Cartopy from the Terminal and from Pycharm.
This is what I get as error message:
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for Cartopy
ERROR: Could not build wheels for Cartopy, which is required to install pyproject.toml-based projects
Can someone please help with the problem. Thanks
I tried to Update the Pip Install
Here are two solutions since you didn't specify the OS you are using or the full error log.
If on a Linux and the error log is due to geos_c.h is not found.
Install the developer version of the geos library
sudo apt install libgeos-dev
as can be seen from here.
If you are on a mac or windows, you may use conda to install it. find the installation instruction miniconda here then
conda install -c conda-forge cartopy

Gettingerror: legacy-install-failure, while installing basemap

I am trying to install Basemap using pip, however at some point it reaches the error:
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
I do not really know what to do here, and I could not find anyone who encountered the same error. I have tried upgrading pip and setuptools, but they did not seem to help. What should I do?
P.S. I have been trying to install basemap for the past 4 days and I was not very sucessfull. If you know how to install it on MacOS, please hit me up! Thank you!
For Windows:
To install basemap you need to download the wheel file from this path:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
for python 3.10 this will be the file:
basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
Then you have to go to the folder where the above mentioned .whl file is saved and run this command from there:
pip install basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
For Mac OS please refer:
https://github.com/matplotlib/basemap/releases:
Make sure you have:
brew install geos
brew install matplotlib
brew install numpy
brew install proj
Add export GEOS_DIR="/user/local/Cellar/geos/3.10.2/" to your .bash profile and reload it via:
source ~/.bash_profile
git clone --depth 1 https://github.com/matplotlib/basemap.git
then in the basemap/packages/basemap directory
pip3 install
For Google Colab:
!sudo apt-get install libgeos-3.6.2
!sudo apt-get install libgeos-dev
!pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap

installing pandas-profiling error in python 3.10

I am trying to install pandas-profiling in python 3.10 using pychan installation package option. It is giving error. I tried the same using command prompt. Giviing the same error.
Few last lines of error are as below:
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\admin\AppData\Local\Temp\pip-install-j19ut5x7\phik_da8a6ed5567b4ca3b73ac99e2a8c743e\build\lib.win-amd64-3.10\phik\lib']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for phik
ERROR: Could not build wheels for phik, which is required to install pyproject.toml-based projects
Any suggestion to fix this issue.
I have previously encountered the same challenge and I could resolve it by doing the following two steps in exactly this order:
Update setuptools: based on your information provided you are using pip, therefore the command is the following one: pip install --upgrade setuptools
Now run the installation command (as provided by the official documentation: https://pypi.org/project/pandas-profiling/): pip install pandas-profiling
As an alternative, in case you are using Anaconda these two steps will be as follows:
Update setuptools: conda upgrade setuptools
Install pandas-profiling from Anaconda: conda install -c conda-forge pandas-profiling
Hope this helps!

pipx install eth-brownie error : Fatal error from pip prevented installation. Full pip output in file:

Hi I am trying to install Brownie but I seem to run into the below issue.
C:\Users\gmlad>pipx install eth-brownie
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\gmlad\.local\pipx\logs\cmd_2021-12-03_16.35.47_pip_errors.log
pip failed to build packages:
bitarray
cytoolz
lru-dict
multidict
psutil
yarl
Some possibly relevant errors from pip install:
error: command 'cl.exe' failed: None
Error installing eth-brownie.
This is not the eth-brownie problem, but overall pipx issue.
I've got the same error after switching from Python 3.9 to 3.10 on Arch Linux.
This answer solved it, although it's for Windows) Try it out: https://stackoverflow.com/a/70080178/13389142

Installing cvxopt

I have some problems when installing this package
c:\users\user\appdata\local\temp\pycharm-packaging1.tmp\cvxopt\src\c\cvxopt.h(31) : fatal error C1083: Cannot open include file: 'complex.h': No such file or directory error: command
C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
You are using pip version 7.0.1, however version 8.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
Could you help me please?
Thanks in advance.
If you need a solution for using CVXOPT quickly, I would recommend installing the anaconda Python distribution.
It is free and has very good features for installing and managing 3rd party packages.
Download anaconda and follow the installation instructions. Then, you can install CVXOPT with a command like the following.
$ conda install cvxopt
CVXOPT will work along side numpy.

Categories

Resources