Pular navegação

To solve error:

Edit opencv/cmake/OpenCVCompilerOptions.cmake and alter lines:

set(OPENCV_EXTRA_FLAGS "")

to

set(OPENCV_EXTRA_FLAGS " -stdlib=libstdc++")

and

set(OPENCV_EXTRA_EXE_LINKER_FLAGS "")

to

set(OPENCV_EXTRA_EXE_LINKER_FLAGS " -stdlib=libstdc++")

Source: http://www.learnopencv.com/install-opencv-3-on-yosemite-osx-10-10-x/

Já faz um tempo que eu publiquei um serviço para ajudar no dia a dia de fotógrafos: O Pizze.me é um serviço que permite aos fotógrafos criarem um site para que seus clientes selecionem fotos de forma simples e prática. Muito mais prático e econômico do que usar DVD’s ou Pen Drivers 😉

Sugestões e criticas são muito bem-vindas.

 

Se você está tendo este problema irritante, e não consegue resolver experimente fazer o seguinte: Instale o programa “Go SMS Pro” (ele é gratuíto) e dê uma olhada nas suas mensagens. Apague as mensagens que estiverem com um ícone de aviso (uma exclamação dentro de um triângulo) e depois tente abrir novamente o programa de mensagens original. Essa solução resolveu meu problema em um Galaxy Gran DUOS.

My Python is installed in /opt/python.org/python-2.7.2

OpenCV sources are in /usr/local/src/opencv.org/opencv-2.4.5

Make sure that you have numpy installed then run these lines:

$ cd /usr/local/src/opencv.org/opencv-2.4.5
$ mkdir build

$ cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX:PATH=$HOME/.local -D PYTHON_EXECUTABLE:FILEPATH=/opt/python.org/python-2.7.2/bin/python -D PYTHON_INCLUDE_DIR:PATH=/opt/python.org/python-2.7.2/include/python2.7 -D PYTHON_LIBRARY:FILEPATH=/opt/python.org/python-2.7.2/lib/libpython2.7.dylib -D PYTHON_LIBRARY_PATH:UNINITIALIZED=/opt/python.org/python-2.7.2/lib/libpython2.7.dylib -D PYTHON_NUMPY_INCLUDE_DIR:PATH=/opt/python.org/python-2.7.2/lib/python2.7/site-packages/numpy/core/include -D PYTHON_PACKAGES_PATH:PATH=/opt/python.org/python-2.7.2/lib/python2.7/site-packages -D PYTHONINTERP_FOUND=1 -D BUILD_PYTHON_SUPPORT=ON -D INSTALL_PYTHON_EXAMPLES:BOOL=ON ..

$ make -j8

$ sudo make install

IMPORTANT: Edit file ~/.profile and include these lines at end:

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages/
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/python.org/python-2.7.2/lib/python2.7/site-packages:~/.local/lib/
export PATH=$PATH:~/.local/bin

If you missed the /opt/python.org/python-2.7.2/lib/python2.7/site-packages on DYLD_LIBRARY_PATH you’ll get this error:

>>> import cv2
Segmentation fault: 11

And if you missed the ~/.local/lib/ on DYLD_LIBRARY_PATH you’ll get this error:

>>> import cv2
Traceback (most recent call last):
File “”, line 1, in
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: lib/libopencv_core.2.4.dylib
Referenced from: /opt/python.org/python-2.7.2/lib/python2.7/site-packages/cv2.so
Reason: image not found

Run the two commands:

$ dd if=/dev/zero of=/swapfile bs=1024 count=1048576

$ mkswap /swapfile

Then edit /etc/fstab and add this line:

/swapfile none swap sw 0 0

Problem:  When uploading images to Satchmo I got this error message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." even with valid JPEG files.

To test the Python Image Library (PIL) I’d  executed this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I’d run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue”  wiki page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

Problem: Error on Uploading a image file to Satchmo. Message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image."

To test the Python Image Library (PIL) I run this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue”  home page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

When I tried to install the Library PIL on a Ubuntu 8.04 where I had installed  Python 2.6 I got:

.
.
.
running build_ext
building ‘_imagingtk’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -IlibImaging -I/opt/python.org/python/python-2.6/include -I/usr/local/include -I/usr/include -I/opt/python.org/python/python-2.6/include/python2.6 -c _imagingtk.c -o build/temp.linux-i686-2.6/_imagingtk.o
_imagingtk.c:20:16: error: tk.h: No such file or directory
_imagingtk.c:23: error: expected ‘)’ before ‘*’ token
_imagingtk.c:31: error: expected specifier-qualifier-list before ‘Tcl_Interp’
_imagingtk.c: In function ‘_tkinit’:
_imagingtk.c:37: error: ‘Tcl_Interp’ undeclared (first use in this function)
_imagingtk.c:37: error: (Each undeclared identifier is reported only once
_imagingtk.c:37: error: for each function it appears in.)
_imagingtk.c:37: error: ‘interp’ undeclared (first use in this function)
_imagingtk.c:45: error: expected expression before ‘)’ token
_imagingtk.c:51: error: ‘TkappObject’ has no member named ‘interp’
_imagingtk.c:55: warning: implicit declaration of function ‘TkImaging_Init’
error: command ‘gcc’ failed with exit status 1

I’d founded the file ‘tk.h‘ on ‘/usr/include/tcl8.4‘ and after a look at the setup.py file I changed the line number 41 from:

TCL_ROOT = None

to

TCL_ROOT = “/usr/include/tcl8.4”

Now you can run your ‘python setup.py install’ again and get PIL working!

Note: You may perhaps have to install the tk-dev and tcl-dev packages before running the setup.py. I’d already had these packages, so I’m not sure about it.

On Ubuntu run:

apt-get install tk-dev tcl-dev

Satchmo is a great shopping cart application that uses Python and Django. If you are looking for this kind of application it worth a look.

One of the best point of Satchmo is how easy and beautiful is to customize your application. You can create customized product model without touch the base Satchmo models. It’s a great feature, that make easy to apply future Satchmo updates.

You can learn how to create a custom product in JuanjoAlvarez Blog.

I followed the instructions but get the error:

Wed, 12 Aug 2009 11:57:17 configuration DEBUG SettingNotSet: PRODUCT.PRODUCT_TYPES
Traceback (most recent call last):
File "./manage.py", line 27, in
execute_manager(settings)
.
.
.
.
raise SettingNotSet('%s config group does not exist' % group)
livesettings.models.SettingNotSet

SOLUTION: After apply a grep in the Satchmo code for “PRODUCT_TYPES” I figured out my mistake: My package was named product: the same name of the Satchmo product application. So it was overriding the framework application.

Thank god Satchmo is a Open Source project!

Para criar uma base dados e um novo usuário para acessar essa base execute:

CREATE DATABASE my_database_name;

GRANT ALL PRIVILEGES ON my_database_name.* TO ‘new_username’@’localhost’ IDENTIFIED BY ‘my_password’ WITH GRANT OPTION;

FLUSH PRIVILEGES;

Installing PostgreSQL from sources is a very easy and grateful task. It allow you to customize a lot of stuffs in your database server (I really appreciate the option of choose where to install my softwares, but this is not all).

You can get the PostgreSQL sources at http://www.postgresql.org/ftp/source/. I got the sources for the version 8.3.7, since it’s the latest stable version, so far.

Read More »

Crie seu próprio site, grátis no WordPress.com.Crie seu próprio site.
Começar grátis