ERROR installing web3[tester]: Failed building wheel for blake2b-py - python

I'm trying to install the web3 tester with pip install -U web3[tester] but always getting this error.
Pip and setuptools are both on their current version.
The complete error:
Building wheels for collected packages: blake2b-py
Building wheel for blake2b-py (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/tmpigyl8c27
cwd: /private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-install-yu97ljpj/blake2b-py_61e5c1e928bf4c3fa77c17397812b60f
Complete output (20 lines):
Compiling proc-macro2 v1.0.24
Compiling unicode-xid v0.2.1
Compiling syn v1.0.58
Compiling proc-macro-hack v0.5.19
Compiling memchr v2.3.4
Compiling serde_derive v1.0.118
Compiling serde v1.0.118
Compiling ryu v1.0.5
Compiling lazy_static v1.4.0
Compiling serde_json v1.0.61
error: could not compile `ryu`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
πŸ’₯ maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup`
Running `maturin pep517 build-wheel -i python`
Error: Command '['maturin', 'pep517', 'build-wheel', '-i', 'python']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for blake2b-py
Failed to build blake2b-py
ERROR: Could not build wheels for blake2b-py which use PEP 517 and cannot be installed directly
When I run the command again with --verbose I am getting:
error: failed to run custom build command for `pyo3 v0.8.5`
Caused by:
process didn't exit successfully: `/private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-install-ewvt5uxi/blake2b-py_af0db53ab76c4fb48590a7692b7f3b09/target/release/build/pyo3-3ab2c629ff3fb44d/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Error: pyo3 requires a nightly or dev version of Rust.', /Users/Pancake/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.8.5/build.rs:542:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
πŸ’₯ maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup`
Running `maturin pep517 build-wheel -i python`
Error: Command '['maturin', 'pep517', 'build-wheel', '-i', 'python']' returned non-zero exit status 1.
Building wheel for blake2b-py (PEP 517) ... error
ERROR: Failed building wheel for blake2b-py
Failed to build blake2b-py
ERROR: Could not build wheels for blake2b-py which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
return func(self, options, args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 361, in run
raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for blake2b-py which use PEP 517 and cannot be installed directly
Removed build tracker: '/private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-req-tracker-zvzjdf19'

stderr thread 'main' panicked at 'Error: pyo3 requires a nightly or dev version of Rust.'
You have to install a nightly or dev version of Rust (do you have rust installed at all ?)
EDIT
You can install rust nightly on macOS with following commands in the shell:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default nightly

Running:
xcode-select --reset
Did the job for me

Related

Error while trying to install odoo15 requirements.txt on M1

I am trying to install the requirements for odoo15 on my MBP M1 Pro running MacOS Ventura 13.0 in my virtual environment running python 3.10.8
but I keep getting the following error:
build/temp.macosx-12-arm64-cpython-310/_openssl.c:575:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.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 cryptography
Building wheel for psycopg2 (setup.py) ... error
error: subprocess-exited-with-error
...
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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 psycopg2
Running setup.py clean for psycopg2
...
Failed to build cryptography psycopg2
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
Now, I have already spent a lot of time researching and it seems that openssl might be the problem here
I have already install openssl via brew, it is running the newest version, as suggested in this GitHub issue
I have installed the newest version of pip as suggested in this StackOverflow post
Edit: I have now also tried setting these flags as suggested in this StackOverflow post:
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
I have also retried everything in another venv using Python version 3.8

Unable to install Aerospike pip package | Macbook M1 chip

I am trying to install aerospike in my virtualenv by using below command
pip install aerospike==5.0.0
but it is unable to install. It is throwing below error
Collecting aerospike==5.0.0
Using cached aerospike-5.0.0.tar.gz (182 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: aerospike
Building wheel for aerospike (setup.py) ... error
error: subprocess-exited-with-error
Γ— python setup.py bdist_wheel did not run successfully.
β”‚ exit code: 1
╰─> [150 lines of output]
info: Executing ./scripts/aerospike-client-c.sh
# ... very long output ... #
ld: warning: directory not found for option '-L/usr/local/opt/openssl#1.1/lib'
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 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.
╰─> aerospike
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I have tried to install wheel and then install this package but it's not working.
I have also tried by installing rosetta2 on mac but it didn't work.
Also, if it requires whole output do let me know where I can share that publish the link here in my question.

Receiving EnvCommandError when run poetry install on Apple M1 MacOs Monterey

I'm facing the issue when running poetry install command in my new Macbook Pro using Apple M1 chip and MacOS Monterey. I tried many suggestions so far but still cannot make it fixed.
Python version: 3.8.12
>>> poetry install
Installing dependencies from lock file
Package operations: 20 installs, 0 updates, 0 removals
β€’ Installing scipy (1.6.0): Failed
EnvCommandError
Command ['/Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/bin/pip', 'install', '--no-deps', 'file:///Users/<retacted>/Library/Caches/pypoetry/artifacts/e2/fc/a9/d781fc7053c9e0aa0b94b47220fee30ba4ef114e7d11b36b3cc68b1b95/scipy-1.6.0.tar.gz'] errored with the following return code 1, and output:
Processing /Users/<retacted>/Library/Caches/pypoetry/artifacts/e2/fc/a9/d781fc7053c9e0aa0b94b47220fee30ba4ef114e7d11b36b3cc68b1b95/scipy-1.6.0.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/bin/python /Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/tmpusexpj06
cwd: /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-req-build-xbw8rqq2
Complete output (4 lines):
setup.py:461: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-modern-metadata-1_oeqwwo'), proceeding with generating Cython sources and expanding templates
warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
Error: 'None' must be installed before running the build.
Here is what I tried:
Running the terminal under Rosetta mode
I can be able to install scipy via the command arch -arm64 pip install scipy without issue but the version is 1.7.3
Tried arch -arm64 pip install scipy==1.6.0 getting the error
error: subprocess-exited-with-error
Γ— Preparing metadata (pyproject.toml) did not run successfully.
β”‚ exit code: 1
╰─> [4 lines of output]
setup.py:461: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-modern-metadata-rsi6te2b'), proceeding with generating Cython sources and expanding templates
warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
Error: 'None' must be installed before running the build.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Γ— Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
We had a similar issue and it seems to be a Python version issue: https://github.com/python-poetry/poetry/issues/2629
We downgraded to Python 3.7 for example. Maybe try other versions that is still fine for your project.

Trouble installing dm.xmlsec.binding on Amazon Linux

Im attempting to install python-saml onto the latest Amazon Linux for Elasticbeanstalk (64bit Amazon Linux 2016.09 v2.3.3 running Python 2.7)
When it attempts to install dm.xmlsec.binding it fails with
Running setup.py (path:/tmp/pip-build-5dg8_B/dm.xmlsec.binding/setup.py) egg_info for package dm.xmlsec.binding
Running command python setup.py egg_info
Complete output from command python setup.py egg_info:
{standard input}: Assembler messages:
{standard input}:26237: Warning: end of file not at end of a line; newline inserted
{standard input}:26953: Error: unknown pseudo-op: `.l'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
gcc: Internal error: Killed (program cc1)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Building lxml version 3.7.3.
Building without Cython.
Using build configuration of libxslt 1.1.28
Building against libxml2/libxslt in the following directory: /usr/lib64
Compile failed: command 'gcc' failed with exit status 1
No issues on Ubuntu 16.04
upgrading lxml fixed the issue
sudo pip install lxml --upgrade

lxml gcc failed with exit status 1 ubuntu 16.04

sudo easy_install lxml
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.6.4
Downloading https://pypi.python.org/packages/4f/3f/cf6daac551fc36cddafa1a71ed48ea5fd642e5feabd3a0d83b8c3dfd0cb4/lxml-3.6.4.tar.gz#md5=6dd7314233029d9dab0156e7b1c7830b
Processing lxml-3.6.4.tar.gz
Writing /tmp/easy_install-w86uerbh/lxml-3.6.4/setup.cfg
Running lxml-3.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-w86uerbh/lxml-3.6.4/egg-dist-tmp-smgpuu2j
Building lxml version 3.6.4.
Building without Cython.
Using build configuration of libxslt 1.1.28
src/lxml/lxml.etree.c:83:20: fatal error: Python.h: No such file or directory
compilation terminated.
Compile failed: command 'x86_64-linux-gnu-gcc' failed with exit status 1
/tmp/easy_install-w86uerbh/lxml-3.6.4/temp/xmlXPathInitmvs80t9r.c:2:1: warning: return type defaults to β€˜int’ [-Wimplicit-int]
main (int argc, char **argv) {
^
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
So how can i install lxml lib? I've tried pip, but there is the same finish.
Try to install the following packages:
sudo apt-get install libxml2-dev libxslt1-dev python-dev
If this does not work, make sure that it is not a problem of memory, if so you will need to increase your machine memory.
Just had to add more memory to the instance in order to finish the lxml compilation

Categories