Can't seem to get the Python3 bindings for VLC functioning.
I'm doing pip3 install python_vlc which results in:
Collecting python-vlc
Installing collected packages: python-vlc
Successfully installed python-vlc-1.1.2
So, when I do import vlc it gives me the following error:
>>> import vlc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/vlc.py", line 173, in <module>
dll, plugin_path = find_lib()
File "/usr/local/lib/python3.5/site-packages/vlc.py", line 165, in find_lib
dll = ctypes.CDLL('libvlc.dylib')
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ctypes/__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libvlc.dylib, 6): image not found
I tried looking for a solution online, but can't seem to find the cause.
Alright, so I found the problem...
I tried uninstalling python-vlc via pip3 uninstall python-vlc and uninstall the VLC app with AppZapper to completely remove everything. After this I reinstalled it, it worked so I can do import vlc in commandline now.
Update: so after I did that I ran into another issue. I got this error: core libvlc error: No plugins found! Check your VLC installation.
Added the following line to my .bash_profile:
export VLC_PLUGIN_PATH=$VLC_PLUGIN_PATH:/Applications/VLC.app/Contents/MacOS/plugins
which fixed it.
Related
Operating system: Windows 10 Home
Python interpreter: Anaconda with python 3.8.8
I have installed the scipy module on anaconda using "conda install
scipy==1.6.2" and it states "# All requested packages already installed.". However, when I opened python ide and import scipy, the below error appears.
The way I try to solve is through reinstalling scipy module and "conda update --all". However, these all fails. Any ways to solve this issue. Thanks in advance.
import scipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\tys\.conda\envs\renv\lib\site-packages\scipy\__init__.py", line 130, in <module>
from . import _distributor_init
File "C:\Users\tys\.conda\envs\renv\lib\site-packages\scipy\_distributor_init.py", line 59, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\tys\.conda\envs\renv\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\tys\.conda\envs\renv\lib\site-packages\scipy\.libs\libbanded5x.3OIBJ6VWWPY6GDLEMSTXSIPCHHWASXGT.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.
You should try the solution given here (https://github.com/pytroll/satpy/issues/1835):
conda install -c defaults scipy
It worked for me.
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\speech_recognition\__init__.py", line 108, in get_pyaudio
import pyaudio
File "C:\Python39\lib\site-packages\pyaudio.py", line 116, in <module>
import _portaudio as pa
ModuleNotFoundError: No module named '_portaudio'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python39\yagmail.py", line 2, in <module>
import yagmail
File "C:\Python39\yagmail.py", line 5, in <module>
with sr.Microphone() as source:
File "C:\Python39\lib\site-packages\speech_recognition\__init__.py", line 79, in __init__
self.pyaudio_module = self.get_pyaudio()
File "C:\Python39\lib\site-packages\speech_recognition\__init__.py", line 110, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
I have installed Pyaudio for atleast a dozen times but it doesn`t work, my laptop is windows 10 64 bit, but why is port audio appeared in the error, I mean portaudio is related to mac, right? Why does it ask about portaudio? And also I have installed and uninstalled the pyaudio a dozen times at least. I installed it using pip, pipwin and what not.. and it's not only this one yagmail project, voice recognition and pyaudio related every project is showing the same error.
Please, help.
Method 1:
First:
pip install pipwin
then:
pipwin install pyaudio
Method 2:
First:
sudo apt-get install portaudio19-dev
Then:
git clone https://people.csail.mit.edu/hubert/git/pyaudio.git
Then:
python setup.py install //As you are on Windows
At Ubuntu 18.04 I successfully installed openalpr and tested it. Now I want to use python to call it. To do this, I installed https://pypi.org/project/openalpr/
pip install openalpr
But I'm having trouble with the paths, the ones in the example don't work.
alpr = Alpr("eu", "/etc/openalpr/openalpr.conf", "/usr/share/openalpr/runtime_data")
I get an error
>>> from openalpr import Alpr
>>> alpr = Alpr("eu", "/etc/openalpr/openalpr.conf", "/usr/share/openalpr/runtime_data")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/y700/Env/carplate/lib/python3.7/site-packages/openalpr/openalpr.py", line 95, in __init__
self._add_encoded_image_to_batch_func = self._openalprpy_lib.openalpr_add_encoded_image_to_batch
File "/home/y700/anaconda3/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
func = self.__getitem__(name)
File "/home/y700/anaconda3/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libopenalpr.so.2: undefined symbol: openalpr_add_encoded_image_to_batch
After a few hours of searching, I found a solution that doesn't require a package installation pip install openalpr
Go to the directory that holds the openaltr source code.
cd openalpr/src/bindings/python/
Run setup to install openalpr as a system-wide python package.
sudo python3 setup.py install
Start an interactive Python session.
python3
Create an alpr object to use.
from openalpr import Alpr
alpr = Alpr("us", "/etc/openalpr/openalpr.conf", "/usr/share/openalpr/runtime_data/")
I had this error but after manual openalpr install, and doing:
cd openalpr/src/bindings/python/
sudo python3 setup.py install
this fix worked OK for me.
I had some problems with upgrading matplotlib recently so I ended up installing different versions of Python on my Mac (Sierra) via brew, and then uninstalled afterwards. However, now matplotlib works (2.0.2) but whenever I run a particular python script that used to work I get an error which I didn't have before:
Traceback (most recent call last):
File "sim.py", line 254, in <module>
main()
File "sim.py", line 118, in main
db = shelve.open('.sim_balance', 'c')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 227, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/anydbm.py", line 84, in open
mod = __import__(result)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/dbhash.py", line 7, in <module>
import bsddb
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bsddb/__init__.py", line 67, in <module>
import _bsddb
ImportError: No module named _bsddb
According to my searches online this has something to do with my brew installed python interfering? I also deleted all my files in /Library/Python/2.7/site-packages yesterday which may have caused this as well.
I have tried homebrew brew install berkeley-db but then pip install bsddb3 yields:
Terrys-MBP:site-packages Terry$ pip install bsddb3
Collecting bsddb3
Using cached bsddb3-6.2.4.tar.gz
Complete output from command python setup.py egg_info:
Can't find a local Berkeley DB installation.
(suggestion: try the --berkeley-db=/path/to/bsddb option)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m5/1fg5rnj11_9cz5pntlqlwzyc0000gn/T/pip-build-elBAFK/bsddb3/
EDIT: Solved. Installed anaconda, installed bsddb via conda install and everything is working now.
Solved. I Installed anaconda, installed bsddb via conda install and everything is working now.
I am trying to build the HelloWorld example page from the Pyjamas example folder. However I am receiving this error when I run: sudo pyjsbuild helloworld.py. This error seems pretty universal to python as it seems to be related to the setup/configuration of my python environment. Any advice on where to look for the problem?
Here is the error
Traceback (most recent call last):
File "/usr/local/bin/pyjsbuild", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: six
After trying the various answers, it turns out pip was not properly installing the six package, whatever that is. So I ran sudo easy_install pip (--upgrade) to make sure the script configuration was right. It wrote some extra files so I assume that's why my next command sudo pip install six or sudo pip install six --upgrade worked. Now I ran into another error -_-, For anyone looking later: Runtime Error: Top module not found 'hello world'
Edit: The top module error is coming from trying to build into the output folder that is not pyjs/. All I had to do was move the folder up to pyjs/ folder in sitepackages/.