Cannot install erdpy on macOS - failed building wheel for pynacl - macos

I'm trying to install erdpy on a macOS by following the official guide, I successfully managed to download erdpy-up and when I run it, I receive the following error:
File "/opt/homebrew/Cellar/python#3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 161, in run
raise Exception("ERROR: The 'make' utility is missing from PATH")
Exception: ERROR: The 'make' utility is missing from PATH
----------------------------------------
ERROR: Failed building wheel for pynacl
Failed to build pynacl
ERROR: Could not build wheels for pynacl which use PEP 517 and cannot be installed directly
CRITICAL:installer:Could not install erdpy.
Right before that, I see:
Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pycryptodomex, since package 'wheel' is not installed.
Building wheels for collected packages: pynacl
Building wheel for pynacl (PEP 517) ... error
Tried to install libsodium using brew but erdpy installation still failed.
Is there another way to install / build it?

I have make installed on my system. The log message is not very clear, but in the end I figured out how I can install erdpy on my Mac.
First I installed libsodium:
brew install libsodium
and then I installed erdpy using pip3:
pip3 install --user --upgrade --no-cache-dir erdpy
Then erdpy -v returns
erdpy 1.0.18

Your error says you don't have the make utility installed.
Install it by executing
brew install make
in your terminal. Then retry the installation.

You could also activate the virtualenv with source ~/elrondsdk/erdpy-activateand then use pip3 install --upgrade --no-cache-dir erdpy.

If you have the M1 processor, it won't install on Mac. You will have to remote connect to a linux system. VS code has the ability to do this, or you could use parallels and run a linux VM locally.

Related

ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects

I want to install mpi4py.
The installation fails with the error below.
Please share the solution to the same error.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python -m pip install --upgrade pip
I installed pyproject-toml with "pip install pyproject-toml".
But mpi4py still won't install.
My python version is Python 3.8.0.
The following worked for me:
sudo apt update
sudo apt-get install libopenmpi-dev
It seems that related packages are twisted.
Installed by following the steps below.
apt --fix-broken install
apt install mpich
pip install mpi4py
For me it worked when I used sudo before:
sudo pip install mpi4py
I had the same error message. I used the Anaconda-Navigator interface and it worked fine.
Another option is to use brew. If OpenMPI isn't a dependency issue for you, the installation worked when I used it as well.
brew install mpi4py

Error installing geopandas in python on mac m1

I'm trying to install geopandas on my M1 mac and I'm running into errors
I tried to pip install all the dependencies individually but where I'm tripping up is in the install of pyproj.
I installed PROJ using brew install proj and that worked fine
When I try to pip install pyproj, I get the follow error
Building wheels for collected packages: pyproj
Building wheel for pyproj (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyproj (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
PROJ_DIR is set, using existing PROJ installation..
running bdist_wheel
running build
running build_py
running build_ext
building 'pyproj._geod' extension
pyproj/_geod.c:704:10: fatal error: 'geodesic.h' file not found
#include "geodesic.h"
^~~~~~~~~~~~
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 pyproj
Failed to build pyproj
ERROR: Could not build wheels for pyproj, which is required to install pyproject.toml-based projects
Any help would be much appreciated
At the moment, installing geopandas on M1 macs can be achieved via conda or pip+homebrew.
GeoPandas itself is written in pure Python, so there is no issue running that on any architecture. However, it depends on other libraries that are written in other languages (C, C++) that need to be compiled specifically for M1 chips. While you could compile it yourself, I am not going to cover this option as it is not user friendly.
There are three possible sources of required libraries - pip wheels, conda-forge, and Homebrew.
When a Python package requires C dependency, it can create wheels with the dependency compiled for each system and chip architecture. See for example pygeos - https://pypi.org/project/pygeos/#files. What you need is *macosx_11_0_arm64.whl . If your package doesn't offer it, you have to find another way of installing than pip. Since GeoPandas requires shapely and fiona (among others) that do not have these wheels, you should look elsewhere - either on conda-forge or Homebrew. Below are both options tested as of today.
Conda and conda-forge way (recommended)
Conda-forge currently has all packages geopandas needs
Install M1 version of miniforge or mambaforge. It can be downloaded from here - https://github.com/conda-forge/miniforge.
conda install -c conda-forge geopandas pygeos
Note: if you install x86 (Intel) version of conda, it will run under Rosetta2 and install all packages using x86 architecture, meaning that everything will run under emulation. Try to avoid that.
Pip and Homebrew way
Homebrew can install C libraries compiled for M1. Python packages will find and use them.
Using an environment with Python 3.9
Install shapely:
brew install geos
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/geos/lib/
pip install shapely
DYLD_LIBRARY_PATH is needed for shapely to find GEOS installation.
Install fiona:
brew install gdal
pip install fiona
Install pyproj:
brew install proj
pip install pyproj
Install geopandas and pygeos for speedups:
pip install pygeos
pip install geopandas
Note that this is a copy&paste of my own explanation given in https://github.com/geopandas/geopandas/issues/1816#issuecomment-1003093329.
Related https://github.com/pyproj4/pyproj/issues/1027
I was stuck with the same problem, I also tried setting the environment values for PROJ_DIR, PROJ_LIBDIR, PROJ_INCDIR but perhaps setting the values is causing the error, so closed the terminal and tried again and was able to install correctly

ERROR:Failed building wheel for h5pyFailed to build h5pyERROR:Could not build wheels for h5py,which is required toinstall pyproject.toml-basedprojects

I'm getting this error when I'm running the following command to install tensorflow.
python3 -m pip install tensorflow-macos
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects
I tired to install this wheel manually, from the official link (https://pypi.org/project/h5py/#files), it got installed properly but I'm still getting the same error.
I'm facing the above issue in Mac Book M1 chip.
The official doc to use brew install.
$ brew install hdf5
If the above command gives you rosetta 2 issue, then run:-
arch -arm64 brew install hdf5
Once, the h5py installation is done, run following 2 commands:-
$ export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.0_4 OR export HDF5_DIR=/opt/homebrew/opt/hdf5 (if hdf5 is installed in the "/opt/homebrew/opt/hdf5" location, you have to check it out first)
$ pip install --no-binary=h5py h5py
Note:- in the first command "1.12.0_4" is the version of hdfc installed in my system, you have to change it according to yours.
If you are getting the aforementioned error implies you must be using poetry.
Finally run:-
poetry install
We are running the above command, In case poetry wants to update anything.
Once we run poetry install, it might update existing libraries or download new libraries.
So we have to update poetry.lock file as well.
poetry lock
After installing hdf5 try "export HDF5_DIR=/opt/homebrew/opt/hdf5"
Ref: https://github.com/h5py/h5py/issues/2035#issuecomment-1028226141
This works for me:
Install brew (https://brew.sh/)
brew install hdf5
export HDF5_DIR=$(brew --prefix hdf5) (as #sgt pepper said)
pip install --no-binary=h5py h5py

RuntimeError: <path> failed executing, please point LLVM_CONFIG to the path for llvm-config

Trying to install llvmlite via pip by running
pip install llvmlite
constantly gives me this error:
RuntimeError: <path> failed executing, please point LLVM_CONFIG to the path for llvm-config
error: command '/Users/sfalk/miniconda3/envs/asr-service/bin/python' failed with exit status 1
----------------------------------------
Now, I am on Python 3.5
$ python --version
Python 3.5.6 :: Anaconda, Inc.
And just running pip install llvmlite will give me this:
RuntimeError: Building llvmlite requires LLVM 7.0.x, 7.1.x or 8.0.x, got '10.0.0'. Be sure to set LLVM_CONFIG to the right executable path.
I installed LLVM 8 via brew
brew install llvm#8
Setting LLVM_CONFIG to either does not work.
/usr/local/opt/llvm#8/bin (were I assumed llvm-config to be), or
/usr/local/opt/llvm#8/Toolchains/LLVM8.0.1.xctoolchain/usr/bin (where I actually found llvm-config to be)
And I keep getting some version of:
RuntimeError: /usr/local/opt/llvm#8/Toolchains/LLVM8.0.1.xctoolchain/usr/bin failed executing, please point LLVM_CONFIG to the path for llvm-config
What am I missing here?
And for those reviewing the post in search for a solution to installing numba, the version released on June 24, 2020 works:
pip install numba==0.50.1
Looks like there is an issue with latest version of llvmlite. Please consider using 0.31.0 version.
>>pip install llvmlite==0.31.0
Collecting llvmlite==0.31.0
Downloading
https://files.pythonhosted.org/packages/10/31/aa315fbc2e0b7777b95ce166b7c988f53e4cdd4c33d06eea24f395539eb4/llvmlite-0.31.0-cp35-cp35m-macosx_10_9_x86_64.whl (15.9MB)
100% |████████████████████████████████| 15.9MB 1.1MB/s
Installing collected packages: llvmlite
Successfully installed llvmlite-0.31.0
You will have to install the required llvm package using and link the executable config
sudo apt install llvm-**X**
and then
sudo pip3 install llvmlite
cd /usr/bin
sudo ln -s llvm-config-**X** llvm-config
This fixed the llvm issue of installing librosa on my raspberry pi (aarch64)
I was facing the same issue.
You will have to install the required llvm package using and link the executable config
sudo apt install llvm-X
and then
sudo pip3 install llvmlite
cd /usr/bin
sudo ln -s llvm-config-X llvm-config
did not work for me but I did notice we had the same output error
RuntimeError: <path> failed executing, please point LLVM_CONFIG to the path for llvm-config
So I thought: "why not point the LLVM_CONFIG to the proper llvm-config?".
And I did this simple fix:
export LLVM_CONFIG=/usr/bin/llvm-config-10

Installing cutadapat package in windows

I'm trying to install a package name cutdapt in a windows server. I'm trying to do it this way:
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org cutadapt
But every time I try to install it I get this error: Building wheel for cutadapt (PEP 517): finished with status 'error'
Any ideas on how to pass this issue?
Turns out, that I had some problems with python 3.5, so I switched to python 3.8 and managed to install the package.

Resources