ImportError *.so: no suitable image found - python

I need to change the tempo of a song for a project and I would like to use the echonest's python library remix.
However, when I run, for example, the following command:
python beatshift.py "01 - I Saw Her Standing There.mp3" out.mp3
I get this error:
Traceback (most recent call last): File "beatshift.py", line 19, in
<module>
from echonest.remix import audio, modify File "build/bdist.macosx-10.6-x86_64/egg/echonest/remix/modify.py", line
11, in <module> File
"build/bdist.macosx-10.6-x86_64/egg/soundtouch.py", line 7, in
<module> File "build/bdist.macosx-10.6-x86_64/egg/soundtouch.py",
line 6, in bootstrap ImportError:
dlopen(/Users/JL/.python-eggs/remix-2.4.0-py2.7-macosx-10.6-x86_64.egg-tmp/soundtouch.so,
2): no suitable image found. Did find:
/Users/JL/.python-eggs/remix-2.4.0-py2.7-macosx-10.6-x86_64.egg-tmp/soundtouch.so:
mach-o, but wrong architecture
Do you know what can I do to solve it?

Related

using Textatistic: OSError: Cannot load hyphen dictionary

I am trying to use Textatistic. However it curs a error and I have am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.
The source code is
from pathlib import Path
import textatistic
text = Path('Robinson Crusoe.txt').read_text(encoding='utf-8')
readability = textatistic.Textatistic(text)
print(readability.dict())
Traceback (most recent call last):
File "D:\anaconda3\lib\site-packages\hyphen\hyphenator.py", line 60, in __init__
self.__hyphenate__ = hnj.hyphenator_(file_path,
OSError: Cannot load hyphen dictionary.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Demos\python_demo\main.py", line 2, in <module>
import textatistic
File "D:\anaconda3\lib\site-packages\textatistic\__init__.py", line 27, in <module>
from .textatistic import *
File "D:\anaconda3\lib\site-packages\textatistic\textatistic.py", line 39, in <module>
class Textatistic(object):
File "D:\anaconda3\lib\site-packages\textatistic\textatistic.py", line 42, in Textatistic
def __init__(self, text, abbr=Abbreviations(), hyphen=Hyphenator('en_US'), easy=EasyWords()):
File "D:\anaconda3\lib\site-packages\hyphen\hyphenator.py", line 64, in __init__
raise RuntimeError(f'C extension raised error \
RuntimeError: C extension raised error when initializing Hyphenator for dictionary at C:\Users\root\AppData\Local\pyhyphen\hyph_en_US.dic
Please tell me how to do!

can't make imports

my project can't make import idk why
the error is showing
seifahmed15#Ubuntu:~/Desktop/DAC-master$ python3 main.py
Traceback (most recent call last):
File "/home/seifahmed15/Desktop/DAC-master/main.py", line 2, in <module>
from user import create
File "/home/seifahmed15/Desktop/DAC-master/user.py", line 5, in <module>
import hcaptcha
File "/home/seifahmed15/Desktop/DAC-master/hcaptcha.py", line 6, in <module>
from seleniumwire.undetected_chromedriver import Chrome
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/undetected_chromedriver/__init__.py", line 9, in <module>
from seleniumwire.webdriver import Chrome
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/webdriver.py", line 13, in <module>
from seleniumwire import backend
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/backend.py", line 4, in <module>
from seleniumwire.server import MitmProxy
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/server.py", line 4, in <module>
from seleniumwire.handler import InterceptRequestHandler
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/handler.py", line 5, in <module>
from seleniumwire import har
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/har.py", line 11, in <module>
from seleniumwire.thirdparty.mitmproxy import connections
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/connections.py", line 9, in <module>
from seleniumwire.thirdparty.mitmproxy.net import tls, tcp
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
^^^^^^^^^^^^^^^^
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?
i have reinstall python and tried to install pkg manually
i have searched on google and YouTube and i didn't find any thing
The console message below offers a bit more context on one issue, specifically on line 43:
File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
^^^^^^^^^^^^^^^^
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?
It looks like you may have a typo in the area below:
"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS)
As the error message tells us:
'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?
You could try revising like below:
"SSLv2": (SSL.SSLv23_METHOD, BASIC_OPTIONS)
The other text in your console log appears to be showing the full stack trace - There may be an error elsewhere, but the error message you posted seems to be referencing that specific error on line 43.
The thread below may help a bit with handling the stack trace and debugging further:
Get exception description and stack trace which caused an exception, all as a string

ValueError with NERDA model import

I'm trying to import the NERDA library in order use it to engage in a Named-Entity Recognition task in Python. I initially tried importing the library in a jupyter notebook and got the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\NERDA\models.py", line 13, in <module>
from .networks import NERDANetwork
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\NERDA\networks.py", line 4, in <module>
from transformers import AutoConfig
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\transformers\__init__.py", line 43, in <module>
from . import dependency_versions_check
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\transformers\dependency_versions_check.py", line 36, in <module>
from .file_utils import is_tokenizers_available
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\transformers\file_utils.py", line 51, in <module>
from huggingface_hub import HfApi, HfFolder, Repository
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\huggingface_hub\__init__.py", line 31, in <module>
from .file_download import cached_download, hf_hub_url
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\huggingface_hub\file_download.py", line 37, in <module>
if tuple(int(i) for i in _PY_VERSION.split(".")) < (3, 8, 0):
File "C:\Users\oefel\AppData\Local\Programs\Python\Python38\lib\site-packages\huggingface_hub\file_download.py", line 37, in <genexpr>
if tuple(int(i) for i in _PY_VERSION.split(".")) < (3, 8, 0):
ValueError: invalid literal for int() with base 10: '6rc1'
I then tried globally installing using pip in gitbash and got the same error. The library appeared to install without error but when I try the following import, I get that same ValueError:
from NERDA.models import NERDA
I've also tried some of the pre-cooked model imports and gotten the same ValueError.
from NERDA.precooked import EN_ELECTRA_EN
from NERDA.precooked import EN_BERT_ML
I can't find anything on this error online and am hoping someone may be able to lend some insight? Thanks so much!
Take a look at the source code of the used huggingface_hub lib. They comparing the version of your python version to do different imports.
But you uses a release candidate python version (this tells the value '6rc1', that caused the error). Because they didn't expect/handle this, you get the int-parse-ValueError.
Solution 1:
Update your python version to a stable version. No release candidate. So you have an int-only version number.
Solution 2:
Monkeypatch sys.version, before you import the NERDA libs.
sys.version = '3.8.0'

ebook-convert spits out python error? Can someone understand the error?

I want to run ebook-convert together with Gitbook to produce my own pdf-files from my static files. When I just type ebook-convert I get this silly error messageā€¦
I installed
a fresh version of python
installed convert-ebook with NPM
and Gitbook is running perfectly
Does anyone know what I could do?
Python function terminated unexpectedly: dlopen(/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so
Traceback (most recent call last):
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 209, in main
return run_entry_point()
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 113, in run_entry_point
pmod = __import__(mod, fromlist=[1], level=0)
File "site-packages/calibre/__init__.py", line 22, in <module>
File "site-packages/calibre/startup.py", line 51, in <module>
File "site-packages/calibre/ptempfile.py", line 8, in <module>
File "lib/python2.7/tempfile.py", line 32, in <module>
File "lib/python2.7/io.py", line 51, in <module>
ImportError: dlopen(/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so
I ran into the same problem and fixed it by updating Python from version 2.7.10 to 2.7.11.
I use my system python lib-dynload/_io.so replace with the
/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload/_io.so
then it works, hope it can help you.
tks

Python makes lib error when making FireFox Sync 1.5

I've tried to make my own server to new sync service in FireFox.
I used the following tutorial: https://docs.services.mozilla.com/howtos/run-sync-1.5.html .
When I wanted to check it by using make test I got the following error:
Traceback (most recent call last):
File "/home/jj/syncserver/local/local/lib/python2.7/site-packages/nose/loader.py", line 403, in loadTestsFromName
module = resolve_name(addr.module)
File "/home/jj/syncserver/local/local/lib/python2.7/site-packages/nose/util.py", line 311, in resolve_name
module = __import__('.'.join(parts_copy))
File "/home/jj/syncserver/local/local/lib/python2.7/site-packages/syncstorage/__init__.py", line 5, in <module>
import mozsvc.config
File "/home/jj/syncserver/local/local/lib/python2.7/site-packages/mozsvc/config.py", line 10, in <module>
from konfig import Config, SettingsDict
File "/home/jj/syncserver/local/local/lib/python2.7/site-packages/konfig/__init__.py", line 11, in <module>
from configparser import ConfigParser, ExtendedInterpolation
ImportError: cannot import name ExtendedInterpolation
What's happened?
configparser.ExtendedInterpolation does not exist in Python 2.
You need to use Python 3.

Categories