SimpleCV 1.3 is not - computer-vision

I just install SimpleCV 1.3 on Windows 7. During the install I got a message: "this program could not have been correctly installed setuptools-0.6c11.win32-py2.7.exe". When I run the first example
>>> logo = Image("simplecv")
>>> logo.show()
I got an empty python window and I get a warning: "You need the python image library to save by filehandle"
Someone knows how to fix this?
thanks in advance

After the install error message, did you try reinstalling?
SimpleCV is supposed to include all the libraries it needs, so when installation failed it must have missed some libraries.
You could try installing the python image library (PIL) yourself.
I usually use this web site as a source of python libraries: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil (I think you should use Pillow-2.0.0.win32-py2.7.‌exe)

Related

ImportError sayins module dot not exist, but is already installed

I had to install new package on my project to handle with Base64 images from my API, so i installed django-extra-fields, so far so good, i have made my testes locally, everything working just fine, when i pushed my changes to production and installed the new package running pip install django-extra-fields with right virtualenv on, i just keep getting the error ImportError at /
No module named drf_extra_fields.fields
That seens a silly mistake, so i checked my code like 100 times so far, and everything is right
I'm using Django 1.11 with Python 2.7
My vm is called: vm-prod_cfr_nuvem
When i run pip freeze show all my packages:
(vm-prod_cfr_nuvem) [~ site-packages]$ pip freeze
Django==1.11.6
django-cors-headers==2.1.0
django-extra-fields==2.0.2
django-filter==1.1.0
And if i enter in vm site-packages path, i can see that is installed there
/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib/python2.7/site-packages
django_cors_headers-2.1.0.dist-info
django_extra_fields-2.0.2.dist-info
django_filter-1.1.0.dist-info
on my view where the show the error, as you can see, is the same path as the last one in list
ImportError at /
No module named drf_extra_fields.fields
...
Python Path:
['/home/daniloitj/webapps/cfr_prod/lib/python2.7/Django-1.11.9-py2.7.egg',
'/home/daniloitj/webapps/cfr_prod',
'/home/daniloitj/webapps/cfr_prod/cfr_nuvem',
'/home/daniloitj/webapps/cfr_prod/lib/python2.7',
'/home/daniloitj/lib/python2.7',
'/home/daniloitj/lib/python2.7',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python27.zip',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python2.7',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python2.7/plat-linux2',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python2.7/lib-tk',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python2.7/lib-old',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7',
'/usr/lib/python2.7',
'/usr/lib64/python2.7/lib-tk',
'/home/daniloitj/.virtualenvs/vm-prod_cfr_nuvem/lib/python2.7/site-packages']
Obs.: I thought that somehow my server is not using my VM or something like it... so i activate it manually on my terminal and run python manage.py shell and tried to import the lib import drf_extra_fields im still getting the same error
Obs2.: Didnt found anyone with same problem using that lib, and there is no issues about it, so probabily is my misconfiguration rather than something broke in the lib
Package Page: https://github.com/Hipo/drf-extra-fields
That error make me crazy... i solved it going back 1 small version... so instead of using 2.0.2 i'm using 2.0.1, the odd thing is... the 2.0.2 still working on my local environment, but dont work on production, and dont seems be environment problem cuz my server match all requirements to use that lib

how do i fix "No module named 'win32api'" on python2.7

I am trying to import win32api in python 2.7.9. i did the "pip install pypiwin32" and made sure all the files were intalled correctly (i have the win32api.pyd under ${PYTHON_HOME}\Lib\site-packages\win32). i also tried coping the files from C:\Python27\Lib\site-packages\pywin32_system32 to C:\Python27\Lib\site-packages\win32. I also tried restarting my pc after each of these steps but nothing seems to work! i still get the error 'No module named 'win32api''
Well, turns out the answer is upgrading my python to 3.6.
python 2.7 seems to old to work with outside imports (I'm just guessing here, because its not the first time I'm having an import problem)
hope it helps :)

Python Pydub Permission denied?

When i run this code :
from pydub import AudioSegment
sound = AudioSegment.from_mp3("i.mp3")
sound.export("F:\\bh", format="wav")
A ffmpeg window pops up and i get this error:
Even if i run it with admin privilleges:
Note :
The error occurs on every location that I try to export
If you are on Windows, face this problem, and also have issues installing simpleaudio, you can try installing pyaudio instead.
If you are using Anaconda, you can install pyaudio with
conda install -c anaconda pyaudio
For me, simpleaudio on Anaconda is only available for Linux and MacOS and not Windows.
See this thread here. They suggest installing simpleaudio (pip install simpleaudio) to resolve this issue. It worked for me.
I had the same issue but fixed using the GillHawk solution from this thread (same link as Jondiepdoop gave). I added f.close() in the _play_with_ffplay function of the playback.py file :
def _play_with_ffplay(seg):
with NamedTemporaryFile("w+b", suffix=".wav") as f:
f.close() # close the file stream
seg.export(f.name, "wav")
subprocess.call([PLAYER, "-nodisp", "-autoexit", "-hide_banner", f.name])

Jpegs in Django-wiki

I'm trying to get django-wiki running.
It works well so far, except I can't display .jpeg images.
At first I had trouble when only importing jpeg files in the webapp.
I fixed this modifying setup.py of PIL's setup.py as follows:
JPEG_ROOT = libinclude("/usr/lib")
# Line 214
add_directory(library_dirs, "/usr/lib")
add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
Jpeg libs I have currently installed:
libjpeg-progs
libjpeg62:amd64
libjpeg62-dev:amd64
libjpeg8:amd64
libopenjpeg2:amd64
After install PIL with pip install PIL, I get this output which doesn't look that bad, at least I thought so
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
No error messages (and no "decoder ntót available") and I can view the images properly on my server, which means upload works great. But in the wiki only the file names are shown and when I click on them I get
"This image failed to load."
Could someone please help me? I can't find any error output (debug mode is activated).
Thanks in advance
You are compiling software! You need to install development libraries for these things to compile, e.g. apt-get install libjpeg-dev.
Also, install Pillow, it has less chances of failure to compile - pip install pillow.

Django Gramps no module named web.settings

I'm using Gramps 3.3.1 under Ubuntu 12.04 and trying to in Django Export/Import. The install is okay, but when I look at the installed addons, it says that it failed, with reason: "No module named web.settings".
I cann't for the life of me figure out how to fix this. I'm assuming that it's this line in the python script:
import web.settings as default_settings
Anyone have any ideas? I'm trying to get this data out and into a MySQL database, but I can't seem to.
Thanks!
When you run into an error where Python tells you "No module named blah" it really means it can't find "blah".
I would check your pythonpath and the filesystem permissions on the stuff in your path.
Edit
Your issue seems to be a known issue: http://www.gramps-project.org/bugs/view.php?id=5464
It's caused by not running Gramps from source, near as I can tell. It doesn't look like a Python Path issue, so much as the Gramps Django devs making assumptions where your Django settings would be (but I could be wrong).
As for Python Path, there's plenty of resources describing how to. The simplest way to check your Python path is to run echo $PYTHONPATH in a terminal. If you don't see it there, Python might not find it.