python > Selenium > Traceback - python

I tried a lot to fix Traceback Error
The same code is working in Pycharm , But when I put it in replit.com , is shows this Error
Python 3.8.2 (default, Feb 26 2020, 02:56:10)
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/xauth.py", line 43, in __init__
raw = open(filename, 'rb').read()
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.Xauthority'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 9, in <module>
import pyautogui
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyautogui/__init__.py", line 249, in <module>
import mouseinfo
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/protocol/display.py", line 60, in __init__
auth_name, auth_data = connect.get_auth(self.socket,
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/support/connect.py", line 91, in get_auth
return mod.get_auth(sock, dname, host, dno)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/support/unix_connect.py", line 103, in new_get_auth
au = xauth.Xauthority()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/xauth.py", line 45, in __init__
raise error.XauthError('~/.Xauthority: %s' % err)
Xlib.error.XauthError: ~/.Xauthority: [Errno 2] No such file or directory: '/home/runner/.Xauthority'
please help me

Try this:
sudo apt-get install xauth
If it doesn't work there are other answers to the problem in here

Related

How to fix AttributeError with ImageTk and Tkinter in python3.6?

Traceback (most recent call last):
File "C:/Users/Murad/PycharmProjects/OmrTest/images/GUI.py", line 765, in <module>
obj = Login(master)
File "C:/Users/Murad/PycharmProjects/OmrTest/images/GUI.py", line 35, in __init__
self.bg = ImageTk.PhotoImage(file="unnamed.png")
File "C:\Users\Murad\PycharmProjects\OmrTest\venv\lib\site-packages\PIL\ImageTk.py", line 89, in __init__
image = _get_image_from_kw(kw)
File "C:\Users\Murad\PycharmProjects\OmrTest\venv\lib\site-packages\PIL\ImageTk.py", line 58, in _get_image_from_kw
return Image.open(source)
File "C:\Users\Murad\PycharmProjects\OmrTest\venv\lib\site-packages\PIL\Image.py", line 2904, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'unnamed.png'
Exception ignored in: <bound method PhotoImage.__del__ of <PIL.ImageTk.PhotoImage object at 0x000002A705690748>>
Traceback (most recent call last):
File "C:\Users\Murad\PycharmProjects\OmrTest\venv\lib\site-packages\PIL\ImageTk.py", line 118, in __del__
name = self.__photo.name
AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo'
So I was doing a project in pycharm. how do I Solve this problem?
line 35, init self.bg = ImageTk.PhotoImage(file="unnamed.png")
Where is the file unnanmed.png located?
Use :
self.bg= ImageTk.PhotoImage(Image.open(file_path))
file_path should be full or relative path of the file if it is not in the root directory.

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

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!

AttributeError when running rqt commands

I am trying to use rqt in ROS hydro but I see the following errors:
Traceback (most recent call last): File
"/opt/ros/hydro/bin/rqt_graph", line 8, in
sys.exit(main.main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph')) File
"/opt/ros/hydro/lib/python2.7/dist-packages/rqt_gui/main.py", line 59,
in main
return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider,
plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH'])))
File "/opt/ros/hydro/lib/python2.7/dist-packages/qt_gui/main.py", line
336, in main
from python_qt_binding import QT_BINDING File "/opt/ros/hydro/lib/python2.7/dist-packages/python_qt_binding/init.py",
line 55, in
from .binding_helper import loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION # #UnusedImport File
"/opt/ros/hydro/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py",
line 265, in
getattr(sys, 'SELECT_QT_BINDING_ORDER', None), File "/opt/ros/hydro/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py",
line 84, in _select_qt_binding
QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File
"/opt/ros/hydro/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py",
line 139, in _load_pyqt
_named_import('PyQt4.%s' % module_name) File "/opt/ros/hydro/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py",
line 106, in _named_import
module = builtins.import(name) AttributeError: 'module' object has no attribute 'import'

Can not import theano after installation windows 10

I've still not been able to resolve this problem, after working on it for a week.
I'm thinking of giving up and just running theano on a virutal machine; there just doesn't seem to be any support out there for Windows 10!
Or am I wrong; is there an easy fix to this?
>>> import theano
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 75, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 92, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1784, in _try_compile_tmp
os.remove(exe_path + ".exe")
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\cturn\\AppData\\Local\\Temp\\try_march_3v6ffkv9.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\__init__.py", line 66, in <module>
from theano.compile import (
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\__init__.py", line 10, in <module>
from theano.compile.function_module import *
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\function_module.py", line 21, in <module>
import theano.compile.mode
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\compile\mode.py", line 10, in <module>
import theano.gof.vm
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\vm.py", line 659, in <module>
from . import lazylinker_c
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\lazylinker_c.py", line 125, in <module>
args = cmodule.GCC_compiler.compile_args()
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 2088, in compile_args
default_compilation_result, default_execution_result = try_march_flag(GCC_compiler.march_flags)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1856, in try_march_flag
flags=cflags, try_run=True)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 2188, in try_compile_tmp
comp_args)
File "C:\Users\cturn\Anaconda3\lib\site-packages\theano\theano\gof\cmodule.py", line 1789, in _try_compile_tmp
err += "\n" + str(e)
TypeError: can't concat bytes to str
Um, can't concat bytes to str? What does this mean?
The error you are experiencing appears to result from another sub-process utilizing the same resources as the script you are attempting to write. Although it sounds trivial, I would recommend making sure that you have admin privileges, or at least privileges to the desired resources, and/or restart your computer to kill the sub-process using that module. You could also look in the task manager and kill any/all other processes using python, but that might take longer.
(This may be the program using the "resource" try_march_3v6ffkv9.exe)

Python: Broken Pipe Error For PyNomo Example (in function Nomographer)

I am using pycharm on Python 2.7. I have installed PyNomo. I am trying to run this small example from the official site. Code is available on the link, I have simply copy pasted it. I get the following error:
Aligning with tag A
Traceback (most recent call last):
File "/home/darshil/Desktop/Caltech Summer Internship/Radiation Ononcology Data/DB/rad3/pynomo_temp.py", line 71, in <module>
Nomographer(main_params)
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomographer.py", line 203, in __init__
wrapper.draw_nomogram(c,params['post_func'])
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 213, in draw_nomogram
block.draw(canvas)
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 445, in draw
atom.draw(canvas)
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 2503, in draw
axis_appear=p,base_start=base_start,base_stop=base_stop)
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_axis.py", line 123, in __init__
self.draw_axis(canvas)
File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_axis.py", line 1067, in draw_axis
c.text(x,y,ttext,attr+[text_color])
File "/usr/local/lib/python2.7/dist-packages/pyx/canvas.py", line 324, in text
return self.insert(self.texrunner.text(x, y, atext, *args, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 1194, in text
self.execute(expr, self.defaulttexmessagesdefaultrun + self.texmessagesdefaultrun + texmessages)
File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 951, in execute
self.defaulttexmessagesstart + self.texmessagesstart)
File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 1005, in execute
self.texinput.write(self.expr)
IOError: [Errno 32] Broken pipe
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 748, in _cleantmp
texrunner.texinput.write("\n\\end\n")
IOError: [Errno 32] Broken pipe
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 748, in _cleantmp
texrunner.texinput.write("\n\\end\n")
IOError: [Errno 32] Broken pipe
Process finished with exit code 1
The error is in the final line of the code:
Nomographer(main_params)
I have looked at other questions with "broken pipe error": here,here, and here. But none of them are helpful to me.
Any indication on how to solve would be very helpful.
PyNomo uses a TeX installation to typeset text. Maybe this is missing resulting in a broken pipe. You need to be able to run a file hello.tex with the content Hello, world!\bye on a command line tex hello.tex. It should result in a file hello.dvi. If not you need to install a TeX distribution like TeXLive.

Categories

Resources