Pillow | Python Imaging Library | Computer Vision library
kandi X-RAY | Pillow Summary
Support
Quality
Security
License
Reuse
- Builds the list of supported extensions .
- Sets up attributes .
- Convert the image .
- Read the bitmap .
- Load the default font data .
- Save an image .
- Write multiple frames to fp .
- Extract a value from the data .
- Add application marker .
- Compute the regular polygon vertices .
Pillow Key Features
Pillow Examples and Code Snippets
:param value: value for this key :param lang: language code :param tkey: UTF-8 version of the key name
Prior to Pillow 2.0.0, very few image code changes were made. Pillow 2.0.0 added Python 3 support and includes many bug fixes from many contributors.
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("Tests/fonts/FreeMono.ttf") width, height = font.getsize("Hello world") left, top = font.getoffset("Hello world")
im = Image.new("RGB", (100, 100)) draw = ImageDraw.Draw(im) width, height = draw.textsize("Hello world")
width, height = font.getsize_multiline("Hello\nworld") width, height = draw.multiline_textsize("Hello\nworld")
font = ImageFont.truetype("Tests/fonts/FreeMono.ttf") left, top, right, bottom = font.getbbox("Hello world") width, height = right - left, bottom - top
im = Image.new("RGB", (100, 100)) draw = ImageDraw.Draw(im) width = draw.textlength("Hello world")
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld") width, height = right - left, bottom - top
""" A Pillow loader for .dds files (S3TC-compressed aka DXTC) Jerome Leclanche Documentation: https://web.archive.org/web/20170802060935/http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt The contents of this file are hereby released in the public domain (CC0) Full text of the CC0 license: https://creativecommons.org/publicdomain/zero/1.0/ """ import struct from io import BytesIO from PIL import Image, ImageFile # Magic ("DDS ") DDS_MAGIC = 0x20534444 # DDS flags DDSD_CAPS = 0x1 DDSD_HEIGHT = 0x2 DDSD_WIDTH = 0x4 DDSD_PITCH = 0x8 DDSD_PIXELFORMAT = 0x1000 DDSD_MIPMAPCOUNT = 0x20000 DDSD_LINEARSIZE = 0x80000 DDSD_DEPTH = 0x800000 # DDS caps DDSCAPS_COMPLEX = 0x8 DDSCAPS_TEXTURE = 0x1000 DDSCAPS_MIPMAP = 0x400000 DDSCAPS2_CUBEMAP = 0x200 DDSCAPS2_CUBEMAP_POSITIVEX = 0x400 DDSCAPS2_CUBEMAP_NEGATIVEX = 0x800 DDSCAPS2_CUBEMAP_POSITIVEY = 0x1000 DDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000 DDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000 DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000 DDSCAPS2_VOLUME = 0x200000 # Pixel Format DDPF_ALPHAPIXELS = 0x1 DDPF_ALPHA = 0x2 DDPF_FOURCC = 0x4 DDPF_PALETTEINDEXED8 = 0x20 DDPF_RGB = 0x40 DDPF_LUMINANCE = 0x20000 # dds.h DDS_FOURCC = DDPF_FOURCC DDS_RGB = DDPF_RGB DDS_RGBA = DDPF_RGB | DDPF_ALPHAPIXELS DDS_LUMINANCE = DDPF_LUMINANCE DDS_LUMINANCEA = DDPF_LUMINANCE | DDPF_ALPHAPIXELS DDS_ALPHA = DDPF_ALPHA DDS_PAL8 = DDPF_PALETTEINDEXED8 DDS_HEADER_FLAGS_TEXTURE = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT DDS_HEADER_FLAGS_MIPMAP = DDSD_MIPMAPCOUNT DDS_HEADER_FLAGS_VOLUME = DDSD_DEPTH DDS_HEADER_FLAGS_PITCH = DDSD_PITCH DDS_HEADER_FLAGS_LINEARSIZE = DDSD_LINEARSIZE DDS_HEIGHT = DDSD_HEIGHT DDS_WIDTH = DDSD_WIDTH DDS_SURFACE_FLAGS_TEXTURE = DDSCAPS_TEXTURE DDS_SURFACE_FLAGS_MIPMAP = DDSCAPS_COMPLEX | DDSCAPS_MIPMAP DDS_SURFACE_FLAGS_CUBEMAP = DDSCAPS_COMPLEX DDS_CUBEMAP_POSITIVEX = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX DDS_CUBEMAP_NEGATIVEX = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX DDS_CUBEMAP_POSITIVEY = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY DDS_CUBEMAP_NEGATIVEY = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY DDS_CUBEMAP_POSITIVEZ = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ DDS_CUBEMAP_NEGATIVEZ = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ # DXT1 DXT1_FOURCC = 0x31545844 # DXT3 DXT3_FOURCC = 0x33545844 # DXT5 DXT5_FOURCC = 0x35545844 def _decode565(bits): a = ((bits >> 11) & 0x1F) << 3 b = ((bits >> 5) & 0x3F) << 2 c = (bits & 0x1F) << 3 return a, b, c def _c2a(a, b): return (2 * a + b) // 3 def _c2b(a, b): return (a + b) // 2 def _c3(a, b): return (2 * b + a) // 3 def _dxt1(data, width, height): # TODO implement this function as pixel format in decode.c ret = bytearray(4 * width * height) for y in range(0, height, 4): for x in range(0, width, 4): color0, color1, bits = struct.unpack("> 2 if control == 0: r, g, b = r0, g0, b0 elif control == 1: r, g, b = r1, g1, b1 elif control == 2: if color0 > color1: r, g, b = _c2a(r0, r1), _c2a(g0, g1), _c2a(b0, b1) else: r, g, b = _c2b(r0, r1), _c2b(g0, g1), _c2b(b0, b1) elif control == 3: if color0 > color1: r, g, b = _c3(r0, r1), _c3(g0, g1), _c3(b0, b1) else: r, g, b = 0, 0, 0 idx = 4 * ((y + j) * width + x + i) ret[idx : idx + 4] = struct.pack("4B", r, g, b, 255) return bytes(ret) def _dxtc_alpha(a0, a1, ac0, ac1, ai): if ai <= 12: ac = (ac0 >> ai) & 7 elif ai == 15: ac = (ac0 >> 15) | ((ac1 << 1) & 6) else: ac = (ac1 >> (ai - 16)) & 7 if ac == 0: alpha = a0 elif ac == 1: alpha = a1 elif a0 > a1: alpha = ((8 - ac) * a0 + (ac - 1) * a1) // 7 elif ac == 6: alpha = 0 elif ac == 7: alpha = 0xFF else: alpha = ((6 - ac) * a0 + (ac - 1) * a1) // 5 return alpha def _dxt5(data, width, height): # TODO implement this function as pixel format in decode.c ret = bytearray(4 * width * height) for y in range(0, height, 4): for x in range(0, width, 4): a0, a1, ac0, ac1, c0, c1, code = struct.unpack("<2BHI2HI", data.read(16)) r0, g0, b0 = _decode565(c0) r1, g1, b1 = _decode565(c1) for j in range(4): for i in range(4): ai = 3 * (4 * j + i) alpha = _dxtc_alpha(a0, a1, ac0, ac1, ai) cc = (code >> 2 * (4 * j + i)) & 3 if cc == 0: r, g, b = r0, g0, b0 elif cc == 1: r, g, b = r1, g1, b1 elif cc == 2: r, g, b = _c2a(r0, r1), _c2a(g0, g1), _c2a(b0, b1) elif cc == 3: r, g, b = _c3(r0, r1), _c3(g0, g1), _c3(b0, b1) idx = 4 * ((y + j) * width + x + i) ret[idx : idx + 4] = struct.pack("4B", r, g, b, alpha) return bytes(ret) class DdsImageFile(ImageFile.ImageFile): format = "DDS" format_description = "DirectDraw Surface" def _open(self): if not _accept(self.fp.read(4)): raise SyntaxError("not a DDS file") (header_size,) = struct.unpack("
from PIL import Image, ImageDraw, ImageFont font = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 16) def test(anchor): im = Image.new("RGBA", (200, 100), "white") d = ImageDraw.Draw(im) d.line(((100, 0), (100, 100)), "gray") d.line(((0, 50), (200, 50)), "gray") d.text((100, 50), f"{anchor} example", "black", font, anchor) return im if __name__ == "__main__": im = Image.new("RGBA", (600, 300), "white") d = ImageDraw.Draw(im) for y, row in enumerate( (("ma", "mt", "mm"), ("ms", "mb", "md"), ("ls", "ms", "rs")) ): for x, anchor in enumerate(row): im.paste(test(anchor), (x * 200, y * 100)) if x != 0: d.line(((x * 200, y * 100), (x * 200, (y + 1) * 100)), "black", 3) if y != 0: d.line(((x * 200, y * 100), ((x + 1) * 200, y * 100)), "black", 3) im.save("docs/example/anchors.png") im.show()
#!/usr/bin/env python3
from PIL import Image
import numba as nb
import numpy as np
def Rainbow(i):
x = 1 - abs(((i / 60) % 2) - 1)
i %= 360
if (i >= 0 and i < 60 ): r,g,b = 1, x, 0
if (i >= 60 and i < 120): r,g,b = x, 1, 0
if (i >= 120 and i < 180): r,g,b = 0, 1, x
if (i >= 180 and i < 240): r,g,b = 0, x, 1
if (i >= 240 and i < 300): r,g,b = x, 0, 1
if (i >= 300 and i < 360): r,g,b = 1, 0, x
res = (int(r * 255), int(g * 255), int(b * 255))
return res
def RainbowFilter(img):
for x in range(img.size[0]):
for y in range(img.size[1]):
intensity = sum(img.getpixel((x, y)))
img.putpixel((x, y), Rainbow(intensity + x + y))
return img
@nb.njit(parallel=True)
def imahdi(img):
intensity = img.sum(axis=-1)
row , col = img.shape[:2]
for r in nb.prange(row):
for c in nb.prange(col):
i = (intensity[r,c] + r + c)
x = 1 - abs(((i / 60) % 2) - 1)
i %= 360
res = np.zeros(3)
if (i >= 0 and i < 60 ): res = np.array([1, x, 0])
elif (i >= 60 and i < 120): res = np.array([x, 1, 0])
elif (i >= 120 and i < 180): res = np.array([0, 1, x])
elif (i >= 180 and i < 240): res = np.array([0, x, 1])
elif (i >= 240 and i < 300): res = np.array([x, 0, 1])
elif (i >= 300 and i < 360): res = np.array([1, 0, x])
img[r,c] = res * 255
return img
@nb.njit(parallel=True)
def mark(img):
intensity = img.sum(axis=-1)
row , col = img.shape[:2]
# Create zeroed result image
res = np.zeros_like(img)
for r in nb.prange(row):
# Only make outer loop parallel else inner one will make more threads than cores
for c in range(col):
i = (intensity[r,c] + r + c)
x = 1 - abs(((i / 60) % 2) - 1)
x = int(x * 255)
i %= 360
# Split the problem space in half in one test - like binary search
if i < 180:
if i < 60:
# Don't create whole new array here
# Don't assign zeroes, array is empty already
res[r,c,0] = 255
res[r,c,1] = x
elif i < 120:
res[r,c,0] = x
res[r,c,1] = 255
else:
res[r,c,1] = 255
res[r,c,2] = x
else:
if i < 240:
res[r,c,1] = x
res[r,c,2] = 255
elif i < 300:
res[r,c,0] = x
res[r,c,2] = 255
else:
res[r,c,0] = 255
res[r,c,2] = x
return res
orig = Image.open('cat.jpg')
res = RainbowFilter(orig)
res.save('result.png')
im = np.asarray(orig)
res = imahdi(im)
Image.fromarray(res).save('imahdi.ppm')
res = mark(im)
Image.fromarray(res).save('mark.ppm')
In [17]: %timeit res = RainbowFilter(orig)
11.7 s ± 80 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [18]: %timeit res = imahdi(im)
1.52 s ± 4.81 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [13]: %timeit res=mark(im)
35.6 ms ± 928 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
import PIL
from PIL import ImageEnhance
from PIL import Image
image = Image.open("img.jpg").convert("RGB")
contact_sheet = PIL.Image.new(image.mode,(1920,1080))
enhancer = ImageEnhance.Color(image)
images = []
current_location = 0
for i in range(10):
images.append(enhancer.enhance(i/10))
for img in images:
# Changed here slightly, current_slice is what we want to paste into the new image
current_slice = img.crop((current_location,0,current_location+192,0+1080))
contact_sheet.paste(current_slice,(current_location,0))
current_location+=192
#display(contact_sheet)
imagesave = contact_sheet.save("CroppedContactSheet.jpg")
import pm4py
import streamlit as st
# from PIL import Image
import pandas as pd
import io
d = {
'case_id': [1, 1, 1, 2],
'activity_id': ['Accepted', 'Awaiting Documentation',
'Complete Activated', 'Approved'],
'timestamp': ['2021-12-20T15:52:47', '2021-12-20T14:57:58',
'2021-12-20T14:59:14', '2021-12-20T14:57:59']
}
@st.cache
def prepare_df(df):
df1 = df[["case_id", "activity_id", "timestamp"]]
df1["case_id"] = df1["case_id"].astype(str)
df1["activity_id"] = df1["activity_id"].astype(str)
df_log = pm4py.format_dataframe(df1, case_id='case_id', activity_key='activity_id', timestamp_key='timestamp')
return df_log
st.title('pm4py on streamlit')
df = pd.DataFrame(d)
df_log = prepare_df(df)
bpm_discovery = st.container()
map2 = pm4py.discover_heuristics_net(df_log)
# 1. Save to file and show it by streamlit.
fn = 'a.png'
pm4py.save_vis_heuristics_net(map2, fn)
# 2. Save to memory.
# image2 = io.BytesIO(pm4py.view_heuristics_net(map2))
with bpm_discovery:
st.image(fn, caption='Heuristic Minners algorithm')
#!/usr/bin/env python3
import numpy as np
from PIL import Image
# Load base image, extract alpha channel and bounding box and crop to it
base = Image.open('base.png').getchannel('A')
bbox = base.getbbox()
print(f'Base image bbox: {bbox}')
base = base.crop(bbox)
base.save('DEBUG-base.png')
# Load overlying layers, extracting alpha channel, cropping and making into Numpy arrays
layers = []
for layer in [0,1,2]:
filename = f'layer{layer}.png'
print(f'Loading {filename}')
im = Image.open(filename).getchannel('A').crop(bbox)
im.save(f'DEBUG-{filename}')
layers.append(np.array(im))
rm DEBUG*.png
# Make PIL Image of base layer into Numpy array
base = np.array(base)
# So we now have base and all layers, just alpha channels, cropped to bounding box as Numpy arrays
# We want to find areas where:
# a) base is non-transparent - we call this "maskA" and store as Numpy array
# b) any layer fully opaque - we call this "maskB" and store as Numpy array
maskA = base > 0
Image.fromarray((maskA*255).astype(np.uint8)).save('DEBUG-maskA.png')
maskB = (layers[0] == 255) | (layers[1] == 255) | (layers[2] == 255)
Image.fromarray((maskB*255).astype(np.uint8)).save('DEBUG-maskB.png')
# result is where there IS something in base layer and there is NO overlay that is fully opaque
res = maskA & ~maskB
Image.fromarray((res*255).astype(np.uint8)).save('result.png')
# Reduce result to simple Yes/No by seeing if any pixel is True
print(f'Result: {np.any(res)}')
Base image bbox: (80, 800, 301, 951)
Loading layer0.png
Loading layer1.png
Loading layer2.png
Result: True
#!/bin/bash
magick -size 2000x2000 xc:none -fill red -draw "rectangle 80,800 300,950" PNG32:base.png
magick -size 2000x2000 xc:none -fill blue -draw "rectangle 280,700 480,850" PNG32:layer0.png
magick -size 2000x2000 xc:none -fill lime -draw "rectangle 320,1000 460,1200" PNG32:layer1.png
magick -size 2000x2000 xc:none -fill orange -draw "rectangle 500,800 800,900" PNG32:layer2.png
magick base.png layer0.png -composite layer1.png -composite layer2.png -composite PNG32:case1.png
#!/bin/bash
magick -size 2000x2000 xc:none -fill red -draw "rectangle 80,800 300,950" PNG32:base.png
magick -size 2000x2000 xc:none -fill blue -draw "rectangle 70,700 350,900" PNG32:layer0.png
magick -size 2000x2000 xc:none -fill lime -draw "rectangle 50,900 250,1200" PNG32:layer1.png
magick -size 2000x2000 xc:none -fill orange -draw "rectangle 250,900 800,1200" PNG32:layer2.png
magick base.png layer0.png -composite layer1.png -composite layer2.png -composite PNG32:case2.png
Trending Discussions on Pillow
Trending Discussions on Pillow
QUESTION
Using PIL, I'm applying a rainbow filter to the given image using getpixel
and setpixel
. One issue, this method is very slow. It takes around 10 seconds to finish one image.
def Rainbow(i):
x = 1 - abs(((i / 60) % 2) - 1)
i %= 360
if (i >= 0 and i < 60 ): r,g,b = 1, x, 0
if (i >= 60 and i < 120): r,g,b = x, 1, 0
if (i >= 120 and i < 180): r,g,b = 0, 1, x
if (i >= 180 and i < 240): r,g,b = 0, x, 1
if (i >= 240 and i < 300): r,g,b = x, 0, 1
if (i >= 300 and i < 360): r,g,b = 1, 0, x
res = (int(r * 255), int(g * 255), int(b * 255))
return res
def RainbowFilter(img):
for x in range(img.size[0]):
for y in range(img.size[1]):
intensity = sum(img.getpixel((x, y)))
img.putpixel((x, y), Rainbow(intensity + x + y))
return img
im = Image.open('cat.jpg')
rainbow_im = RainbowFilter(im)
rainbow_im.save('rainbow_im.png')
ANSWER
Answered 2022-Apr-03 at 15:21You can convert image
to NumPy.array
then use numba
for improving speed like below:
from PIL import Image
import numba as nb
import numpy as np
@nb.njit(parallel=True)
def new_RainbowFilter(img):
intensity = img.sum(axis=-1)
row , col = img.shape[:2]
for r in nb.prange(row):
for c in nb.prange(col):
i = (intensity[r,c] + r + c)
x = 1 - abs(((i / 60) % 2) - 1)
i %= 360
res = np.zeros(3)
if (i >= 0 and i < 60 ): res = np.array([1, x, 0])
elif (i >= 60 and i < 120): res = np.array([x, 1, 0])
elif (i >= 120 and i < 180): res = np.array([0, 1, x])
elif (i >= 180 and i < 240): res = np.array([0, x, 1])
elif (i >= 240 and i < 300): res = np.array([x, 0, 1])
elif (i >= 300 and i < 360): res = np.array([1, 0, x])
img[r,c] = res * 255
return img
im = Image.open('cat.jpg')
img = np.asarray(im)
img = new_RainbowFilter(img)
im = Image.fromarray(img)
im.save('rainbow_im.png')
QUESTION
I want to find the distance between 2 irregular edges in a binary image. That is I have marked with red on the below image. My idea was to draw a colored line (say red) on both the edges and then calculate the distance between them at 10 equal intervals (yellow-colored marking)
I cropped the image into two. Say the top half is
Bottom half is
I want to draw the two red lines or just find the distance between those two somehow. I have been using OpenCV and PILLOW for a lot of steps.
there are also image instances where at few columns there are no black pixels in the top image. How do i calculate the distance of the black pixels only from the top? Just the top image.
ANSWER
Answered 2022-Mar-22 at 18:00Here is one possible approach. I will leave the details to you. But the idea is to use Numpy argmax (or argmin as appropriate) to get the index of the first white after all black in each column. First I flip the image vertically so that the black is at the top. Numpy argmax, seems to find the first white value along the column.
Input (bottom image):
import numpy as np
import cv2
# read image
img = cv2.imread("img.png")
# Note that there is a 2 pixel tall white line at the bottom
# Note that there is columns of black at the left and right sides
# convert to grayscale
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# threshold
img = cv2.threshold(img,0,255,cv2.THRESH_BINARY)[1]
# flip vertically
img = cv2.flip(img, 0)
# remove 2 pixels at the top
img = img[2:, :]
# add one pixel row of white at bottom
img = cv2.copyMakeBorder(img, 0, 2, 0, 0, cv2.BORDER_CONSTANT, value=255)
# find max along each column
max = np.argmax(img, axis=0)
print(max.shape)
print(max)
cv2.imshow('flipped',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Here is the output:
(709,)
[112 112 112 112 32 32 32 32 32 32 32 32 32 32 32 32 32 32
31 31 31 31 31 31 31 31 31 31 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 31 31 31 31 31 31 31
31 31 31 31 31 31 31 31 31 30 30 30 30 30 30 30 30 30
30 30 30 31 31 32 32 33 33 34 35 35 36 36 36 36 36 36
36 36 36 36 36 36 36 36 37 37 38 38 39 39 39 40 40 40
41 41 43 43 44 45 45 46 46 46 46 46 46 46 46 46 46 46
46 46 46 46 46 46 46 46 46 46 46 46 46 45 45 45 45 44
44 44 44 44 44 44 44 44 44 44 44 44 43 43 43 43 43 43
43 43 43 43 43 43 43 44 44 44 44 44 44 44 44 43 43 43
42 42 42 42 42 42 42 42 42 42 41 41 40 40 40 40 40 40
40 40 40 40 40 40 40 40 40 40 40 40 39 39 39 39 39 39
39 39 39 39 39 39 39 39 39 39 39 39 38 38 37 37 37 37
37 37 37 36 36 36 36 36 35 35 35 34 34 34 34 34 34 34
34 34 33 33 32 32 32 32 32 32 32 32 32 32 32 32 32 32
33 33 34 34 35 35 36 37 37 37 37 38 38 38 38 38 38 38
38 38 38 38 38 38 38 39 39 40 40 40 40 40 39 39 39 39
39 39 38 38 38 37 37 37 37 37 37 37 37 37 37 37 37 37
37 38 38 38 39 40 40 41 41 41 39 39 38 37 37 37 37 37
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 38 38
38 39 39 39 39 39 39 39 39 41 41 41 41 41 41 41 41 41
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
40 40 40 40 40 40 40 40 40 40 39 39 38 38 37 37 37 37
36 36 36 36 36 36 35 35 34 34 34 33 33 33 32 31 31 31
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
31 31 31 31 31 31 31 31 30 30 29 29 29 28 28 28 28 27
27 26 26 26 26 26 26 26 26 26 26 26 26 26 26 27 27 27
27 27 27 27 27 27 28 28 28 28 28 28 28 28 28 28 28 28
28 28 28 28 28 28 28 28 28 28 28 28 28 28 29 29 29 29
29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29
29 28 28 27 27 27 27 27 27 27 27 27 27 27 27 27 28 28
28 28 29 29 30 30 30 31 31 32 32 33 33 34 34 35 35 36
36 36 37 37 37 38 38 39 39 39 39 39 39 39 39 39 39 39
39 38 38 37 37 37 37 37 37 36 36 35 35 35 35 35 35 35
35 35 35 35 35 35 35 35 35 35 35 36 36 36 36 36 36 36
36 36 36 36 36 36 37 37 37 37 37 37 37 37 37 37 37 37
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
37 37 37 37 37 37 37 37 37 37 37 37 37 38 38 38 39 39
39 39 39 40 112 112 112]
For the top use argmin or invert the polarity using img=255-img
and then use argmax.
QUESTION
I get this Error when I try to install Pyodbc , I have already install visual studio and I have Microsoft Visual C++ 12 , 15-19 in my machine but still its giving this error.
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: sqlparse, pytz, asgiref, pyodbc, Django, Pillow, mssql-django, django-crispy-forms
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"'; __file__='"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Athar\AppData\Local\Temp\pip-record-t1td50y6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\include\site\python3.10\pyodbc'
cwd: C:\Users\Athar\AppData\Local\Temp\pip-install-w0wwm18g\pyodbc_61963e883a8543fea24a63b1c522bbea\
Complete output (7 lines):
running install
C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"'; __file__='"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Athar\AppData\Local\Temp\pip-record-t1td50y6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\include\site\python3.10\pyodbc' Check the logs for full command output.
ANSWER
Answered 2021-Nov-12 at 13:38The current release of pyodbc (4.0.32) does not have pre-built wheel files for Python 3.10. The easiest way to get it installed at the moment is to download the appropriate wheel from
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
and then install it. For example, if you are running 64-bit Python then you would download the 64-bit wheel and use
pip install pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
QUESTION
I have pretrained model for object detection (Google Colab + TensorFlow) inside Google Colab and I run it two-three times per week for new images I have and everything was fine for the last year till this week. Now when I try to run model I have this message:
Graph execution error:
2 root error(s) found.
(0) UNIMPLEMENTED: DNN library is not found.
[[{{node functional_1/conv1_conv/Conv2D}}]]
[[StatefulPartitionedCall/SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/Reshape_5/_126]]
(1) UNIMPLEMENTED: DNN library is not found.
[[{{node functional_1/conv1_conv/Conv2D}}]]
0 successful operations.
0 derived errors ignored. [Op:__inference_restored_function_body_27380] ***
Never happended before.
Before I can run my model I have to install Tensor Flow object detection API with this command:
import os
os.chdir('/project/models/research')
!protoc object_detection/protos/*.proto --python_out=.
!cp object_detection/packages/tf2/setup.py .
!python -m pip install .
This is the output of command:
Processing /content/gdrive/MyDrive/models/research
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Collecting avro-python3
Downloading avro-python3-1.10.2.tar.gz (38 kB)
Collecting apache-beam
Downloading apache_beam-2.35.0-cp37-cp37m-manylinux2010_x86_64.whl (9.9 MB)
|████████████████████████████████| 9.9 MB 1.6 MB/s
Requirement already satisfied: pillow in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (7.1.2)
Requirement already satisfied: lxml in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (4.2.6)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (3.2.2)
Requirement already satisfied: Cython in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (0.29.27)
Requirement already satisfied: contextlib2 in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (0.5.5)
Collecting tf-slim
Downloading tf_slim-1.1.0-py2.py3-none-any.whl (352 kB)
|████████████████████████████████| 352 kB 50.5 MB/s
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.15.0)
Requirement already satisfied: pycocotools in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (2.0.4)
Collecting lvis
Downloading lvis-0.5.3-py3-none-any.whl (14 kB)
Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.4.1)
Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (1.3.5)
Collecting tf-models-official>=2.5.1
Downloading tf_models_official-2.8.0-py2.py3-none-any.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 38.3 MB/s
Collecting tensorflow_io
Downloading tensorflow_io-0.24.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (23.4 MB)
|████████████████████████████████| 23.4 MB 1.7 MB/s
Requirement already satisfied: keras in /usr/local/lib/python3.7/dist-packages (from object-detection==0.1) (2.7.0)
Collecting opencv-python-headless
Downloading opencv_python_headless-4.5.5.62-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (47.7 MB)
|████████████████████████████████| 47.7 MB 74 kB/s
Collecting sacrebleu
Downloading sacrebleu-2.0.0-py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 10.4 MB/s
Requirement already satisfied: kaggle>=1.3.9 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.5.12)
Requirement already satisfied: psutil>=5.4.3 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (5.4.8)
Requirement already satisfied: oauth2client in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (4.1.3)
Collecting tensorflow-addons
Downloading tensorflow_addons-0.15.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 37.8 MB/s
Requirement already satisfied: gin-config in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (0.5.0)
Requirement already satisfied: tensorflow-datasets in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (4.0.1)
Collecting sentencepiece
Downloading sentencepiece-0.1.96-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
|████████████████████████████████| 1.2 MB 37.5 MB/s
Collecting tensorflow-model-optimization>=0.4.1
Downloading tensorflow_model_optimization-0.7.0-py2.py3-none-any.whl (213 kB)
|████████████████████████████████| 213 kB 42.7 MB/s
Collecting pyyaml<6.0,>=5.1
Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)
|████████████████████████████████| 636 kB 53.3 MB/s
Collecting tensorflow-text~=2.8.0
Downloading tensorflow_text-2.8.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.9 MB)
|████████████████████████████████| 4.9 MB 46.1 MB/s
Requirement already satisfied: google-api-python-client>=1.6.7 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.12.10)
Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.19.5)
Requirement already satisfied: tensorflow-hub>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tf-models-official>=2.5.1->object-detection==0.1) (0.12.0)
Collecting seqeval
Downloading seqeval-1.2.2.tar.gz (43 kB)
|████████████████████████████████| 43 kB 2.1 MB/s
Collecting tensorflow~=2.8.0
Downloading tensorflow-2.8.0-cp37-cp37m-manylinux2010_x86_64.whl (497.5 MB)
|████████████████████████████████| 497.5 MB 28 kB/s
Collecting py-cpuinfo>=3.3.0
Downloading py-cpuinfo-8.0.0.tar.gz (99 kB)
|████████████████████████████████| 99 kB 10.1 MB/s
Requirement already satisfied: google-auth<3dev,>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.35.0)
Requirement already satisfied: uritemplate<4dev,>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.1)
Requirement already satisfied: httplib2<1dev,>=0.15.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.17.4)
Requirement already satisfied: google-auth-httplib2>=0.0.3 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.0.4)
Requirement already satisfied: google-api-core<3dev,>=1.21.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.26.3)
Requirement already satisfied: setuptools>=40.3.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (57.4.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2018.9)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (1.54.0)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.23.0)
Requirement already satisfied: packaging>=14.3 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (21.3)
Requirement already satisfied: protobuf>=3.12.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.17.3)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.2.8)
Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (4.8)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (4.2.4)
Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (2021.10.8)
Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (1.24.3)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (2.8.2)
Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (4.62.3)
Requirement already satisfied: python-slugify in /usr/local/lib/python3.7/dist-packages (from kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (5.0.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=14.3->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.7)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (0.4.8)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (3.0.4)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.1.0)
Requirement already satisfied: libclang>=9.0.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (13.0.0)
Requirement already satisfied: h5py>=2.9.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.1.0)
Requirement already satisfied: astunparse>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.6.3)
Requirement already satisfied: gast>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.4.0)
Requirement already satisfied: google-pasta>=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.2.0)
Requirement already satisfied: typing-extensions>=3.6.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.10.0.2)
Requirement already satisfied: wrapt>=1.11.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.13.3)
Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.23.1)
Collecting tf-estimator-nightly==2.8.0.dev2021122109
Downloading tf_estimator_nightly-2.8.0.dev2021122109-py2.py3-none-any.whl (462 kB)
|████████████████████████████████| 462 kB 49.5 MB/s
Requirement already satisfied: keras-preprocessing>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.1.2)
Collecting tensorboard<2.9,>=2.8
Downloading tensorboard-2.8.0-py3-none-any.whl (5.8 MB)
|████████████████████████████████| 5.8 MB 41.2 MB/s
Requirement already satisfied: flatbuffers>=1.12 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (2.0)
Collecting keras
Downloading keras-2.8.0-py2.py3-none-any.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 41.2 MB/s
Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.3.0)
Collecting numpy>=1.15.4
Downloading numpy-1.21.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
|████████████████████████████████| 15.7 MB 41.4 MB/s
Requirement already satisfied: absl-py>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.0.0)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.43.0)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.7/dist-packages (from astunparse>=1.6.0->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.37.1)
Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py>=2.9.0->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.5.2)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.6.1)
Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.0.1)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (0.4.6)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.8.1)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.3.6)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (1.3.1)
Requirement already satisfied: importlib-metadata>=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (4.10.1)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.7.0)
Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official>=2.5.1->object-detection==0.1) (3.2.0)
Requirement already satisfied: dm-tree~=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow-model-optimization>=0.4.1->tf-models-official>=2.5.1->object-detection==0.1) (0.1.6)
Requirement already satisfied: crcmod<2.0,>=1.7 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (1.7)
Collecting fastavro<2,>=0.21.4
Downloading fastavro-1.4.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB)
|████████████████████████████████| 2.3 MB 38.1 MB/s
Requirement already satisfied: pyarrow<7.0.0,>=0.15.1 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (6.0.1)
Requirement already satisfied: pydot<2,>=1.2.0 in /usr/local/lib/python3.7/dist-packages (from apache-beam->object-detection==0.1) (1.3.0)
Collecting proto-plus<2,>=1.7.1
Downloading proto_plus-1.19.9-py3-none-any.whl (45 kB)
|████████████████████████████████| 45 kB 3.2 MB/s
Collecting requests<3.0.0dev,>=2.18.0
Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 1.8 MB/s
Collecting dill<0.3.2,>=0.3.1.1
Downloading dill-0.3.1.1.tar.gz (151 kB)
|████████████████████████████████| 151 kB 44.4 MB/s
Collecting numpy>=1.15.4
Downloading numpy-1.20.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.3 MB)
|████████████████████████████████| 15.3 MB 21.1 MB/s
Collecting orjson<4.0
Downloading orjson-3.6.6-cp37-cp37m-manylinux_2_24_x86_64.whl (245 kB)
|████████████████████████████████| 245 kB 53.2 MB/s
Collecting hdfs<3.0.0,>=2.1.0
Downloading hdfs-2.6.0-py3-none-any.whl (33 kB)
Collecting pymongo<4.0.0,>=3.8.0
Downloading pymongo-3.12.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508 kB)
|████████████████████████████████| 508 kB 44.3 MB/s
Requirement already satisfied: docopt in /usr/local/lib/python3.7/dist-packages (from hdfs<3.0.0,>=2.1.0->apache-beam->object-detection==0.1) (0.6.2)
Collecting protobuf>=3.12.0
Downloading protobuf-3.19.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 47.3 MB/s
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<3dev,>=1.21.0->google-api-python-client>=1.6.7->tf-models-official>=2.5.1->object-detection==0.1) (2.0.11)
Requirement already satisfied: opencv-python>=4.1.0.25 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (4.1.2.30)
Requirement already satisfied: cycler>=0.10.0 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (0.11.0)
Requirement already satisfied: kiwisolver>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from lvis->object-detection==0.1) (1.3.2)
Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.7/dist-packages (from python-slugify->kaggle>=1.3.9->tf-models-official>=2.5.1->object-detection==0.1) (1.3)
Requirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from sacrebleu->tf-models-official>=2.5.1->object-detection==0.1) (2019.12.20)
Requirement already satisfied: tabulate>=0.8.9 in /usr/local/lib/python3.7/dist-packages (from sacrebleu->tf-models-official>=2.5.1->object-detection==0.1) (0.8.9)
Collecting portalocker
Downloading portalocker-2.3.2-py2.py3-none-any.whl (15 kB)
Collecting colorama
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: scikit-learn>=0.21.3 in /usr/local/lib/python3.7/dist-packages (from seqeval->tf-models-official>=2.5.1->object-detection==0.1) (1.0.2)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.21.3->seqeval->tf-models-official>=2.5.1->object-detection==0.1) (1.1.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.21.3->seqeval->tf-models-official>=2.5.1->object-detection==0.1) (3.1.0)
Requirement already satisfied: typeguard>=2.7 in /usr/local/lib/python3.7/dist-packages (from tensorflow-addons->tf-models-official>=2.5.1->object-detection==0.1) (2.7.1)
Requirement already satisfied: promise in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (2.3)
Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (0.16.0)
Requirement already satisfied: attrs>=18.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (21.4.0)
Requirement already satisfied: importlib-resources in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (5.4.0)
Requirement already satisfied: tensorflow-metadata in /usr/local/lib/python3.7/dist-packages (from tensorflow-datasets->tf-models-official>=2.5.1->object-detection==0.1) (1.6.0)
Collecting tensorflow-io-gcs-filesystem>=0.23.1
Downloading tensorflow_io_gcs_filesystem-0.24.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 40.9 MB/s
Building wheels for collected packages: object-detection, py-cpuinfo, dill, avro-python3, seqeval
Building wheel for object-detection (setup.py) ... done
Created wheel for object-detection: filename=object_detection-0.1-py3-none-any.whl size=1686316 sha256=775b8c34c800b3b3139d1067abd686af9ce9158011fccfb5450ccfd9bf424a5a
Stored in directory: /tmp/pip-ephem-wheel-cache-rmw0fvil/wheels/d0/e3/e9/b9ffe85019ec441e90d8ff9eddee9950c4c23b7598204390b9
Building wheel for py-cpuinfo (setup.py) ... done
Created wheel for py-cpuinfo: filename=py_cpuinfo-8.0.0-py3-none-any.whl size=22257 sha256=ac956c4c039868fdba78645bea056754e667e8840bea783ad2ca75e4d3e682c6
Stored in directory: /root/.cache/pip/wheels/d2/f1/1f/041add21dc9c4220157f1bd2bd6afe1f1a49524c3396b94401
Building wheel for dill (setup.py) ... done
Created wheel for dill: filename=dill-0.3.1.1-py3-none-any.whl size=78544 sha256=d9c6cdfd69aea2b4d78e6afbbe2bc530394e4081eb186eb4f4cd02373ca739fd
Stored in directory: /root/.cache/pip/wheels/a4/61/fd/c57e374e580aa78a45ed78d5859b3a44436af17e22ca53284f
Building wheel for avro-python3 (setup.py) ... done
Created wheel for avro-python3: filename=avro_python3-1.10.2-py3-none-any.whl size=44010 sha256=4eca8b4f30e4850d5dabccee36c40c8dda8a6c7e7058cfb7f0258eea5ce7b2b3
Stored in directory: /root/.cache/pip/wheels/d6/e5/b1/6b151d9b535ee50aaa6ab27d145a0104b6df02e5636f0376da
Building wheel for seqeval (setup.py) ... done
Created wheel for seqeval: filename=seqeval-1.2.2-py3-none-any.whl size=16180 sha256=0ddfa46d0e36e9be346a90833ef11cc0d38cc7e744be34c5a0d321f997a30cba
Stored in directory: /root/.cache/pip/wheels/05/96/ee/7cac4e74f3b19e3158dce26a20a1c86b3533c43ec72a549fd7
Successfully built object-detection py-cpuinfo dill avro-python3 seqeval
Installing collected packages: requests, protobuf, numpy, tf-estimator-nightly, tensorflow-io-gcs-filesystem, tensorboard, keras, tensorflow, portalocker, dill, colorama, tf-slim, tensorflow-text, tensorflow-model-optimization, tensorflow-addons, seqeval, sentencepiece, sacrebleu, pyyaml, pymongo, py-cpuinfo, proto-plus, orjson, opencv-python-headless, hdfs, fastavro, tf-models-official, tensorflow-io, lvis, avro-python3, apache-beam, object-detection
Attempting uninstall: requests
Found existing installation: requests 2.23.0
Uninstalling requests-2.23.0:
Successfully uninstalled requests-2.23.0
Attempting uninstall: protobuf
Found existing installation: protobuf 3.17.3
Uninstalling protobuf-3.17.3:
Successfully uninstalled protobuf-3.17.3
Attempting uninstall: numpy
Found existing installation: numpy 1.19.5
Uninstalling numpy-1.19.5:
Successfully uninstalled numpy-1.19.5
Attempting uninstall: tensorflow-io-gcs-filesystem
Found existing installation: tensorflow-io-gcs-filesystem 0.23.1
Uninstalling tensorflow-io-gcs-filesystem-0.23.1:
Successfully uninstalled tensorflow-io-gcs-filesystem-0.23.1
Attempting uninstall: tensorboard
Found existing installation: tensorboard 2.7.0
Uninstalling tensorboard-2.7.0:
Successfully uninstalled tensorboard-2.7.0
Attempting uninstall: keras
Found existing installation: keras 2.7.0
Uninstalling keras-2.7.0:
Successfully uninstalled keras-2.7.0
Attempting uninstall: tensorflow
Found existing installation: tensorflow 2.7.0
Uninstalling tensorflow-2.7.0:
Successfully uninstalled tensorflow-2.7.0
Attempting uninstall: dill
Found existing installation: dill 0.3.4
Uninstalling dill-0.3.4:
Successfully uninstalled dill-0.3.4
Attempting uninstall: pyyaml
Found existing installation: PyYAML 3.13
Uninstalling PyYAML-3.13:
Successfully uninstalled PyYAML-3.13
Attempting uninstall: pymongo
Found existing installation: pymongo 4.0.1
Uninstalling pymongo-4.0.1:
Successfully uninstalled pymongo-4.0.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
yellowbrick 1.3.post1 requires numpy<1.20,>=1.16.0, but you have numpy 1.20.3 which is incompatible.
multiprocess 0.70.12.2 requires dill>=0.3.4, but you have dill 0.3.1.1 which is incompatible.
google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.
datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
Successfully installed apache-beam-2.35.0 avro-python3-1.10.2 colorama-0.4.4 dill-0.3.1.1 fastavro-1.4.9 hdfs-2.6.0 keras-2.8.0 lvis-0.5.3 numpy-1.20.3 object-detection-0.1 opencv-python-headless-4.5.5.62 orjson-3.6.6 portalocker-2.3.2 proto-plus-1.19.9 protobuf-3.19.4 py-cpuinfo-8.0.0 pymongo-3.12.3 pyyaml-5.4.1 requests-2.27.1 sacrebleu-2.0.0 sentencepiece-0.1.96 seqeval-1.2.2 tensorboard-2.8.0 tensorflow-2.8.0 tensorflow-addons-0.15.0 tensorflow-io-0.24.0 tensorflow-io-gcs-filesystem-0.24.0 tensorflow-model-optimization-0.7.0 tensorflow-text-2.8.1 tf-estimator-nightly-2.8.0.dev2021122109 tf-models-official-2.8.0 tf-slim-1.1.0
I am noticing that this command uninstalling tensorflow 2.7 and installing tensorflow 2.8. I am not sure it was happening before. Maybe it's the reason DNN library link is missing o something?
I can confirm these:
- Nothing was changed inside pretrained model or already installed model or object_detection source files I downloaded a year ago.
- I tried to run command !pip install dnn - not working
- I tried to restart runtime (without disconnecting) - not working
Somebody can help? Thanks.
ANSWER
Answered 2022-Feb-07 at 09:19It happened the same to me last friday. I think it has something to do with Cuda instalation in Google Colab but I don't know exactly the reason
QUESTION
I have a local python project called jive
that I would like to use in an another project. My current method of using jive
in other projects is to activate the conda env for the project, then move to my jive
directory and use python setup.py install
. This works fine, and when I use conda list
, I see everything installed in the env including jive
, with a note that jive
was installed using pip.
But what I really want is to do this with full conda. When I want to use jive
in another project, I want to just put jive
in that projects environment.yml
.
So I did the following:
- write a simple
meta.yaml
so I could use conda-build to buildjive
locally - build jive with
conda build .
- I looked at the tarball that was produced and it does indeed contain the
jive
source as expected - In my other project, add jive to the dependencies in
environment.yml
, and add 'local' to the list of channels. - create a conda env using that environment.yml.
When I activate the environment and use conda list
, it lists all the dependencies including jive
, as desired. But when I open python interpreter, I cannot import jive
, it says there is no such package. (If use python setup.py install
, I can import it.) How can I fix the build/install so that this works?
Here is the meta.yaml, which lives in the jive
project top level directory:
package:
name: jive
version: "0.2.1"
source:
path: .
build:
script: python -m pip install --no-deps --ignore-installed .
requirements:
host:
- python>=3.5
- pip
- setuptools
run:
- python>=3.5
- numpy
- pandas
- scipy
- seaborn
- matplotlib
- scikit-learn
- statsmodels
- joblib
- bokeh
test:
imports: jive
And here is the output of conda build .
No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.16
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.16
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from /Users/thomaskeefe/.conda/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /Users/thomaskeefe/.conda/conda_build_config.yaml
Attempting to finalize metadata for jive
INFO:conda_build.metadata:Attempting to finalize metadata for jive
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
BUILD START: ['jive-0.2.1-py310_0.tar.bz2']
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /opt/miniconda3/conda-bld/jive_1642185595622/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
The following NEW packages will be INSTALLED:
bzip2: 1.0.8-h1de35cc_0
ca-certificates: 2021.10.26-hecd8cb5_2
certifi: 2021.5.30-py310hecd8cb5_0
libcxx: 12.0.0-h2f01273_0
libffi: 3.3-hb1e8313_2
ncurses: 6.3-hca72f7f_2
openssl: 1.1.1m-hca72f7f_0
pip: 21.2.4-py310hecd8cb5_0
python: 3.10.0-hdfd78df_3
readline: 8.1.2-hca72f7f_1
setuptools: 58.0.4-py310hecd8cb5_0
sqlite: 3.37.0-h707629a_0
tk: 8.6.11-h7bc2e8c_0
tzdata: 2021e-hda174b7_0
wheel: 0.37.1-pyhd3eb1b0_0
xz: 5.2.5-h1de35cc_0
zlib: 1.2.11-h4dc903c_4
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Copying /Users/thomaskeefe/Documents/py_jive to /opt/miniconda3/conda-bld/jive_1642185595622/work/
source tree in: /opt/miniconda3/conda-bld/jive_1642185595622/work
export PREFIX=/opt/miniconda3/conda-bld/jive_1642185595622/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
export BUILD_PREFIX=/opt/miniconda3/conda-bld/jive_1642185595622/_build_env
export SRC_DIR=/opt/miniconda3/conda-bld/jive_1642185595622/work
Processing $SRC_DIR
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Building wheels for collected packages: jive
Building wheel for jive (setup.py): started
Building wheel for jive (setup.py): finished with status 'done'
Created wheel for jive: filename=jive-0.2.1-py3-none-any.whl size=46071 sha256=b312955cb2fd917bc4e684a575407b884190680f2dddad7fcb9ac25e5b290fc9
Stored in directory: /private/tmp/pip-ephem-wheel-cache-rbpkt2an/wheels/15/68/82/4ed7cd246fbc4c72cf764b425a03230247589bd2394a7e457b
Successfully built jive
Installing collected packages: jive
Successfully installed jive-0.2.1
Resource usage statistics from building jive:
Process count: 3
CPU time: Sys=0:00:00.3, User=0:00:00.5
Memory: 53.7M
Disk usage: 50.4K
Time elapsed: 0:00:06.1
Packaging jive
INFO:conda_build.build:Packaging jive
INFO conda_build.build:build(2289): Packaging jive
Packaging jive-0.2.1-py310_0
INFO:conda_build.build:Packaging jive-0.2.1-py310_0
INFO conda_build.build:bundle_conda(1529): Packaging jive-0.2.1-py310_0
compiling .pyc files...
number of files: 70
Fixing permissions
INFO :: Time taken to mark (prefix)
0 replacements in 0 files was 0.06 seconds
TEST START: /opt/miniconda3/conda-bld/osx-64/jive-0.2.1-py310_0.tar.bz2
Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
INFO conda_build.variants:_combine_spec_dictionaries(234): Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
INFO:conda_build.utils:Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
INFO conda_build.utils:shutil_move_more_retrying(2091): Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
INFO:conda_build.utils:shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
INFO conda_build.utils:shutil_move_more_retrying(2098): shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol
The following NEW packages will be INSTALLED:
blas: 1.0-mkl
bokeh: 2.4.2-py39hecd8cb5_0
bottleneck: 1.3.2-py39he3068b8_1
brotli: 1.0.9-hb1e8313_2
ca-certificates: 2021.10.26-hecd8cb5_2
certifi: 2021.10.8-py39hecd8cb5_2
cycler: 0.11.0-pyhd3eb1b0_0
fonttools: 4.25.0-pyhd3eb1b0_0
freetype: 2.11.0-hd8bbffd_0
giflib: 5.2.1-haf1e3a3_0
intel-openmp: 2021.4.0-hecd8cb5_3538
jinja2: 3.0.2-pyhd3eb1b0_0
jive: 0.2.1-py310_0 local
joblib: 1.1.0-pyhd3eb1b0_0
jpeg: 9d-h9ed2024_0
kiwisolver: 1.3.1-py39h23ab428_0
lcms2: 2.12-hf1fd2bf_0
libcxx: 12.0.0-h2f01273_0
libffi: 3.3-hb1e8313_2
libgfortran: 3.0.1-h93005f0_2
libpng: 1.6.37-ha441bb4_0
libtiff: 4.2.0-h87d7836_0
libwebp: 1.2.0-hacca55c_0
libwebp-base: 1.2.0-h9ed2024_0
llvm-openmp: 12.0.0-h0dcd299_1
lz4-c: 1.9.3-h23ab428_1
markupsafe: 2.0.1-py39h9ed2024_0
matplotlib: 3.5.0-py39hecd8cb5_0
matplotlib-base: 3.5.0-py39h4f681db_0
mkl: 2021.4.0-hecd8cb5_637
mkl-service: 2.4.0-py39h9ed2024_0
mkl_fft: 1.3.1-py39h4ab4a9b_0
mkl_random: 1.2.2-py39hb2f4e1b_0
munkres: 1.1.4-py_0
ncurses: 6.3-hca72f7f_2
numexpr: 2.8.1-py39h2e5f0a9_0
numpy: 1.21.2-py39h4b4dc7a_0
numpy-base: 1.21.2-py39he0bd621_0
olefile: 0.46-pyhd3eb1b0_0
openssl: 1.1.1m-hca72f7f_0
packaging: 21.3-pyhd3eb1b0_0
pandas: 1.3.5-py39h743cdd8_0
patsy: 0.5.2-py39hecd8cb5_0
pillow: 8.4.0-py39h98e4679_0
pip: 21.2.4-py39hecd8cb5_0
pyparsing: 3.0.4-pyhd3eb1b0_0
python: 3.9.7-h88f2d9e_1
python-dateutil: 2.8.2-pyhd3eb1b0_0
pytz: 2021.3-pyhd3eb1b0_0
pyyaml: 6.0-py39hca72f7f_1
readline: 8.1.2-hca72f7f_1
scikit-learn: 1.0.2-py39hae1ba45_0
scipy: 1.7.3-py39h8c7af03_0
seaborn: 0.11.2-pyhd3eb1b0_0
setuptools: 58.0.4-py39hecd8cb5_0
six: 1.16.0-pyhd3eb1b0_0
sqlite: 3.37.0-h707629a_0
statsmodels: 0.13.0-py39hca72f7f_0
threadpoolctl: 2.2.0-pyh0d69192_0
tk: 8.6.11-h7bc2e8c_0
tornado: 6.1-py39h9ed2024_0
typing_extensions: 3.10.0.2-pyh06a4308_0
tzdata: 2021e-hda174b7_0
wheel: 0.37.1-pyhd3eb1b0_0
xz: 5.2.5-h1de35cc_0
yaml: 0.2.5-haf1e3a3_0
zlib: 1.2.11-h4dc903c_4
zstd: 1.4.9-h322a384_0
Preparing transaction: ...working... done
Verifying transaction: ...working...
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::intel-openmp-2021.4.0-hecd8cb5_3538, defaults/osx-64::llvm-openmp-12.0.0-h0dcd299_1
path: 'lib/libiomp5.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'bin/webpinfo'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'bin/webpmux'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/decode.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/encode.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/mux.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/mux_types.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/types.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.7.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.3.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.3.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebp.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebpdecoder.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebpmux.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/cwebp.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/dwebp.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/webpinfo.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/webpmux.1'
done
Executing transaction: ...working...
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/llvm-openmp-12.0.0-h0dcd299_1/lib/libiomp5.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libiomp5.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/bin/webpinfo
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/webpinfo
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/bin/webpmux
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/webpmux
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/decode.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/decode.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/encode.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/encode.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/mux.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/mux.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/mux_types.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/mux_types.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/types.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/types.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebp.7.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebp.7.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebp.a
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebp.a
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebp.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebp.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpdecoder.3.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpdecoder.3.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpdecoder.a
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpdecoder.a
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpdecoder.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpdecoder.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpmux.3.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpmux.3.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpmux.a
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpmux.a
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebpmux.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebpmux.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/.condatmp/1018f8ab-87a7-4fa8-a41c-4c14cc77cfff
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/pkgconfig/libwebp.pc
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/.condatmp/e3701fae-f2cd-44e9-9dc6-c71f499cd2c2
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/pkgconfig/libwebpdecoder.pc
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/.condatmp/0f4bcf50-01e5-404d-b1a4-8a87d45c22c5
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/pkgconfig/libwebpmux.pc
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/share/man/man1/cwebp.1
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/share/man/man1/cwebp.1
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/share/man/man1/dwebp.1
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/share/man/man1/dwebp.1
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/share/man/man1/webpinfo.1
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/share/man/man1/webpinfo.1
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/share/man/man1/webpmux.1
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/share/man/man1/webpmux.1
Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
More details are available here: https://intel.github.io/scikit-learn-intelex
For example:
$ conda install scikit-learn-intelex
$ python -m sklearnex my_application.py
done
export PREFIX=/opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol
export SRC_DIR=/opt/miniconda3/conda-bld/jive_1642185595622/test_tmp
Traceback (most recent call last):
File "/opt/miniconda3/conda-bld/jive_1642185595622/test_tmp/run_test.py", line 2, in
import jive
ModuleNotFoundError: No module named 'jive'
import: 'jive'
Tests failed for jive-0.2.1-py310_0.tar.bz2 - moving package to /opt/miniconda3/conda-bld/broken
WARNING:conda_build.build:Tests failed for jive-0.2.1-py310_0.tar.bz2 - moving package to /opt/miniconda3/conda-bld/broken
WARNING conda_build.build:tests_failed(2970): Tests failed for jive-0.2.1-py310_0.tar.bz2 - moving package to /opt/miniconda3/conda-bld/broken
TESTS FAILED: jive-0.2.1-py310_0.tar.bz2
EDIT: I added a test:
section to the meta.yaml as merv suggested.
ANSWER
Answered 2022-Feb-05 at 04:16The immediate error is that the build is generating a Python 3.10 version, but when testing Conda doesn't recognize any constraint on the Python version, and creates a Python 3.9 environment.
I think the main issue is that python >=3.5
is only a valid constraint when doing noarch
builds, which this is not. That is, once a package builds with a given Python version, the version must be constrained to exactly that version (up through minor). So, in this case, the package is built with Python 3.10, but it reports in its metadata that it is compatible with all versions of Python 3.5+, which simply isn't true because Conda Python packages install the modules into Python-version-specific site-packages
(e.g., lib/python-3.10/site-packages/jive
).
Typically, Python versions are controlled by either the --python
argument given to conda-build
or a matrix supplied by the conda_build_config.yaml
file (see documentation on "Build variants").
Try adjusting the meta.yaml
to something like
package:
name: jive
version: "0.2.1"
source:
path: .
build:
script: python -m pip install --no-deps --ignore-installed .
requirements:
host:
- python
- pip
- setuptools
run:
- python
- numpy
- pandas
- scipy
- seaborn
- matplotlib
- scikit-learn
- statsmodels
- joblib
- bokeh
If you want to use it in a Python 3.9 environment, then use conda build --python 3.9 .
.
QUESTION
Error while installing manimce, I have been trying to install manimce library on windows subsystem for linux and after running
pip install manimce
Collecting manimce
Downloading manimce-0.1.1.post2-py3-none-any.whl (249 kB)
|████████████████████████████████| 249 kB 257 kB/s
Collecting Pillow
Using cached Pillow-8.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting scipy
Using cached scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
Collecting colour
Using cached colour-0.1.5-py2.py3-none-any.whl (23 kB)
Collecting pangocairocffi<0.5.0,>=0.4.0
Downloading pangocairocffi-0.4.0.tar.gz (17 kB)
Preparing metadata (setup.py) ... done
Collecting numpy
Using cached numpy-1.21.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Collecting pydub
Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting pygments
Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting cairocffi<2.0.0,>=1.1.0
Downloading cairocffi-1.3.0.tar.gz (88 kB)
|████████████████████████████████| 88 kB 160 kB/s
Preparing metadata (setup.py) ... done
Collecting tqdm
Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Collecting pangocffi<0.9.0,>=0.8.0
Downloading pangocffi-0.8.0.tar.gz (33 kB)
Preparing metadata (setup.py) ... done
Collecting pycairo<2.0,>=1.19
Using cached pycairo-1.20.1.tar.gz (344 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting progressbar
Downloading progressbar-2.5.tar.gz (10 kB)
Preparing metadata (setup.py) ... done
Collecting rich<7.0,>=6.0
Using cached rich-6.2.0-py3-none-any.whl (150 kB)
Collecting cffi>=1.1.0
Using cached cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
Collecting commonmark<0.10.0,>=0.9.0
Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting typing-extensions<4.0.0,>=3.7.4
Using cached typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting colorama<0.5.0,>=0.4.0
Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: cairocffi, pangocairocffi, pangocffi, pycairo, progressbar
Building wheel for cairocffi (setup.py) ... done
Created wheel for cairocffi: filename=cairocffi-1.3.0-py3-none-any.whl size=89650 sha256=afc73218cc9fa1d844d7165f598e2be0428598166b4c3ed9de5bbdc94a0a6977
Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/f3/97/83/8022b9237866102e18d1b7ac0a269769e6fccba0f63dceb9b7
Building wheel for pangocairocffi (setup.py) ... done
Created wheel for pangocairocffi: filename=pangocairocffi-0.4.0-py3-none-any.whl size=19283 sha256=54399796259c6e24f9ab56c5747ab273dcf97fb6fed3e7b54935f9ac49351d50
Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/60/58/92/507a12a5044f7fcda6f4dfd8e0a607cc1fe957bc0dea885906
Building wheel for pangocffi (setup.py) ... done
Created wheel for pangocffi: filename=pangocffi-0.8.0-py3-none-any.whl size=37899 sha256=bea348af93696816b046dd901aa60d29a464460c5faac67628eb7e1ea7d1807d
Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/c4/df/6d/e9d0f79b1545f6e902cc22773b1429de7a5efc240b891ee009
Building wheel for pycairo (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /home/yusifer_zendric/manim_ce/venv/bin/python /home/yusifer_zendric/manim_ce/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpuguwzu3u
cwd: /tmp/pip-install-l4hqdegr/pycairo_f4d80b8f3e4840a3802342825adcdff5
Complete output (12 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
running build_ext
'pkg-config' not found.
Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
----------------------------------------
ERROR: Failed building wheel for pycairo
Building wheel for progressbar (setup.py) ... done
Created wheel for progressbar: filename=progressbar-2.5-py3-none-any.whl size=12074 sha256=7290ef8de5dd955bf756b90130f400dd19c2cc9ea050a5a1dce2803440f581e2
Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/2c/67/ed/d84123843c937d7e7f5ba88a270d11036473144143355e2747
Successfully built cairocffi pangocairocffi pangocffi progressbar
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ pip install manim_ce
ERROR: Could not find a version that satisfies the requirement manim_ce (from versions: none)
ERROR: No matching distribution found for manim_ce
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ manim example_scenes/basic.py -pql
Command 'manim' not found, did you mean:
command 'maim' from deb maim (5.5.3-1build1)
Try: sudo apt install
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ sudo apt-get install manim
[sudo] password for yusifer_zendric:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package manim
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ pip3 install manimlib
Collecting manimlib
Downloading manimlib-0.2.0.tar.gz (4.8 MB)
|████████████████████████████████| 4.8 MB 498 kB/s
Preparing metadata (setup.py) ... done
Collecting Pillow
Using cached Pillow-8.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting argparse
Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting colour
Using cached colour-0.1.5-py2.py3-none-any.whl (23 kB)
Collecting numpy
Using cached numpy-1.21.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Collecting opencv-python
Downloading opencv_python-4.5.4.60-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.3 MB)
|████████████████████████████████| 60.3 MB 520 kB/s
Collecting progressbar
Using cached progressbar-2.5-py3-none-any.whl
Collecting pycairo
Using cached pycairo-1.20.1.tar.gz (344 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pydub
Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting pygments
Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting scipy
Using cached scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
Collecting tqdm
Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Building wheels for collected packages: manimlib, pycairo
Building wheel for manimlib (setup.py) ... done
Created wheel for manimlib: filename=manimlib-0.2.0-py3-none-any.whl size=212737 sha256=27efe2c226d80cfe5663928e980d3e5f5a164d8e9d0aacea5014d37ffdedb76a
Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/87/36/c1/2db5ed5de9908034108f3c39538cd3367445d9cec01e7c8c23
Building wheel for pycairo (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /home/yusifer_zendric/manim_ce/venv/bin/python /home/yusifer_zendric/manim_ce/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp5o2970su
cwd: /tmp/pip-install-sxxp3lw2/pycairo_d372a62d0c6b4c4484391402d21485e1
Complete output (12 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
running build_ext
'pkg-config' not found.
Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
----------------------------------------
ERROR: Failed building wheel for pycairo
Successfully built manimlib
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
all the libraries are installed accept the pycairo library. It's just showing this to install pyproject.toml error. Infact I have already done pip install pyproject.toml and it is installed then also it's showing the same error.
ANSWER
Answered 2022-Jan-28 at 02:24apt-get install sox ffmpeg libcairo2 libcairo2-dev
apt-get install texlive-full
pip3 install manimlib # or pip install manimlib
Then:
pip3 install manimce # or pip install manimce
And everything works.
QUESTION
I am encountering a segfault when I make a reticulated call to matplotlib.pyplot.plot()
.
Steps to produce error:
Create a
Dockerfile
with the contents:
FROM rocker/r-ver:latest
RUN apt update && apt install -y python3.8-venv python3.8-dev
RUN install2.r --error reticulate
COPY test.R /root/
Create a file test.R
(in the same location) with the contents:
reticulate::virtualenv_create(
envname = "./venv",
packages = c("matplotlib")
)
reticulate::use_virtualenv("./venv")
reticulate::py_run_string("import matplotlib.pyplot as plt; plt.plot([1, 2, 3], [1, 2, 3])")
Build an image from the Dockerfile
: docker build . --tag="segfault-reprex"
Try to run test.R
in the running container: docker run segfault-reprex Rscript /root/test.R
. This gives the full traceback listed below.
Full traceback
Using Python: /usr/bin/python3.8
Creating virtual environment './venv' ... Done!
Installing packages: 'pip', 'wheel', 'setuptools', 'matplotlib'
Collecting pip
Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting setuptools
Downloading setuptools-60.5.0-py3-none-any.whl (958 kB)
Collecting matplotlib
Downloading matplotlib-3.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB)
Collecting fonttools>=4.22.0
Downloading fonttools-4.28.5-py3-none-any.whl (890 kB)
Collecting packaging>=20.0
Downloading packaging-21.3-py3-none-any.whl (40 kB)
Collecting cycler>=0.10
Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting numpy>=1.17
Downloading numpy-1.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
Collecting pillow>=6.2.0
Downloading Pillow-9.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB)
Collecting python-dateutil>=2.7
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pyparsing>=2.2.1
Downloading pyparsing-3.0.6-py3-none-any.whl (97 kB)
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pip, wheel, setuptools, kiwisolver, fonttools, pyparsing, packaging, cycler, numpy, pillow, six, python-dateutil, matplotlib
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
Attempting uninstall: setuptools
Found existing installation: setuptools 44.0.0
Uninstalling setuptools-44.0.0:
Successfully uninstalled setuptools-44.0.0
Successfully installed cycler-0.11.0 fonttools-4.28.5 kiwisolver-1.3.2 matplotlib-3.5.1 numpy-1.22.0 packaging-21.3 pillow-9.0.0 pip-21.3.1 pyparsing-3.0.6 python-dateutil-2.8.2 setuptools-60.5.0 six-1.16.0 wheel-0.37.1
Virtual environment './venv' successfully created.
*** caught segfault ***
address 0x7ffaeabe1100, cause 'memory not mapped'
Traceback:
1: py_run_string_impl(code, local, convert)
2: reticulate::py_run_string("import matplotlib.pyplot as plt; plt.plot([1, 2, 3], [1, 2, 3])")
An irrecoverable exception occurred. R is aborting now ...
Things I have noted:
A minimal example inovling eg. the pandas package, rather than matplotlib, runs successfully. ie. if
test.R
contains:
reticulate::virtualenv_create(
envname = "./venv",
packages = c("pandas")
)
reticulate::use_virtualenv("./venv")
reticulate::py_run_string("import pandas as pd; df = pd.DataFrame()")
If you enter the container interactively (docker run -it segfault-reprex /bin/bash
), run test.R
(Rscript /root/test.R
), activate the resulting virutalenv (source /root/venv/bin/activate
), you can use matplotlib fine from python (python -c "import matplotlib.pyplot as plt; plt.plot([1, 2, 3], [1, 2, 3])"
)
The reticulate documentation states that:
for reticulate to bind to a version of Python it must be compiled with shared library support (i.e. with the --enable-shared flag)
docker run -it segfault-reprex /usr/bin/python3 -c "import sysconfig; print(sysconfig.get_config_vars('Py_ENABLE_SHARED'))"
shows that the container's Python was compiled with shared library support
ANSWER
Answered 2022-Jan-26 at 16:45The problem is that the R binary in rocker/r-ver:latest
is compiled against a different BLAS library to the one which the numpy on PyPI is compiled against.
This was explained to me by Tomasz Kalinowski here.
The solution is to ensure numpy uses the same BLAS libraries as rocker/r-ver
's R binary does. An easy way to ensure this is to compile numpy from source. This compilation could be performed at either image build-time or container runtime.
To compile numpy at container runtime we can leave our Dockerfile
as is, and add a call to system2()
after our initial call to reticulate::virtualenv_create()
. Altering test.R
to become:
reticulate::virtualenv_create(
envname = "./venv",
packages = c("matplotlib")
)
system2("./venv/bin/pip3", c("install",
"--no-binary='numpy'",
"numpy",
"--ignore-installed"))
reticulate::use_virtualenv("./venv")
reticulate::py_run_string("import matplotlib.pyplot as plt;plt.plot([1, 2, 3], [1, 2, 3])")
After rebuilding our image, we can run test.R
in this container without segfault!
Compiling numpy at runtime adds ~3 mins to every call of our R script!
A better solution could be to perform this compilation at image build-time. This would mean we'd only have to wait those ~3 minutes once (at image build time), rather than every time we run our script!
A Dockerfile
to do so could look like:
FROM rocker/r-ver:latest
RUN apt update && apt install -y python3 python3-dev python3-venv
RUN install2.r --error reticulate
# Create a venv
RUN python3 -m venv /root/venv
# Compile numpy from source into venv
RUN /root/venv/bin/pip3 install --no-binary="numpy" numpy --ignore-installed
COPY test.R /root/
The accompanying test.R file would then make use of reticulate::virtualenv_install()
as:
reticulate::virtualenv_install(
envname = "/root/venv",
packages = c("matplotlib")
)
reticulate::use_virtualenv("/root/venv")
reticulate::py_run_string("import matplotlib.pyplot as plt;plt.plot([1, 2, 3], [1, 2, 3])")
NB. when running a container from the image with numpy already compiled, you'll need to run as either root (-u="root"
), or else change the permissions on the compiled numpy version in the Dockerfile
; otherwise you will encounter a permissions error.
QUESTION
I'm build Django app, and it's work fine on my machine, but when I run inside docker container it's rest framework keep crashing, but when I comment any connection with rest framework it's work fine.
- My machine: Kali Linux 2021.3
- docker machine: Raspberry Pi 4 4gb
- docker container image: python:rc-alpine3.14
- python version on my machine: Python 3.9.7
- python version on container: Python 3.10.0rc2
error output:
Traceback (most recent call last):
File "/app/manage.py", line 22, in
main()
File "/app/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
super().run_from_argv(argv)
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/test.py", line 55, in handle
failures = test_runner.run_tests(test_labels)
File "/usr/local/lib/python3.10/site-packages/django/test/runner.py", line 728, in run_tests
self.run_checks(databases)
File "/usr/local/lib/python3.10/site-packages/django/test/runner.py", line 665, in run_checks
call_command('check', verbosity=self.verbosity, databases=databases)
File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 181, in call_command
return command.execute(*args, **defaults)
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/check.py", line 63, in handle
self.check(
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/usr/local/lib/python3.10/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.10/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python3.10/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 412, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 598, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/project/urls.py", line 24, in
path("", include("apps.urls", namespace="apps")),
File "/usr/local/lib/python3.10/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/apps/urls.py", line 3, in
from . import api
File "/app/apps/api.py", line 1, in
from .serializers import *
File "/app/apps/serializers.py", line 1, in
from rest_framework import serializers
File "/usr/local/lib/python3.10/site-packages/rest_framework/serializers.py", line 27, in
from rest_framework.compat import postgres_fields
File "/usr/local/lib/python3.10/site-packages/rest_framework/compat.py", line 59, in
import requests
File "/usr/local/lib/python3.10/site-packages/requests/__init__.py", line 63, in
from . import utils
File "/usr/local/lib/python3.10/site-packages/requests/utils.py", line 27, in
from .cookies import RequestsCookieJar, cookiejar_from_dict
File "/usr/local/lib/python3.10/site-packages/requests/cookies.py", line 172, in
class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
Dockerfile
FROM python:rc-alpine3.14
COPY . /app
WORKDIR /app
ENV UWSGI_PROFILE=core
ENV PYTHONUNBUFFERED=TRUE
RUN apk add --update --no-cache g++ gcc libxslt-dev # add some nessery libs
RUN apk add python3-dev build-base linux-headers pcre-dev
RUN pip3 install -U pip # upgrade pip
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add jpeg-dev zlib-dev libjpeg \
&& pip install Pillow \
&& apk del build-deps
RUN apk add --no-cache --virtual=build-dependencies wget ca-certificates && \
wget "https://bootstrap.pypa.io/get-pip.py" -O /dev/stdout | python
RUN pip install uwsgi
RUN pip3 install -r requirements.txt # install all requirements
RUN python uploadstatics.py
EXPOSE 80
CMD ["gunicorn","project.wsgi:application", "-b 0.0.0.0:8060"]
NOTES:
- I use gunicorn to run the app (the error show even I run't from manage.py)
ANSWER
Answered 2022-Jan-07 at 19:13You can downgrade your Python version. That should solve your problem; if not, use collections.abc.Mapping
instead of the deprecated collections.Mapping
.
Refer here: Link
QUESTION
I am working with a simple ML model with streamlit. It runs fine on my local machine inside conda environment, but it shows Error installing requirements when I try to deploy it on share.streamlit.io.
The error message is the following:
ERROR: Could not find a version that satisfies the requirement pywin32==303 (from versions: none)
ERROR: No matching distribution found for pywin32==303
This is the requirements.txt file for my model:
altair==4.1.0
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
astor==0.8.1
attrs==21.2.0
backcall==0.2.0
base58==2.1.1
bleach==4.1.0
blinker==1.4
cachetools==5.0.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.9
click==7.1.2
colorama==0.4.4
cycler==0.11.0
debugpy==1.5.1
decorator==5.1.0
defusedxml==0.7.1
entrypoints==0.3
fonttools==4.28.5
gitdb==4.0.9
GitPython==3.1.24
idna==3.3
ipykernel==6.6.0
ipython==7.30.1
ipython-genutils==0.2.0
ipywidgets==7.6.5
jedi==0.18.1
Jinja2==3.0.3
joblib==1.1.0
jsonschema==4.3.2
jupyter-client==7.1.0
jupyter-core==4.9.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.2
kiwisolver==1.3.2
MarkupSafe==2.0.1
matplotlib==3.5.1
matplotlib-inline==0.1.3
mistune==0.8.4
nbclient==0.5.9
nbconvert==6.3.0
nbformat==5.1.3
nest-asyncio==1.5.4
notebook==6.4.6
numpy==1.21.5
packaging==21.3
pandas==1.3.5
pandocfilters==1.5.0
parso==0.8.3
pickleshare==0.7.5
Pillow==8.4.0
prometheus-client==0.12.0
prompt-toolkit==3.0.24
protobuf==3.19.1
pyarrow==6.0.1
pycparser==2.21
pydeck==0.7.1
Pygments==2.10.0
Pympler==1.0.1
pyparsing==3.0.6
pyrsistent==0.18.0
python-dateutil==2.8.2
pytz==2021.3
pytz-deprecation-shim==0.1.0.post0
pywin32==303
pywinpty==1.1.6
pyzmq==22.3.0
requests==2.26.0
scikit-learn==1.0.1
scipy==1.7.3
seaborn==0.11.2
Send2Trash==1.8.0
six==1.16.0
smmap==5.0.0
streamlit==1.3.0
terminado==0.12.1
testpath==0.5.0
threadpoolctl==3.0.0
toml==0.10.2
toolz==0.11.2
tornado==6.1
traitlets==5.1.1
typing_extensions==4.0.1
tzdata==2021.5
tzlocal==4.1
urllib3==1.26.7
validators==0.18.2
watchdog==2.1.6
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.2
wincertstore==0.2
What should I do to resolve this error?
ANSWER
Answered 2021-Dec-25 at 14:42Streamlit share runs the app in a linux environment meaning there is no pywin32 because this is for windows.
Delete the pywin32 from the requirements file and also the pywinpty==1.1.6 for the same reason.
After deleting these requirements re-deploy your app and it will work.
QUESTION
I'm working on CI for my Python + Django project. I have to use the python:3.9-alpine
image. A weird error is popping in my CI pipelines:
WARNING: Discarding https://files.pythonhosted.org/packages/aa/8a/7c80e7e44fb1b4277e89bd9ca509aefdd4dd1b2c547c6f293afe9f7ffd04/psycopg2-2.9.1.tar.gz#sha256=de5303a6f1d0a7a34b9d40e4d3bef684ccc44a49bbe3eb85e3c0bffb4a131b7c (from https://pypi.org/simple/psycopg2/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement psycopg2==2.9.1 (from versions: 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6, 2.6.1, 2.6.2, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.7.3.1, 2.7.3.2, 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1, 2.9.2)
Preparing metadata (setup.py): finished with status 'error'
ERROR: No matching distribution found for psycopg2==2.9.1
I see 2.9.1 in list of avaliable versions
My .gitlab-ci.yml
stages:
- linter
- build_pip
- build
- meta
- code_quality
- deploy
.except-tags:
except:
- tags
build_pip:build_dist:
stage: build_pip
# image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.9-alpine
image: python:3.9-alpine
variables:
OPENCV_VERSION: "4.5.3.56"
before_script:
- pip install --upgrade pip setuptools wheel
- apk update apk add -q --update --no-cache
- postgresql-dev musl-dev
...
- pip install -r requirements/production.txt --no-cache
script:
- python setup.py bdist_wheel
- echo PIP_CI_JOB_ID=$CI_JOB_ID > PIP_CI_JOB_ID.env
dependencies: []
artifacts:
expire_in: 1 hour
paths:
- dist/
- version
reports:
dotenv: PIP_CI_JOB_ID.env
extends:
- .except-tags
...
requirements/production.txt
djangorestframework==3.12.4
drf-extra-fields==3.1.1
djangorestframework-camel-case==1.2.0 # https://pypi.org/project/djangorestframework-camel-case/
Pillow==8.3.2
python-dateutil==2.8.2 # datetime formatting
psycopg2==2.9.1
opencv-python==4.5.3.56
drf-yasg==1.20.0
sentry-sdk==1.4.3
gunicorn==20.1.0
requests==2.26.0
yarl==1.7.0
googlemaps==4.5.3
django_redis==5.0.0
celery==5.2.0
channels==3.0.4
channels_redis==3.3.1
Full gitlab ci log: https://pastebin.com/QhMhErF7
What is the reason for this error?
I tried to replace psycopg2
with psycopg2-binary
but the same error occours.
ANSWER
Answered 2021-Dec-05 at 17:35What is the reason of my error?
Did you read my previous answer to a similar question of yours? The last part warns about certain combinations of Alpine + Python and this seems to be happening right now.
I tried to replace psycopg2 with psycopg2-binary but have the same error
The problem here might be a python library that has dependencies on gcc
, which is not shipped on alpine by default.
Try replacing this:
before_script:
- pip install --upgrade pip setuptools wheel
- apk update
- apk add -q --update --no-cache postgresql-dev musl-dev
with:
before_script:
- pip install --upgrade pip setuptools wheel
- apk update
- apk add -q --no-cache postgresql-dev gcc python3-dev musl-dev
Notice that adding gcc
will increase the image size, since this might be a dependency for either psycopg2
or psycopg2-binary
. If the image size grows a lot I see no point in sticking with alpine, you could just avoid more Python headaches by switching to a debian-based image.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Pillow
You can use Pillow like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page