Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipx failed to build packages

When I run the command pipx install eth-brownie I receive the following error message,

fatal error from pip prevented installation. Full pip output in file:
    /Users/gentgjonbalaj/.local/pipx/logs/cmd_2021-10-22_11.10.14_pip_errors.log

pip failed to build package:
    cytoolz

Some possibly relevant errors from pip install:
    cytoolz/functoolz.c:23087:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    cytoolz/functoolz.c:23092:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    cytoolz/functoolz.c:23176:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    error: command '/usr/bin/clang' failed with exit code 1

Error installing eth-brownie.

I tried to use the command "pip install eth-brownie" but my terminal says "pip command not found."

like image 317
GentGjonbalaj Avatar asked Oct 22 '21 15:10

GentGjonbalaj


People also ask

Where is PIPX installed?

The default binary location for pipx-installed apps is ~/. local/bin .

What is PIPX?

pipx is a tool to install and run any of these thousands of application-containing packages in a safe, convenient, and reliable way. In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.

How do I fix legacy install failure?

Download Microsoft C++ build tools Another solution to the problem, one that the error message itself will likely suggest is to download and install Microsoft C++ build tools. The download process is rather simple as well, just head over to this website and download the desktop environment with C++.

How do I uninstall PIPX?

Now, if we want to uninstall a Python package we have installed using Pipx we can just type pipx uninstall dadjokes-cli . Furthermore, it is also possible to uninstall all packages by typing pipx uninstall-all .

What is the use of pipx in Python?

Pipx is a tool in Python that allows us to run python packages that have a CLI interface in the global context of your system. It uses its own environment for managing the packages. Here, we will cover its installations, setting up its environment, and how we can uninstall packages.

How do I make my package compatible with pipx?

If you would like to make your package compatible with pipx, all you need to do is add a console scripts entry point. If you're a poetry user, use these instructions. Expose CLI entrypoints of packages ("apps") installed to isolated environments with the install command. This guarantees no dependency conflicts and clean uninstalls!

What is a Python Package Index entry point?

In a way, it turns Python Package Index (PyPI) into a big app store for Python applications. Not all Python packages have entry points, but many do. If you would like to make your package compatible with pipx, all you need to do is add a console scripts entry point.


Video Answer


5 Answers

I received the same error, and was finally able to resolve after running the following commands:

Using Homebrew: brew install recordclass

brew install cython

xcrun codesign --sign - "/Users/jon/Library/Python/3.8/lib/python/site-packages/regex/_regex.cpython-38-darwin.so"

pip3 install cytoolz

pip3 install pybind11

like image 174
JW157 Avatar answered Nov 15 '22 09:11

JW157


M1 Mac Chips has issues. There are issues at 2 fronts. (a) cytoolz, (b) regex==2021.10.8.

(a) cytoolz is resolved by doing pip install cytoolz and not pipx

(b) regex issue is a big one. The issue is with the version. Packaging bug causes an x86_64 regex to be installed on an Apple Silicon (M1) device (https://githubmemory.com/@dragos-vlad). To fix this: Pinning regex to 2021.9.30 should work for the time being. However for that you will have to change the requirements in the brownie git that you will use for installing.

like image 34
AmateurDev Avatar answered Nov 15 '22 09:11

AmateurDev


For anyone using Windows 10 I had the same issue, just had to run:

pip install Cython

then

pip install eth-brownie

For whatever reason I was finally able to install with pip but not with pipx.

like image 23
garo Avatar answered Nov 15 '22 09:11

garo


I have this problem with python 3.10. Try pyenv and use python 3.9.1 and it works.

like image 44
joe Avatar answered Nov 15 '22 10:11

joe


What worked for me in Python 3.10 was installing cython and cytoolz before brownie.

Enter these three commands:

python3 -m pip install --user cython
python3 -m pip install --user cytoolz
python3 -m pip install --user eth-brownie
like image 44
cbusch Avatar answered Nov 15 '22 11:11

cbusch