I am trying to use librosa to analyze .wav files. I started with creating a list which stores the names of all the .wav files it detected.
data_dir = '/Users/raghav/Desktop/FSU/summer research'
audio_file = glob(data_dir + '/*.wav')
I can see the names of all the files in the list 'audio_file'. But when I load any of the audio file, it gives me file not found error.
audio, sfreq = lr.load(audio_file[0])
error output:
Traceback (most recent call last):
File "read_audio.py", line 10, in <module>
audio, sfreq = lr.load(audio_file[1])
File "/usr/local/lib/python3.7/site-packages/librosa/core/audio.py", line 119, in load
with audioread.audio_open(os.path.realpath(path)) as input_file:
File "/usr/local/lib/python3.7/site-packages/audioread/__init__.py", line 107, in audio_open
backends = available_backends()
File "/usr/local/lib/python3.7/site-packages/audioread/__init__.py", line 86, in available_backends
if ffdec.available():
File "/usr/local/lib/python3.7/site-packages/audioread/ffdec.py", line 108, in available
creationflags=PROC_FLAGS,
File "/usr/local/lib/python3.7/site-packages/audioread/ffdec.py", line 94, in popen_multiple
return subprocess.Popen(cmd, *args, **kwargs)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'avconv': 'avconv'
Two things:
It looks like you are using Homebrew
avconv is not in your path
Assuming, you have never installed it, you should be able to solve this simply by installing it. I.e. run:
$ brew install libav
(see here)
If avconv is already installed, you probably need to look into your PATH environment and check whether it is in the path.
That said, using a system-wide Python as installed by Homebrew is a bad idea, because it does not quickly let you change Python versions and dependency sets. It all becomes one big mess within weeks.
One (among multiple) solutions for this is to use miniconda. It quickly lets you activate Python interpreters with defined dependency sets.
So to really solve the issue, I'd recommend to install miniconda and create a plain Python 3.6 environment:
$ conda create -n librosa_env python=3.6
Activate the environment:
$ source activate librosa_env
Then add the conda-forge channel (a repository that contains many libraries like librosa):
$ conda config --add channels conda-forge
Then install librosa:
$ conda install librosa
By installing librosa this way, conda should take care of all dependencies, incl. libav.
That error suggests librosa is unable to find FFMPEG executables, of which avconv is an example.
When not converting different samplerates, FFMPEG is often not needed. You can try to specify the sample size to be the original of the audio file during load()
Upgrading audioread to 2.1.8 fixed this issue for me. The bugfix can be inspected here: https://github.com/beetbox/audioread/commit/8c4e236fda38ce1d1f6dafc4715074a790e62849
I had to install FFMPEG to solve the issue.. You may follow along the link https://www.wikihow.com/Install-FFmpeg-on-Windows for the same.
Related
In the process of using the ffmpeg module to edit video files i used the subprocess module
The code is as follows:
#trim bit
import subprocess
import os
seconds = "4"
mypath=os.path.abspath('trial.mp4')
subprocess.call(['ffmpeg', '-i',mypath, '-ss', seconds, 'trimmed.mp4'])
Error message:
Traceback (most recent call last):
File "C:\moviepy-master\resizer.py", line 29, in <module>
subprocess.call(['ffmpeg', '-i',mypath, '-ss', seconds, 'trimmed.mp4'])
File "C:\Python27\lib\subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
After looking up similar problems i understood that the module is unable to pick the video file because it needs its path, so i took the absolute path. But in spite of that the error still shows up.
The module where this code was saved and the video file trial.mp4 are in the same folder.
The WindowsError you see does not refer to the video file but to the ffmpeg executable itself. The call to subprocess.call has no idea that trimmed.mp4 is a filename you are passing. Windows knows that the first parameter ought to be an executable file and reports back to the interpreter that it can't find it.
Double-check that ffmpeg can be executed in the environment your interpreter is running in. You may either add it to your PATH or specify the full path to ffmpeg.exe.
None of the above answers worked for me.
I got it working, by opening Anaconda Navigator > CMD prompt.
conda install ffmpeg
This answer is directed at Windows users of the ffmpeg-python library since this question is the first search result for a stricter instance of the same issue.
Adding on to user2722968's answer because neither of the existing answers solved the problem for me.
As of this post, ffmpeg-python uses subprocess.Popen to run ffmpeg. Per this issue, subprocess does not look in Path when resolving names, so even if FFmpeg is installed and in your Path and you can run it from CMD/PowerShell, ffmpeg-python may not be able to use it.
My solution was to copy ffmpeg.exe into the Python environment where python.exe is. This workaround seems far from ideal but it seems to have solved the problem for me.
Most of the answers didn't work. Here is what worked for me using conda env:
pip uninstall ffmpeg-python
conda install ffmpeg
pip install ffmpeg-python
Just the conda installation gives library not found error. Didn't try uninstalling conda library either but this works.
I had the same issue!
And I FOUND A SOLUTION.
I realised, viewing all these answers that I need to install ffmpeg. I tried 'pip install ffmpeg' but that didn't work. What worked was copying the ffmpeg.exe file to the folder that python.exe is in.
Thats what someone up here mentioned. Thank you!
To download the ffmpeg.exe file, download the zip file from https://github.com/GyanD/codexffmpeg/releases/tag/2022-06-06-git-73302aa193
First Uninstall all pip libraries
pip uninstall ffmpeg
pip uninstall ffmpeg-python
Then install using conda
conda install ffmpeg
If you are going to use 'ffmpeg.exe' or its linux binary, you need this
conda install ffmpeg
Then you will call it via subprocess or os.system() in your code.
And make sure you will run a different thread to run ffmpeg code otherwise there will be a huge bottleneck in your main thread.
class SaveAll():
def init(self):
super(SaveAll, self).__init__()
def save(self):
try:
command = "ffmpeg -i {} -c copy -preset ultrafast {}"format(...)
os.system(command)
except ffmpeg.Error as e:
print (e.stout, file=sys.stderr)
print (e.stderr, file=sys.stderr)
def run(self):
self.thread= threading.Thread(target=self.save)
self.thread.start()
self.thread.join(1)
...
saver = SaveAll()
saver.start()
Trying to use the google api client, I have gotten an error that MANY others have gotten:
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlencode'
I have tried every solution found in StackOverflow, GitHub, and other places, including:
1) from this thread, changing the path in the actual code:
import sys
sys.path.insert(1, '/Library/Python/2.7/site-packages')
2) from this thread, changing the python path in the .bashrc and .bash_profile files:
pip show six | grep "Location:" | cut -d " " -f2
export PYTHONPATH=$PYTHONPATH:<pip_install_path>
source ~/.bashrc
3) and from this thread, downgrading my google api client to 1.3.2 (or at least trying to).
I'm new to programming so this could be a basic problem but I've spent days trying to troubleshoot and to no avail. It seems like no matter what I do, the old 1.4 version of six is being used. Any help you could provide would be MUCH appreciated!
EDIT: Full Traceback:
Traceback (most recent call last):
File "/Users/zachgoldfine/PycharmProjects/FirstTry/GetAroundRentalSpreadsheetRead.py", line 71, in <module>
spreadsheetId=spreadsheetId, range=rangeName1).execute()
File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 129, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/googleapiclient/http.py", line 836, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "/Library/Python/2.7/site-packages/googleapiclient/http.py", line 162, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/transport.py", line 186, in new_request
credentials._refresh(orig_request_method)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 761, in _refresh
self._do_refresh_request(http)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 774, in _do_refresh_request
body = self._generate_refresh_request_body()
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 716, in _generate_refresh_request_body
body = urllib.parse.urlencode({
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlencode'
Assuming it's indeed a problem with the six version, here is one way to install six and be able to use the newly installed version.
Important note: this will only work from your user account; not from any other account.
On the safe side: this will not alter the system Python environment, that is, system scripts that may use Python will continue to use the older pip version.
Firstly, reverse the three steps above. In particular, manually altering sys.path in a script should really very rarely be necessary.
Then, use the --user option, which installs a local version, that Python (when run by that user) will automatically pick up first.
To make sure the Python executable you are using corresponds to the pip module and (later) the installed six module, use the following:
python -m pip install six --user
where python may be something slightly else, if you happen to not use the system Python (e.g., z/usr/local/bin/python, orpython3, etc).
There is no need forsudo` or similar.
If pip complains that the requirement is already up to date (it shouldn't, or you wouldn't have gotten the above problems), try:
python -m pip install six --user --upgrade --force
Once done, you can check $HOME/Library/Python/x.y/lib/python/site-packages to see if you see the correct version of six there. This is your local user Library directory, not the system one. x.y is probably 2.7, but do check that python is actually that version.
The problem may also be with the google api client. I don't know if that has a pip installation, but otherwise you could try something similar as for six:
python -m pip install <google-api-client> --user (--upgrade --force)
I am trying to install Theano on Windwos 8
Have followed these steps.
I try to test using:
import numpy as np
import time
import theano
print('blas.ldflags=', theano.config.blas.ldflags)
A = np.random.rand(1000, 10000).astype(theano.config.floatX)
B = np.random.rand(10000, 1000).astype(theano.config.floatX)
np_start = time.time()
AB = A.dot(B)
np_end = time.time()
X, Y = theano.tensor.matrices('XY')
mf = theano.function([X, Y], X.dot(Y))
t_start = time.time()
tAB = mf(A, B)
t_end = time.time()
print("NP time: %f[s], theano time: %f[s] (times should be close when run on CPU!)" % (
np_end - np_start, t_end - t_start))
print("Result difference: %f" % (np.abs(AB - tAB).max(), ))
I am aware that the script is comparison between numpy and theano computation time.
But somehow, some dll is not found. Pl find the following log:
[Py341] C:\>python ML\Deep\TheanoSetupTesting.py
blas.ldflags= -LE:\Things_Installed_Here\Theano\openblas -lopenblas
Traceback (most recent call last):
File "ML\Deep\TheanoSetupTesting.py", line 12, in <module>
mf = theano.function([X, Y], X.dot(Y))
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function.py", line 317, in function
output_keys=output_keys)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\pfunc.py", line 526, in pfunc
output_keys=output_keys)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function_module.py", line 1778, in orig_function
defaults)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function_module.py", line 1642, in create input_storage=input_storage_lists, storage_map=storage_map)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\link.py", line 690, in make_thunk
storage_map=storage_map)[:3]
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\vm.py", line 1037, in make_all
no_recycling))
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\op.py", line 932, in make_thunk
no_recycling)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\op.py", line 850, in make_c_thunk
output_storage=node_output_storage)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1207, in make_thunk
keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1152, in __compile__
keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1602, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 1174, in module_from_key module = lnk.compile_cmodule(location)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1513, in compile_cmodule
preargs=preargs)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 2196, in compile_str
return dlimport(lib_filename)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 331, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: The specified module could not be found.
being new to python world, I am not able to find out which Dll in not found. I would install it if missing and would add the path the system path variable. But how do I get to know which dll it is. I tried using pdb and set a breakpoint in cmodule.py at various locations, but none gets hit.
Are you familiar to this kind of error and its resolution?
Otherwise, help me find that missing dll name, and I'll do the rest.
I do not mind a walking a completely different path in installing theano. I came across few posts which suggest microsoft compiler works just fine. But I am already sitting on a problem since past 14 hours continuously and would want a method which works. Ultimately I want theano on my system.
BTW, do not have a CUDA. I am trying on CPU only.
This may be a little bit late. I followed the exact same guide as you, and ran into the same error.
Turns out that it can be fixed by adding the openblas directory to system path. In your example, add "E:\Things_Installed_Here\Theano\openblas" to system path variable.
Note that depending on where you put the DLL files, you either need to add "E:\Things_Installed_Here\Theano\openblas" or "E:\Things_Installed_Here\Theano\openblas\bin".
Windows 10 64 bit, Python 3.5.1 (Anaconda 2.5), Theano 0.8.2.
For those who need it, I am able to install Theano in Windows 10 thanks to these three guides guide1, guide2 and the guide attached by OP.
OK, I finally found the reason at least for my installation using WinPython, python3.5.1.1, Win 7 64bit and mingw64:
In the .theanorc[.txt] file, I ha, after installing blas, a section [blas] with a line including the openblas include path. I removed that line and left the area below [blas] blank. Restarted WinPython/Spider, opened a new console and it worked.
Testet afterwards with running mnist.py from Lasagne using Theano.
I was struggling with getting theano to work on Windows 10 x64 as well, and after reading several help guides, what worked for me in the end was the following:
Install Intel Distribution for Python (make sure c:\intelpython27\ and c:\intelpython27\scripts are in the PATH)
Open a command line and do: conda install mingw libpython
Then do: pip install theano
Download the precompiled libopenblas.dll from http://sourceforge.net/projects/openblas/files/v0.2.14/ (I got OpenBLAS-v0.2.14-Win64-int32.zip)
Download mingw64_dll.zip as well from http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip/download
extract OpenBLAS-v0.2.14-Win64-int32.zip to c:\openblas, for example
extract mingw64_dll.zip to c:\openblas\bin
Add c:\openblas\lib and c:\openblas\bin to PATH
Create .theanorc.txt in c:\Users\{username}
Put the following in .theanorc.txt:
[global]
floatX = float32
device = cpu
[blas]
ldflags = -LC:\\openblas\\bin -LC:\\openblas\\lib -lopenblas
Hope this helps someone.
Just to add my experience with Win10 64bit and theano (and keras). I was getting the DLL load fail error as well. Tried all the stuff I have found on theano win install webpage and in the different forum and blog posts (mentioned here in Uradium's post).
It didn't work for me, but here is what worked:
I installed TDM-GCC-64 and openblas, using regedit I have added their /bin directories to PATH (and /lib directory of openblas as well)
made clean venv under miniconda3 - installed prerequisites for theano and keras (scipy, numpy, pyyaml), python 3.5.2
conda install mingw libpython
conda install theano (installs all the mingw libraries as well)
at this point - it worked - so I didnt use any .theanorc.txt file configuration, no fiddling with Windows environment variables. It even worked for keras based python scripts, even-though I had not installed keras into my conda venv it was working in...(I have keras installed in my "normal" non-conda python3, and later I pip installed keras under my conda venv as well).
Quite late, but for future reference. I stumbled upon this thread trying to run an OpenBLAS test script on the CPU. It worked fine on the GPU but the CPU gives me the same errors as the OP. I tried the suggestions here, but that didn't work. Turns out that the line in .theanorc:
ldflags=-LE:\OpenBLAS-v0.2.14-Win64-int32/bin -lopenblas
shouldn't have the space after bin and before -l. So it should be:
ldflags=-LE:\OpenBLAS-v0.2.14-Win64-int32/bin-lopenblas
Now everything works. Tried it on:
Windows 10
Python 3.5
Theano 0.9
Cuda 8 (with CudaMEM and CudaDNN)
Visual Studio 2015 Community
I am trying to install a fresh version of virtualenv (there is some problem with the path that python has stored in sys.executable) and it turns out there is another problem that actually seems related.
When I try to run pip install virtualenv, I get this output:
-bash: /usr/local/Cellar/python/2.7.10_2/bin/pip: /usr/local/opt/python3/bin/python3.4:
bad interpreter: No such file or directory
Now my original point in reinstalling virtualenv is that I keep getting this error when I run virtualenv venv
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv.py", line 2363, in <module>
main()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 994, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1288, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shutil.py", line 108, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/opt/python3/bin/python3.4'
As a sidenote that may be relevant, rather than using the default installed python3, I brew-installed a python3 with a brewed openssl (an application required it) and placed the path of the brewed python3 at the top of my /etc/paths.
I have tried to install and uninstall python multiple times without any success and am completely at a loss of what the problem could be. Any direction would be greatly appreciated.
EDIT
After #cel 's suggestions, it turned out that the head of my pip file (located at /usr/local/Cellar/python/2.7.10_2/bin/pip) was set to hardcode a python version as so #!/usr/local/opt/python3/bin/python3.4. I changed this to the output of which python which was /usr/local/Cellar/python/2.7.10_2/bin/python
This allowed me to succesfully create a virtualenv once again. Thanks!
I came across a similar problem when I used HomeBrew to upgrade my python from version 3.5.2 to version 3.6.0. HomeBrew updated the symlink /usr/local/bin/pip3 to /usr/local/Cellar/python3/3.6.0/bin/pip3 but my /usr/local/bin/pip was still using the old script and it was pointing to the python interpreter at /usr/local/opt/python3/bin/python3.5.
My course of action was as follows:
Unlinked /usr/local/bin/pip and updated it to point /usr/local/Cellar/python3/3.6.0/bin/pip3.
Created a new symlink /usr/local/bin/pip3.5 that pointed to /usr/local/Cellar/python3/3.5.2/bin/pip3 and updated the header of pip3.5 script to point to the python interpreter at /usr/local/Cellar/python3/3.5.2/bin/python3.5
Followed the same procedure for virtualenv.
P.S. Initially I didn't face this problem with virtualenv since I was using it with the -p option.
I get a warning message while trying to create exectable file using pyinstaller. This warning appeared after installing Pillow. Previously i nevre got any warnings and was able to make it through.
the warning i get by pyinstaller is:
7314 INFO: Analyzing main.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/hooks/hook-PIL.Image.py:14: RuntimeWarning: Parent module 'PyInstaller.hooks.hook-PIL' not found while handling absolute import
from PyInstaller.hooks.shared_PIL_Image import *
Also when i tried to run the executable's exe/consol version of my code that lies inside the dist folder created by the pyinstaller (dist/main/main), these are displayed..
Traceback (most recent call last):
File "<string>", line 26, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/PIL.PngImagePlugin", line 40, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/PIL.Image", line 53, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 276, in load_module
exec(bytecode, module.__dict__)
File "/Users/..../build/main/out00-PYZ.pyz/FixTk", line 74, in <module>
OSError: [Errno 20] Not a directory: '/Users/.../dist/main/tcl'
logout
[Process completed]
so, i tried by uninstalling pillow, installing tk tcl dev version. And then installed pillow. Even that didnt helped.
I also tried reinstalling pyinstaller,. didnt help too
Update 1:
It seems Pyinstaller.hooks.hook-PIL.py file was missing in the Pyinstaller/hooks directory. And it was missing on all platforms(Mac, windows and linux). This is the warning/error message that i get on windows, which is the same i got on mac and on linux.
Later i found a link which said, its just to need Python import machinery happy. so i created as said so. Then i dont get the same error on all platforms, But on mac i still get the PILImagePlugin,Image and FixTk errors
Solution for tcl:
I found what was going wrong,.. Every problem that i faced on OSX was the OS itself(exactly the macport). Python by default comes with the mac OS. And this version of python may be useful for just learning basic python, but is not suitable for Development purpose.
Installing brew's python helped. I followed this SO link. After doing these i was still getting errors. Later i had to change the paths on /etc/paths. Basically rearranging them should work. But still then i wasn't getting it right.
Then i had to change the .bash_profile, which worked for most users, But still i was getting mac's version of python and pip, not the brews version of python.
Finally i had to restart the machine for a couple of times and do the /etc/paths and .bash_profile steps repeatedly to get the system wide effect to accept brews version of python and pip
Solution for PIL:
just adding a file called hook-PIL.py with an empty content would serve the purpose. I found a link which was having the hook files content of pyinstaller.
The location to create
for mac : /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller-2.1.1dev_-py2.7.egg/PyInstaller/hooks/ Actually for mac this step wouldn’t be required. When we install python through brew and change the path, everything that you try to install later either through pip install or from source packages tend to choose a different path. And everything will be taken care of.
for windows:C:\Python27\lib\site-packages\PyInstaller-2.1.1.dev0-py2.7.egg\PyInstaller\hooks
**Please check if this is a valid path on your machine before creating the file and then create the file. And im not sure or i don't know if just adding an empty file is the right way. But it worked for me