I'm trying to create a docker image on Raspberry Pi 3B+, which i couldn't managed for days. Before creating Docker image, i implemented the code with virtualenv beforehand, which is working fine and requirements.txt is simplified as possible.
Dockerfile ->
FROM alpine:3.14
WORKDIR /code
RUN apk update
RUN apk add python3
RUN apk add py3-pip
RUN pip install wheel
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade Pillow
# copy the requirements inside docker image
COPY ./requirements.txt /code/requirements.txt
# install dependencies inside docker image
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# copy the necessary files in the working directory inside docker image
COPY ./ /code
# RUN the code
CMD ["python3", "camera.py"]
requirements.txt ->
numpy==1.22.3
picamera==1.13
Pillow==9.1.0
requests==2.27.1
When i try to build the image by running
sudo docker build -t camera .
I get the following long error
Building wheels for collected packages: Pillow Building wheel for
Pillow (setup.py): started Building wheel for Pillow (setup.py):
finished with status 'error' error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [177 lines of output]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-
7613obru/pillow_a212af14addc481892cfcd3648121cf3/setup.py",
line 1009, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for Pillow
Running setup.py clean for Pillow Failed to build Pillow Installing
collected packages: Pillow Running setup.py install for Pillow:
started Running setup.py install for Pillow: finished with status
'error' error: subprocess-exited-with-error
× Running setup.py install for Pillow did not run successfully. │ exit code: 1 ╰─> [179 lines of output]
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.9
creating build/lib.linux-armv7l-3.9/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-armv7l-3.9/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-armv7l-3.9/PIL
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
line 804, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-
7613obru/pillow_a212af14addc481892cfcd3648121cf3/setup.py",
line 1009, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[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. ╰─> Pillow
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I've deleted some repetitive lines of error since it was extremely long
It seems i have development libraries missing, i added the following lines and the error was solved
RUN apk add build-base python3-dev py-pip jpeg-dev zlib-dev py3-wheel py3-setuptools
ENV LIBRARY_PATH=/lib:/usr/lib
Related
I'm trying to install stable diffusion. hitting this error after torch is finished installing.
made sure to add python to PATH
deleted venv folder.
reinstalled python 10.6 a few times
not sure how to proceed.
Sorry for the poor formatting of the code
'''
Installing gfpgan
Traceback (most recent call last):
File "C:\Users\B\Downloads\ai\stable-diffusion-webui\launch.py", line 294, in <module>
prepare_environment()
File "C:\Users\B\Downloads\ai\stable-diffusion-webui\launch.py", line 212, in
prepare_environment
run_pip(f"install {gfpgan_package}", "gfpgan")
File "C:\Users\B\Downloads\ai\stable-diffusion-webui\launch.py", line 78, in run_pip
return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing
{desc}", errdesc=f"Couldn't install {desc}")
File "C:\Users\B\Downloads\ai\stable-diffusion-webui\launch.py", line 49, in run
raise RuntimeError(message)
RuntimeError: Couldn't install gfpgan.
Command: "C:\Users\B\Downloads\ai\stable-diffusion-webui\venv\Scripts\python.exe" -m pip
install git+https://github.com/TencentARC/GFPGAN.git#8d2447a2d918f8eba5a4a01463fd48e45126a379
--prefer-binary
Error code: 1
stdout: Collecting
git+https://github.com/TencentARC/GFPGAN.git#8d2447a2d918f8eba5a4a01463fd48e45126a379
Cloning https://github.com/TencentARC/GFPGAN.git (to revision
8d2447a2d918f8eba5a4a01463fd48e45126a379) to c:\users\b\appdata\local\temp\pip-req-build-
rnu9_mu9
stderr: Running command git clone --filter=blob:none --quiet
https://github.com/TencentARC/GFPGAN.git 'C:\Users\B\AppData\Local\Temp\pip-req-build-
rnu9_mu9'
fatal: expected 'packfile'
error: subprocess-exited-with-error
git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git
'C:\Users\B\AppData\Local\Temp\pip-req-build-rnu9_mu9' did not run successfully.
exit code: 128
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git
'C:\Users\B\AppData\Local\Temp\pip-req-build-rnu9_mu9' did not run successfully.
exit code: 128
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
[notice] A new release of pip available: 22.2.1 -> 22.3.1
[notice] To update, run: C:\Users\B\Downloads\ai\stable-diffusion-
webui\venv\Scripts\python.exe -m pip install --upgrade pip
'''
it have some issues with #git urls. Just open the cmd in venv/Lib/site-packages then pip install package_name -t .
btw if more errors occurs, try updating your python to 10.9
I couldn't install it in any way, I wonder what could be the cause of the error.
I installed C++ and other necessary stuff
I am using windows 11
I installed pip install nvidia-pyindex with no problem.
Same as tensorrt I can't install pycuda library and I get same error
\`
(base) PS C:\\Users\\byara\> pip install nvidia-tensorrt
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting nvidia-tensorrt
Downloading nvidia-tensorrt-0.0.1.dev5.tar.gz (7.9 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─\> \[17 lines of output\]
Traceback (most recent call last):
File "\<string\>", line 2, in \<module\>
File "\<pip-setuptools-caller\>", line 34, in \<module\>
File "C:\\Users\\byara\\AppData\\Local\\Temp\\pip-install-ak3sxwfw\\nvidia-tensorrt_a7512906bd3241728853c0e6a10bf9d4\\setup.py", line 150, in \<module\>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
\###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
`
$ pip install nvidia-pyindex
$ pip install nvidia-tensorrt
`your text`
###########################################################################################
[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.
\`
TensorRT is not available for Windows via pip. You can verify that by looking at the wheel files in PyPI, link. All the wheel files for the latest version are for Linux. Thus, trying to install on Windows will pick the previous releases, which were place-holder packages. Those releases just print the message you are seeing, on all OSes.
According to the documentation
The zip file is the only option currently for Windows.
You can find instructions on how to install at Zip File Installation.
As mentioned on the title, CMake seems to be broken after upgrading to MacOS 13.0.
Trying to install something that requires Cmakes takes unusually long then the following pop-up shows up.
“CMake” is damaged and can’t be opened. You should move it to the Trash.
This file was downloaded on an unknown date. # this txt is grey and smaller font
Pop-up Options
1. Move to Trash 2. Cancel
Steps to reproduce Err
Cloned EasyOCR
1.1 git clone ...
Made Python venv
2.0. cd EasyOCR/
2.1. python3 -m venv venv
2.2. source venv/bin/activate
2.3. venv info
python --version && pip --version
# output
Python 3.10.6
pip 22.3 from ... # path to venv dir
pip install -r requirements.txt
# requirements.txt content
torch
torchvision>=0.5
opencv-python-headless<=4.5.4.60
scipy
numpy
Pillow
scikit-image
python-bidi
PyYAML
Shapely
pyclipper
ninja
After a while, the aforementioned pop-up, shows up. Clicking on either option will result in the following error.
Building wheels for collected packages: opencv-python-headless
Building wheel for opencv-python-headless (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for opencv-python-headless (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
cmkr = cmaker.CMaker(cmake_executable)
File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
File "/private/var/folders/5h/36chnb_s3b5fpqmqgt_7cz_m0000gn/T/pip-build-env-ea_5u80v/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
raise SKBuildError(
Traceback (most recent call last):
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for opencv-python-headless
Failed to build opencv-python-headless
ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects
Any thoughts on how to fix or get around this? This is the first time I see this pop up.
The pip package is broken on macOS 13 prior to CMake 3.24.2 due to improper code signing. You should upgrade CMake in your virtual environment by running:
$ python -m pip install -U pip setuptools wheel
$ python -m pip install -U 'cmake>=3.24.2'
As CMake is extremely backwards compatible, it should be safe. You can also add cmake>=3.24.2 to your requirements.txt.
(tensorholo) C:\Users\alaba\Desktop\MIT PROJECT\tensor_holography-main>pip install nvidia-tensorflow[horovod]
Collecting nvidia-tensorflow[horovod]
Downloading nvidia-tensorflow-0.0.1.dev5.tar.gz`` (7.9 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\alaba\AppData\Local\Temp\pip-install-ztjzt002\nvidia-tensorflow_001bf7a090024c37a3c7ff91374ac7c4\setup.py", line 150, in <module>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
```
$ pip install nvidia-pyindex
$ pip install nvidia-tensorflow
```
Please refer to NVIDIA instructions: https://github.com/NVIDIA/tensorflow#install.
###########################################################################################
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.
nvidia-tensorflow[horovod] package doesn't support the Windows platform. You'd need to run it inside a WSL2 (Windows Subsystem for Linux version 2) to make it work on Windows.
Like the official docs say:
The nvidia-tensorflow package includes CPU and GPU support for Linux.
And also this issue on the same repository:
So i trying to install onnx using pip install.
OS: Windows 10 LTSC Build 17763
(i installed all packages from requirements.txt using pip install -r | onnx entry in req.txt "# onnx>=1.9.0 # ONNX export" but onnx won't install)
I try to install it using:
pip install onnx
pip3 install
pip install onnx>=1.9.0
pip3 install onnx>=1.9.0
on python versions
3.7.0
3.10.4
3.9.something
i try to download onnx : pip download onnx
and every time i get this:
Collecting onnx
Using cached onnx-1.11.0.tar.gz (9.9 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Red007Master\AppData\Local\Temp\pip-download-coisn9j3\onnx_f49974f8ac4344abaca0eecae41c15e4\setup.py", line 86, in <module>
assert CMAKE, 'Could not find "cmake" executable!'
AssertionError: Could not find "cmake" executable!
[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.
what is "cmake" where i can get it and how i can fix it? + why i need that "cmake" only for this package?
AND what alternative was on downloading/installing packages i have? + what i'm doing wrong.
Download (and install + add to PATH) CMake from cmake.org/download/ and use fresh venv on python version 3.9.2.
just install cmake:
sudo apt install cmake