installing openbabel3 with pip - python-3.x

I tried pip install openbabel --log log_file and I got the following error:
Collecting openbabel
Using cached openbabel-2.4.1.tar.gz (74 kB)
Building wheels for collected packages: openbabel
Building wheel for openbabel (setup.py) ... error
ERROR: Failed building wheel for openbabel
Running setup.py clean for openbabel
Failed to build openbabel
Installing collected packages: openbabel
Running setup.py install for openbabel ... error
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/setup.py'"'"'; __file__='"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-record-i_0qytcj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/openbabel Check the logs for full command output.
Here pip is an alias for pip3.
The log file is here (I am not sure if you can read it, this is my first time sharing a file)
note: A few days ago I opened a second user on my computer, I don't know how it affects things but maybe that's the reason.
I am using Mac OS Catalina.

From a quick look at the log file it looks like it wont install as it cant find a version for Mac OS, only for Windows, however the following may be useful as a workaround to that: How to Install openbabel for Python 3.6 on macOS Sierra 10.12.3

So I found a much simpler way than building openbabel manually. brew install openbabel works for openbabel3
Check the link: http://openbabel.org/wiki/Category:Installation

Related

Unable to install fitsne in colab

I am trying to install fitsne in colab. Recommended way for installation is:
conda config --add channels conda-forge #if not already in your channels. Needed for fftw.
conda install cython numpy fftw
pip install fitsne
Yet, I get following error:
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from fitsne) (1.19.5)
Requirement already satisfied: cython in /usr/local/lib/python3.7/dist-packages (from fitsne) (0.29.22)
Building wheels for collected packages: fitsne
Building wheel for fitsne (setup.py) ... error
ERROR: Failed building wheel for fitsne
Running setup.py clean for fitsne
Failed to build fitsne
Installing collected packages: fitsne
Running setup.py install for fitsne ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ezkx1s2e/fitsne/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ezkx1s2e/fitsne/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-uzkyz06_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Can someone please explain how to fix such an error in colab?
I solved it using this gist
!git clone https://github.com/KlugerLab/FIt-SNE.git
!wget http://www.fftw.org/fftw-3.3.8.tar.gz
!tar -xf fftw-3.3.8.tar.gz
!cd fftw-3.3.8
!./fftw-3.3.8/configure
!make
!make install
!g++ -std=c++11 -O3 FIt-SNE/src/sptree.cpp FIt-SNE/src/tsne.cpp FIt-SNE/src/nbodyfft.cpp -o FIt-SNE/bin/fast_tsne -pthread -lfftw3 -lm -Wno-address-of-packed-member
import sys; sys.path.append('FIt-SNE/')
from fast_tsne import fast_tsne

Dagster Installation on MacOS Big Sur

I am trying to install Dagster and Dagit using:python3 -m pip install dagster dagit --user
But, Always when it starts to build wheel for grpcio, it throws an error and stops the installation.
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cb/vkzjvbbn2l5gbb31y3m61d_40000gp/T/pip-install-3005iws8/grpcio/setup.py'"'"'; __file__='"'"'/private/var/folders/cb/vkzjvbbn2l5gbb31y3m61d_40000gp/T/pip-install-3005iws8/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cb/vkzjvbbn2l5gbb31y3m61d_40000gp/T/pip-record-8m4mi_rs/install-record.txt --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
Is anyone using Dagster and Dagit on Mac?
EDIT: I was able to install Dagster by providing the required version in my requirements.txt File.
Upgraded the Pip to the latest version bypython3 -m pip install --user --upgrade pip and then installed Dagster!
It worked.
The main installation steps for Dagster are outlined here: https://docs.dagster.io/getting-started/install#installation - however users with M1 Macs have run into issues recently (early 2023) related to grpcio package installation.
If you encounter that issue, you will need this command:
pip install dagster dagit --find-links=https://github.com/dagster-io/build-grpcio/wiki/Wheels

google buildpack psycopg2-binary Error: pg_config executable not found

This is in my requirements.txt
psycopg2-binary==2.8.3 # via -r requirements/base.in
that I am building inside docker image. I was under impression that if I install psycopg2-binary vs psycopg2 I should not install additional postgresql devel libs. Am I wrong?
pack build --builder=gcr.io/buildpacks/builder:v1 test-python
Collecting psycopg2-binary==2.8.3
Downloading psycopg2-binary-2.8.3.tar.gz (378 kB)
ERROR: Command errored out with exit status 1:
command: /layers/google.python.runtime/python/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z7z_l56l/psycopg2-binary_ddfc5ed05bb44cf4b7e2f14d634bd6ae/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z7z_l56l/psycopg2-binary_ddfc5ed05bb44cf4b7e2f14d634bd6ae/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-vsc_2hlv
cwd: /tmp/pip-install-z7z_l56l/psycopg2-binary_ddfc5ed05bb44cf4b7e2f14d634bd6ae/
Complete output (23 lines):
running egg_info
creating /tmp/pip-pip-egg-info-vsc_2hlv/psycopg2_binary.egg-info
writing /tmp/pip-pip-egg-info-vsc_2hlv/psycopg2_binary.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-vsc_2hlv/psycopg2_binary.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-vsc_2hlv/psycopg2_binary.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-vsc_2hlv/psycopg2_binary.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
No, you are not wrong; I had the same issue today, and after a bit of googling I found this (solved) github issue: https://github.com/psycopg/psycopg2/issues/699#
The comments there (https://github.com/psycopg/psycopg2/issues/699#issuecomment-377188700) indicate one possible cause for the issue is using an outdated version of pip.
I was using version 18.x, and after upgrading it (python -m pip install -U pip, which got me pip 21.1.3), the installation of psycopg2-binary finished successfully (as expected) even though I don't have any postgres dev libraries installed.

Unable to install geopandas on python3.9 on macOS Big Sur

I am trying to install geopandas on the machine described above.
This is what I am doing the error I get:
sudo pip3 install geopandas
Collecting geopandas
Downloading geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
|████████████████████████████████| 962 kB 5.0 MB/s
Collecting fiona
Downloading Fiona-1.8.18.tar.gz (1.3 MB)
|████████████████████████████████| 1.3 MB 4.8 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-fbu0u179/fiona/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-fbu0u179/fiona/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-knmlby9t
cwd: /private/tmp/pip-install-fbu0u179/fiona/
Complete output (2 lines):
Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
GDAL is a required library for Geopandas and it needs to be built and compiled on your system and in your path before you pip install geopandas
If you are using homebrew, you can install it with
brew install gdal
and verify the installation by running
gdal-config --version
One note is that Gdal has a lot of dependencies and will take a bit to install. Using homebrew, it worked for me in one shot but it will likely upgrade a number of prerequisites including GCC and perhaps even python itself.
I should note that this worked for me on Catalina. If you are an M1 Mac with Big Sur every tool in this chain may not be upgradeable to native M1 code at this time and you may need some of the workarounds at How to run the Homebrew installer under Rosetta 2 on M1 Macbook

Can't install scipy to Raspberry pi 4 (raspbian)

I am trying to install the scipy library with python3 -m pip install --user --no-use-pep517 scipy but I am receiving the following error:
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-install-spokr6ic/scipy
I am using that code to install because pip3 install scipy is giving me this error:
ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
How can I resolve this issue?
Python == 3.7.3
PS:The complete traceback is 414 lines. I don't know if I should include here.
Try this:
sudo apt update
sudo apt install -y python3-scipy

Resources