I can't isntall JupyterLab with poetry. I keep getting this error. I've tried deleting cache by:
rm -rf ~/Library/Caches/pypoetry/artifacts/*
and
poetry cache clear pypi --all
but I keep getting the following error:
$ poetry add --group dev jupyterlab
Using version ^3.6.1 for jupyterlab
Updating dependencies
Resolving dependencies... (2.6s)
Package operations: 12 installs, 0 updates, 0 removals
• Installing y-py (0.5.5): Failed
CalledProcessError
Command '['/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9', '--no-deps', '/Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz']' returned non-zero exit status 1.
at /opt/homebrew/Cellar/python#3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
524│ # We don't call process.wait() as .__exit__ does that for us.
525│ raise
526│ retcode = process.poll()
527│ if check and retcode:
→ 528│ raise CalledProcessError(retcode, process.args,
529│ output=stdout, stderr=stderr)
530│ return CompletedProcess(process.args, retcode, stdout, stderr)
531│
532│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9', '--no-deps', '/Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz'] errored with the following return code 1, and output:
Processing /Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.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: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[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.
hint: See above for details.
at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1540 in _run
1536│ output = subprocess.check_output(
1537│ command, stderr=subprocess.STDOUT, env=env, **kwargs
1538│ )
1539│ except CalledProcessError as e:
→ 1540│ raise EnvCommandError(e, input=input_)
1541│
1542│ return decode(output)
1543│
1544│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
The following error occurred when trying to handle this error:
PoetryException
Failed to install /Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz
at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/pip.py:58 in pip_install
54│
55│ try:
56│ return environment.run_pip(*args)
57│ except EnvCommandError as e:
→ 58│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
59│
Env info
$ poetry env info
Virtualenv
Python: 3.9.16
Implementation: CPython
Path: /Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9
Executable: /Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python
Valid: True
System
Platform: darwin
OS: posix
Python: 3.9.16
Path: /opt/homebrew/opt/python#3.9/Frameworks/Python.framework/Versions/3.9
Executable: /opt/homebrew/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
How can I solve this issue with y_py package?
Do I really need to install rust to use jupyterlab with poetry as stated in the message?
It seems that there is a bug with jupyterLab latest version
https://github.com/jupyterlab/jupyterlab/issues/12436
Just install jupyterlab older version:
poetry add --group dev jupyterlab==3.5.2
You need to install rust and cargo locally to run this
rustup is an installer for
the systems programming language
After that try running poetry add --group dev jupyterlab
jupyterlab package has dependencies that require compilation, and Rust and Cargo are needed to build those dependencies. It attempts to install y-py, can you try installing python from conda-forge and then install y-py. may be that helps and poetry works without rust & cargo
Related
I have a repository which consits mainly of python and polars code. Every time I want to update or add libraries with poetry I get this error. Until the version 15.15 I had no problems with polars. I have tried updating Polars within the IDE (PyCharm) and also with Brew. Is it something to do with the latest polars release or is it on the system (Mac M1) side ? Unfortunately I am not getting anywhere at this point. Can someone help me ?
Package operations: 0 installs, 1 update, 0 removals
• Updating polars (0.15.15 -> 0.15.16): Failed
CalledProcessError
Command '['/Users/PATH/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/PATH/.venv', '--upgrade', '--no-deps', '/Users/PATH/Library/Caches/pypoetry/artifacts/58/97/2d/cb5f20eacd75bb88a57321c5a81a2b591330ccb0ae2fc786fffbe500eb/polars-0.15.16.tar.gz']' returned non-zero exit status 1.
at /opt/homebrew/Cellar/python#3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py:571 in run
567│ # We don't call process.wait() as .__exit__ does that for us.
568│ raise
569│ retcode = process.poll()
570│ if check and retcode:
→ 571│ raise CalledProcessError(retcode, process.args,
572│ output=stdout, stderr=stderr)
573│ return CompletedProcess(process.args, retcode, stdout, stderr)
574│
575│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['/Users/PATH/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/PATH/.venv', '--upgrade', '--no-deps', '/Users/PATH/Library/Caches/pypoetry/artifacts/58/97/2d/cb5f20eacd75bb88a57321c5a81a2b591330ccb0ae2fc786fffbe500eb/polars-0.15.16.tar.gz'] errored with the following return code 1, and output:
Processing /Users/PATH/Library/Caches/pypoetry/artifacts/58/97/2d/cb5f20eacd75bb88a57321c5a81a2b591330ccb0ae2fc786fffbe500eb/polars-0.15.16.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: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[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.
hint: See above for details.
at /opt/homebrew/Cellar/poetry/1.3.2/libexec/lib/python3.11/site-packages/poetry/utils/env.py:1540 in _run
1536│ output = subprocess.check_output(
1537│ command, stderr=subprocess.STDOUT, env=env, **kwargs
1538│ )
1539│ except CalledProcessError as e:
→ 1540│ raise EnvCommandError(e, input=input_)
1541│
1542│ return decode(output)
1543│
1544│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
The following error occurred when trying to handle this error:
PoetryException
Failed to install /Users/PATH/Library/Caches/pypoetry/artifacts/58/97/2d/cb5f20eacd75bb88a57321c5a81a2b591330ccb0ae2fc786fffbe500eb/polars-0.15.16.tar.gz
at /opt/homebrew/Cellar/poetry/1.3.2/libexec/lib/python3.11/site-packages/poetry/utils/pip.py:58 in pip_install
54│
55│ try:
56│ return environment.run_pip(*args)
57│ except EnvCommandError as e:
→ 58│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
59│
I runned pip install polars==0.15.16 and then it worked. I hope it will be fixed in the future but this is fine as a work around.
polars doesn't provide a wheel for your platform. So it must be build from the sdist file. And this fails because:
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
I'm trying to install paramiko in Cygwin and one of the build dependencies is bcrypt.
I have rustc installed and I believe all of the supporting build libraries.
Pip is also updated to the latest.
$ pip --version
pip 22.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
I use the following pip command:
pip install bcrypt
And I get the following error output:
error: failed to run custom build command for `pyo3-build-config v0.15.2`
Caused by:
process didn't exit successfully: `C:\Cygwin64\tmp\pip-install-19d9dusl\bcrypt_117761e212a240d8804ceae0beeb39c1\src\_bcrypt\target\release\build\pyo3-build-config-2ef06b5f5d02e46b\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=PYO3_CONFIG_FILE
cargo:rerun-if-env-changed=PYO3_NO_PYTHON
cargo:rerun-if-env-changed=PYO3_PYTHON
--- stderr
error: failed to run the Python interpreter at /usr/bin/python.exe: The system cannot find the path specified. (os error 3)
warning: build failed, waiting for other jobs to finish...
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features pyo3/abi3-py36 pyo3/extension-module -- --crate-type cdylib
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install bcrypt:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Ensure you have a recent Rust toolchain installed. bcrypt requires
rustc >= 1.56.0.
Python: 3.8.12
platform: CYGWIN_NT-10.0-19044-3.3.5-341.x86_64-x86_64-64bit-WindowsPE
pip: n/a
setuptools: 65.3.0
setuptools_rust: 1.5.1
rustc: 1.63.0 (4b91a6ea7 2022-08-08)
=============================DEBUG ASSISTANCE=============================
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features 'pyo3/abi3-py36 pyo3/extension-module' -- --crate-type cdylib` failed with code 101
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for bcrypt Failed to build bcrypt ERROR: Could not build wheels for bcrypt, which is required to install pyproject.toml-based projects
I check my python installation (python.exe) and it is installed at /usr/bin/python.exe.
$ ls /usr/bin/python*
/usr/bin/python.exe /usr/bin/python2.7.exe /usr/bin/python3.8-config
/usr/bin/python2-config /usr/bin/python3 /usr/bin/python3.8.exe
/usr/bin/python2.7-config /usr/bin/python3-config
So I am confused.....what is the issue? Why can't it find my python interpreter? Why is bcrypt not building and installing?
I'm guessing that Cygwin causes some compatibility issues here.
It looks like Cygwin has a package for this purpose, likely to avoid these issues:
https://cygwin.com/packages/summary/python36-bcrypt.html
I am trying to install darknetpy using these instructions:
https://pypi.org/project/darknetpy/
however every time I run 'pip install darknetpy' I get:
$ pip install darknetpy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting darknetpy
Using cached darknetpy-4.1.tar.gz (9.4 kB)
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 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\paddy\appdata\local\temp\tmp9kl8jm'
cwd: c:\users\paddy\appdata\local\temp\pip-install-eqp5it\darknetpy
Complete output (2 lines):
c:\python27\python.exe: No module named pip
Please install setuptools-rust package
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\paddy\appdata\local\temp\tmp9kl8jm' Check the logs for full command output.
I have installed setuptools-rust but still get the same errors as above.
I am on a Windows 10 laptop and using Git Bash as my emulator. Please help!
Use the following command to install darknetpy successfully:
pip install https://github.com/danielgatis/darknetpy/raw/master/dist/darknetpy-4.2-cp37-cp37m-linux_x86_64.whl
I am trying to install the disptools package by doing pip install disptools in my terminal.
The disptools package is linked here https://github.com/m-pilia/disptools.
It gives me a long error message during the installation with the main error displayed below.
Building wheel for disptools (setup.py) ... error
ERROR: Command errored out with exit status 1:
...
CMake Error:
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)`
It also includes this in the error:
File "/Users/name/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools', '-DDISPTOOLS_DEBUG=OFF', '-DDISPTOOLS_OPT=OFF', '-DDISPTOOLS_VERBOSE=ON', '-DDISPTOOLS_LOW_ORDER_PD=OFF', '-DDISPTOOLS_DOUBLE=OFF', '-DDISPTOOLS_CUDA_SUPPORT=OFF', '-DDISPTOOLS_CUDA_ERROR_CHECK=ON', '-DDISPTOOLS_CUDA_ERROR_CHECK_SYNC=ON', '-DDISPTOOLS_PYTHON_SUPPORT=ON', '-DDISPTOOLS_PYTHON_C_MODULE_NAME=_disptools', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools/build/lib.macosx-10.9-x86_64-3.6', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build/temp.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Users/name/anaconda3/bin/python3']'
returned non-zero exit status 1.
I have looked everywhere online but I couldn't really find any helpful resources for solving this problem.
Would really appreciate it if someone can help.
With commands, python -m pip install disptools you try to download, compile and install the disptools.
Compilation step fails with a CMake error that tell that it failed to find library OpenMP. You can install it on a Ubuntu/Debian distribution with
sudo apt install libomp-dev
After this, you can launch again the pip command.
I hope you will meet all compilation requirements.
If you are using Anaconda Prompt (recommended),
conda install -c conda-forge dlib
I have been struggling with this and I need some help. I am trying to create a docker image of my python app. My App uses orjson, the fast JSON library for python. Parts of this library is built using rust so I need the rust toolchain. Now the kicker is that I am using Alpine for its small footprint so it comes with none of the standard tools included. I need set things up myself.
Here is my Dockerfile to simulate the problem.
FROM python:3.7-alpine
# for orjson in requirements.txt
RUN apk add rust cargo
RUN pip install orjson
This is the error message that I am facing.
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM python:3.7-alpine
---> 6a5ca85ed89b
Step 2/3 : RUN apk add rust cargo
---> Running in b86315a52e50
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/19) Installing rust-stdlib (1.43.1-r1)
(2/19) Installing libgcc (9.3.0-r2)
(3/19) Installing libstdc++ (9.3.0-r2)
(4/19) Installing binutils (2.34-r1)
(5/19) Installing gmp (6.2.0-r0)
(6/19) Installing isl (0.18-r0)
(7/19) Installing libgomp (9.3.0-r2)
(8/19) Installing libatomic (9.3.0-r2)
(9/19) Installing libgphobos (9.3.0-r2)
(10/19) Installing mpfr4 (4.0.2-r4)
(11/19) Installing mpc1 (1.1.0-r1)
(12/19) Installing gcc (9.3.0-r2)
(13/19) Installing musl-dev (1.1.24-r8)
(14/19) Installing libxml2 (2.9.10-r4)
(15/19) Installing llvm10-libs (10.0.0-r2)
(16/19) Installing rust (1.43.1-r1)
(17/19) Installing nghttp2-libs (1.41.0-r0)
(18/19) Installing libcurl (7.69.1-r0)
(19/19) Installing cargo (1.43.1-r1)
Executing busybox-1.31.1-r16.trigger
OK: 334 MiB in 54 packages
Removing intermediate container b86315a52e50
---> 07671da6f533
Step 3/3 : RUN pip install orjson
---> Running in 9c72ff2b2e3e
Collecting orjson
Downloading orjson-3.0.2.tar.gz (649 kB)
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpxhkdxsol
cwd: /tmp/pip-install-0x1gorur/orjson
Complete output (14 lines):
💥 maturin failed
Caused by: Cargo metadata failed. Do you have cargo in your PATH?
Caused by: Error during execution of `cargo metadata`: error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-7txy00_d --manylinux=off --strip=on`
Error: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-7txy00_d', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpxhkdxsol Check the logs for full command output.
The command '/bin/sh -c pip install orjson' returned a non-zero code: 1
I am a bit lost on what I should install for getting a rust environment in Alpine. Any help would be appreciated.
Please follow this github issue discussion to get more clarity on it.
Dockerfile
FROM alpine:3.10
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.10/main" >> /etc/apk/repositories
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.10/community" >> /etc/apk/repositories
RUN apk add --no-cache python3 gcompat patchelf
RUN patchelf --add-needed libgcompat.so.0 /usr/bin/python3.7
RUN echo 'manylinux1_compatible = True' > /usr/lib/python3.7/_manylinux.py &&\
pip3 install orjson &&\
rm /usr/lib/python3.7/_manylinux.py
Most distros use glibc, alpine uses musl and that's the reason you have to recompile everything. If you are really in the need of building a production grade container, yeah, you're kind of doomed to find and install all the dependencies.
If you're like me and you're only getting your dev env running, just switch from alpine to stretch and all your problems will go away.
Here's the source:
https://github.com/ijl/orjson/issues/98#issuecomment-643248331
I managed to get it to work thanks to #nitishkumar-singh response. There were some errors in that post here is my Dockerfile if someone runs into this issue.
FROM python:3.7-alpine3.11
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.11/main" >> /etc/apk/repositories
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.11/community" >> /etc/apk/repositories
RUN apk add --no-cache python3 gcompat patchelf
RUN patchelf --add-needed libgcompat.so.0 /usr/bin/python3
RUN echo 'manylinux1_compatible = True' > /usr/local/lib/python3.7/_manylinux.py &&\
pip3 install orjson &&\
rm /usr/local/lib/python3.7/_manylinux.py