Python-Bitcoinlib - FileNotFoundError: Could not find module 'libeay32' - python

I suspect this is a bit of a newb question, but I'm trying to run the following code using IDLE Shell 3.9.1:
from bitcoin.rpc import RawProxy
p = RawProxy()
info = p.getblockchaininfo()
print(info['blocks'])
And I am getting the following error:
Traceback (most recent call last):
File "C:\Users\Zack\Documents\Python\Scripts\crypto1.py", line 1, in <module>
from bitcoin.rpc import RawProxy
File "C:\Users\Zack\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bitcoin\rpc.py", line 48, in <module>
from bitcoin.wallet import CBitcoinAddress, CBitcoinSecret
File "C:\Users\Zack\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bitcoin\wallet.py", line 33, in <module>
import bitcoin.core.key
File "C:\Users\Zack\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bitcoin\core\key.py", line 34, in <module>
_ssl = ctypes.cdll.LoadLibrary(ctypes.util.find_library('ssl') or 'libeay32')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libeay32' (or one of its dependencies). Try using the full path with constructor syntax.
Any thoughts on how to get beyond this? Thanks for your help!

Related

Unable to Import Spacy or Download Models

I recently tried to install the spaCy module for Python 3.7. The installation looks like it runs successfully (shows no errors), but when I try to import spaCy, or when I try to install spaCy models, I get the error below. I'm totally lost; please help!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\__init__.py", line 14, in <module>
from . import pipeline # noqa: F401
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\pipeline\__init__.py", line 1, in <module>
from .attributeruler import AttributeRuler
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\pipeline\attributeruler.py", line 6, in <module>
from .pipe import Pipe
File "spacy\pipeline\pipe.pyx", line 1, in init spacy.pipeline.pipe
File "spacy\strings.pyx", line 15, in init spacy.strings
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\util.py", line 1635, in <module>
default_error_handler: Callable[[str, "Pipe", List["Doc"], Exception], NoReturn],
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\typing.py", line 755, in __getitem__
return self.__getitem_inner__(params)
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\typing.py", line 251, in inner
return func(*args, **kwds)
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\typing.py", line 774, in __getitem_inner__
result = _type_check(result, msg)
File "C:\Users\mjrei\AppData\Local\Programs\Python\Python37\lib\typing.py", line 135, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.NoReturn is not valid as type argument

Why I am getting error in the pyzbar module while using this library it in the QRCode scanning project?

ERROR IS :
Traceback (most recent call last):
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 58, in load
dependencies, libzbar = load_objects(Path(''))
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
deps = [
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp>
cdll.LoadLibrary(str(directory.joinpath(dep)))
File "C:\Users\kalep\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "C:\Users\kalep\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "P:\Prashant\CPP Project Planning\Rooturaj CPP PRoject\Attendance\attend.py", line 3, in <module>
from pyzbar .pyzbar import decode
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\pyzbar.py", line 7, in <module>
from .wrapper import (
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\wrapper.py", line 151, in <module>
zbar_version = zbar_function(
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\wrapper.py", line 148, in zbar_function
return prototype((fname, load_libzbar()))
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 60, in load
dependencies, libzbar = load_objects(Path(__file__).parent)
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 54, in load_objects
libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))
File "C:\Users\kalep\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "C:\Users\kalep\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.
I am creating project on attendance system using QR Code scanning and I use Python to create it.
I used all needed libraries in the program
like, cv2, numpy, pybase64, pyzbar.
But I am getting this above Error in the Pyzbar.
I got solution for this issue. I was facing similar issue just installed Visual C++ 64 bit version on my computer and restarted. Choose between vcredist_x86.exe or vcredist_x64.exe based on your machine.
https://www.microsoft.com/en-us/download/confirmation.aspx?id=40784. Hope this solves your issue as well.

ImportError: cannot import name 'dump_csp_header' from 'werkzeug.http' (C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\http.py)

I am getting this error by running tenserbord
(base) C:\Users\karan\TF_2_Notebooks_and_Data\03-ANNs>tensorboard
--logdir logs\fit Traceback (most recent call last): File "C:\Users\karan\Anaconda3\Scripts\tensorboard-script.py", line 5, in
from tensorboard.main import run_main File "C:\Users\karan\Anaconda3\lib\site-packages\tensorboard\main.py", line
40, in
from tensorboard import default File "C:\Users\karan\Anaconda3\lib\site-packages\tensorboard\default.py",
line 38, in
from tensorboard.plugins.audio import audio_plugin File "C:\Users\karan\Anaconda3\lib\site-packages\tensorboard\plugins\audio\audio_plugin.py",
line 23, in
from werkzeug import wrappers File "C:\Users\karan\Anaconda3\lib\site-packages\werkzeug__init__.py",
line 151, in
import('werkzeug.exceptions') File "C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\exceptions.py",
line 71, in
from werkzeug.wrappers import Response File "C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\wrappers__init__.py",
line 26, in
from .common_descriptors import CommonRequestDescriptorsMixin File
"C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\wrappers\common_descriptors.py",
line 7, in
from ..http import dump_csp_header ImportError: cannot import name 'dump_csp_header' from 'werkzeug.http'
(C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\http.py)
and also by running,
board = TensorBoard(log_dir=log_directory,histogram_freq=1,
write_graph=True,
write_images=True,
update_freq='epoch',
profile_batch=2,embeddings_freq=1)
if I put embeddings_freq=1 instead of embeddings_freq=0 then I get an error
Train on 426 samples, validate on 143 samples Traceback (most recent
call last):
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\callbacks.py",
line 1561, in _configure_embeddings
from tensorboard.plugins import projector
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorboard\plugins\projector__init__.py",
line 32, in
from tensorboard.plugins.projector import projector_plugin as _projector_plugin
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorboard\plugins\projector\projector_plugin.py",
line 30, in
from werkzeug import wrappers
File
"C:\Users\karan\Anaconda3\lib\site-packages\werkzeug__init__.py",
line 151, in
import('werkzeug.exceptions')
File
"C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\exceptions.py",
line 71, in
from werkzeug.wrappers import Response
File
"C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\wrappers__init__.py",
line 26, in
from .common_descriptors import CommonRequestDescriptorsMixin
File
"C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\wrappers\common_descriptors.py",
line 7, in
from ..http import dump_csp_header
ImportError: cannot import name 'dump_csp_header' from 'werkzeug.http'
(C:\Users\karan\Anaconda3\lib\site-packages\werkzeug\http.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 5, in
callbacks=[board,early_stop]
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\engine\training.py",
line 819, in fit
use_multiprocessing=use_multiprocessing)
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py",
line 307, in fit
mode=ModeKeys.TRAIN)
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\callbacks.py",
line 107, in configure_callbacks
callback_list.set_model(callback_model)
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\callbacks.py",
line 222, in set_model
callback.set_model(model)
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\callbacks.py",
line 1549, in set_model
self._configure_embeddings()
File
"C:\Users\karan\Anaconda3\lib\site-packages\tensorflow_core\python\keras\callbacks.py",
line 1563, in _configure_embeddings
raise ImportError('Failed to import TensorBoard. Please make sure that '
ImportError: Failed to import TensorBoard. Please make sure that
TensorBoard integration is complete."
What should I do> I am not an expert just a beginner, and I didn't create an anaconda env, I am running it in a (base), can someone please reply it fast? My exams are coming and I need to resolve this as fast it could be, my thanks to the community.

escpos erro 'usb_detach_kernel_driver_np' not found

I try to print a ticket in a thermal printer. I use module escpos
but when I run the script in Windows it sends me the following error
Traceback (most recent call last):
File "C:\Users\Angel\Desktop\Escritorio\impreimer.py", line 5, in <module>
Epson = printer.Usb(0x1a86,0x7584,1)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 51, in __init__
self.open()
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 68, in open
self.device.detach_kernel_driver(0)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\core.py", line 1077, in detach_kernel_driver
interface)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\backend\libusb0.py", line 606, in detach_kernel_driver
_check(_lib.usb_detach_kernel_driver_np(dev_handle, intf))
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'usb_detach_kernel_driver_np' not found
[Finished in 0.5s with exit code 1]
and this is my code:
import sys
from escpos import *
pr = printer.Usb(0x1a86,0x7584)
How can i fix this?
try this.
pr = printer.Usb(0x1a86,0x7584, interface=0, in_ep=0x82, out_ep=0x02)
if you are using Windows you need use programs like zadig or LibusbK and install filters.
https://zadig.akeo.ie/
http://libusbk.sourceforge.net/UsbK3/index.html

Importing a resource file

I'm having trouble removing a resource file in a pyqt document, I'm also using monkeystudio IDE. I madea program with images and all linked to a resource file called "resources.qyc" and now I get the error
Traceback (most recent call last):
File "main.py", line 9, in <module>
from Login import Login
File "J:\Newone\Login.py", line 3, in <module>
import mainwindow
File "J:\Newone\mainwindow.py", line 2, in <module>
import Addcadet
File "J:\Newone\Addcadet.py", line 6, in <module>
( Ui_Addcadet, QDialog ) = uic.loadUiType( 'Addcadet.ui' )
File "C:\Python32\lib\site-packages\PyQt4\uic\__init__.py", line 203, in loadUiType
exec(code_string.getvalue(), ui_globals)
File "<string>", line 179, in <module>
ImportError: No module named resources_rc
You'll first have to compile the resource file using pyrcc4. You'll run something like this from command line:
pyrcc4 ResourceFile.qrc -o ui_ResourceFile.py

Categories

Resources