When I call the function get_monitors()
from screeninfo import get_monitors
monitors = get_monitors()
I keep getting this error:
Traceback (most recent call last):
File "C:/Users/User/manim/test1/functionTest.py", line 3, in <module>
monitors = get_monitors()
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\screeninfo\screeninfo.py", line 37, in get_monitors
raise ScreenInfoError("No enumerators available")
screeninfo.common.ScreenInfoError: No enumerators available
I've tried deleting ScreenInfo and reinstalling it, and installing some other
packages such as pynput to no success.
Maybe me using the kivy library did something?
Related
Hello Programmers of Stack overflow,
I am trying to import I library for my code, but whenever I execute my code on PyCharm, i get an error:
File "C:\Users\USER\projectextinguish\venv\lib\site-packages\command_runner\elevate.py", line 49, in <module>
raise ImportError(
ImportError: Cannot import ctypes for checking admin privileges on Windows plaform
Does anyone know how i can import ctypes?
I have no idea what to do.
code:
import os #self explainitory
from command_runner.elevate import elevate
def admin():
elevate(mainfirewall)
admin() # executes admin function
def mainfirewall ():
os.system("netsh advfirewall set allprofiles state off") # disables firewall
mainfirewall() #executes firewall function
I could reproduce the last part of your error message by installing command_runner and not installing pywin32. I got:
Traceback (most recent call last):
File "C:\Users\...\ess\venv\lib\site-packages\command_runner\elevate.py", line 43, in <module>
import win32event # monitor process
ModuleNotFoundError: No module named 'win32event'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\...\ess\venv\lib\site-packages\command_runner\elevate.py", line 49, in <module>
raise ImportError(
ImportError: Cannot import ctypes for checking admin privileges on Windows platform.
The first part of the stacktrace gives the cause: the pywin32 package is required to have the win32event module.
How to fix: install the missing package with pip install pywin32
I went on to my computer today to work on a code I had been chiseling away at for school. I clicked on my anaconda navigator, only for anaconda to quickly show up in my running task bar at the bottom of my screen then disappear. I read on a other post that perhaps my Macbook wasn't updated and that was affecting it. I updated my Macbook and when I went to my launchpad to open Anaconda, it had completely disappeared. I tried opening a terminal and running "Anaconda-navigator" and I got this:
(base) xxxxx-MBP:~ xxxxx$ anaconda-navigator
Traceback (most recent call last):
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/qtpy/__init__.py", line 199, in <module>
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/xxxxx/Desktop/anaconda3/bin/anaconda-navigator", line 7, in <module>
from anaconda_navigator.app.main import main
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/anaconda_navigator/app/main.py", line 22, in <module>
from anaconda_navigator.utils.conda import is_conda_available
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/anaconda_navigator/utils/__init__.py", line 15, in <module>
from qtpy.QtGui import QIcon
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/qtpy/__init__.py", line 205, in <module>
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
I'm quite concerned, as my code was important for school and I can't access it. I tried installing it, but it said Anaconda was still downloaded, but it is nowhere to be found in my downloads or applications. Also, I ran the command to show my packages and they were still installed.
I am currently trying to run a python script on a GCE virtual machine. However, I keep getting an error when using 'import cv2':
Traceback (most recent call last):
File "train.py", line 12, in <module> from deeplab.datasets import DataSetTrain, DataSetVal
File "/jet/prs/workspace/FYP-Project/Pytorch-Deeplab-master/deeplab/datasets.py", line 10, in <module>
import cv2
File "/jet/prs/workspace/lib/python3.6/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
The problem with this is that I have checked that the directory the file being referenced is present. I have installed and reinstalled cv2, however nothing seems to be working. None of the other modules that i installed using pip have this issue, it seems to only occur with cv2.
I recently rearranged some folders around and a python file I used to run is no longer working. When I try to run the file I get:
Traceback (most recent call last):
File "twitter_stream.py", line 9, in <module>
from tweepy import Stream
ImportError: No module named tweepy
I don't understand why I no longer have tweepy installed because I just had it When I do a simple 'pip3 install tweepy' I get:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pip3", line
7, in <module>
from pip import main
ImportError: cannot import name main
I'm not sure what happened here. Any help would be greatly appreciated
I am attempting to write a program that can pair to a game console via bluetooth and act as a controller for it. In order to do this, I have tried to install PyBlueZ, but I can get no further than import bluetooth, because it displays this error on my screen:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import bluetooth
File "C:\Python35\lib\bluetooth\__init__.py", line 39, in <module>
from bluetooth.msbt import *
File "C:\Python35\lib\bluetooth\msbt.py", line 2, in <module>
import bluetooth._msbt as bt
ImportError: No module named 'bluetooth._msbt'
Is this because of an error in my installation, or is the module just broken? In either case, is there a fix?