Whenever I run python I get this error message:
Error processing line 1 of D:\Users\RBS\AppData\Local\Programs\Python\Python310\lib\site-packages\vision-1.0.0-py3.10-nspkg.pth:
Traceback (most recent call last):
File "D:\Users\RBS\AppData\Local\Programs\Python\Python310\lib\site.py", line 186, in addpackage
exec(line)
File "", line 1, in
File "", line 568, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'
What is this error and how to fix it?
Sounds a lot like what I saw at: AttributeError: 'NoneType' object has no attribute 'loader'
Based on their comments what worked for me was going to C:\Users\"username"\anaconda3\envs\"Project name" then looking for a file called "vision-1.0.0-py3.7-nspkg.pth" and deleting it.
Ran into this post before having seen the other one, thought I'd share. Solved the error for me but not sure if removing the files would give any sort of problem later on.
Related
I keep getting the error listed below. The problem isn't that there's an error. It's that the segment of code that is throwing the error no longer exists. I modified it to address the error. It now calls a method .cooridnates() rather than the propery .extent, but it seems to keep running the old code some how (shown in bold). I tried swapping out my IDE and restarting the machine, but still nothing. It's not currently tracked in a repo. So I'm out of ideas. It's a windows 10 machine.
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 183, in __getattr__
return self.__getitem__(name)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 190, in __getitem__
return dict.__getitem__(self, k)
KeyError: 'extent'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \\rcnas01-smb\NRM_DataTeam\e_Scripts\~DS\Defensible_space_pre_inspection_form_export_2022_20211029.py, line 192, in <module>
map_server_response = temp.site_map(item_webmap, 'Asset Centroid', "ASSET_NAME = '{}'".format(which_one))
File \\rcnas01-smb\NRM_DataTeam\e_Scripts\template_fxn.py, line 154, in site_map
**extent = sdf_zoomer.spatial.bbox.buffer(400).extent**
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 186, in __getattr__
"'%s' object has no attribute '%s'" % (type(self).__name__, name)
AttributeError: 'Geometry' object has no attribute 'extent'
Thanks everyone for the replies. I figured out the issue. Some how an old copy of the imported function library was saved in another directory that was also appended in. The program refenerced the first appended path with the old file first. So as I update the script the program continue to used the old copy.
Whenever I try to use this looping functionality, it gives me an error that has lines that are further than the end of my code. I am fairly new to python and coding in general, but I think this is part of a repository I downloaded. The error code looks like this
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 603, in run
self._do_run()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 590, in _do_run
data = self.source.read()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 543, in read
ret = self.original.read()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 228, in read
ret = self._stdout.read(OpusEncoder.FRAME_SIZE)
AttributeError: 'NoneType' object has no attribute 'read'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 616, in _call_after
self.after(error)
File "main.py", line 242, in play_next_song
raise VoiceError(str(error))
VoiceError: 'NoneType' object has no attribute 'read'
My Entire code block is here. I am trying to host this discord bot in repl.it, if that has anything to do with it.
Any help would be appreciated, Thanks!
The relevant part of the stacktrace is actually the last one:
File "main.py", line 242, in play_next_song
raise VoiceError(str(error))
VoiceError: 'NoneType' object has no attribute 'read'
You cannot use the same FFmpegPCMAudio object twice. You have the create a new one.
I'm getting the following error when I try to commit on Kaggle.
Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/opt/conda/lib/python3.6/logging/__init__.py", line 1944, in shutdown h.flush() File "/opt/conda/lib/python3.6/site-packages/absl/logging/__init__.py", line 882, in flush self._current_handler.flush() File "/opt/conda/lib/python3.6/site-packages/absl/logging/__init__.py", line 776, in flush self.stream.flush() File "/opt/conda/lib/python3.6/site-packages/ipykernel/iostream.py", line 341, in flush if self.pub_thread.thread.is_alive(): AttributeError: 'NoneType' object has no attribute 'thread'
Does anyone know how to solve this?
Thanks.
I think this is an ipykernel related issue that has an upstream fix which hasn't been packaged into a release yet. So you might have to wait.
You wrote something like y = x.thread or x.thread() The problem is, x was None. None doesn't have a member variable named "thread"
I am having trouble with the pysmt solvers. I am getting the following error message:
AttributeError: 'module' object has no attribute 'Z3_mk_and'
whenever I try to both:
(1) Instantiate a solver via Solver() and
(2) Run pysmt-install --check
Here is the full stack trace, incited from method 1:
Traceback (most recent call last):
File "ex.py", line 15, in <module>
solver = s.Solver()
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/shortcuts.py", line 910, in Solver
return get_env().factory.Solver(name=name,
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/environment.py", line 158, in factory
self._factory = pysmt.factory.Factory(self)
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/factory.py", line 86, in __init__
self._get_available_solvers()
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/factory.py", line 222, in _get_available_solvers
from pysmt.solvers.z3 import Z3Solver
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/solvers/z3.py", line 295, in <module>
class Z3Converter(Converter, DagWalker):
File "/Users/harper/anaconda2/lib/python2.7/site-packages/pysmt/solvers/z3.py", line 859, in Z3Converter
walk_and = make_walk_nary(z3.Z3_mk_and)
AttributeError: 'module' object has no attribute 'Z3_mk_and'
I've tried so much to fix this, like uninstalling and reinstalling z3 (supposedly successfully), and pip installing z3-solver (which fails), and I can't figure out what's wrong.
Please note that the proper way to install a solver for pysmt is through pysmt-install. This guarantees that the version of the solver has been tested.
This has nothing really to do with z3; but rather directly with pysmt itself. Most likely pysmt isn't keeping up-to-date with changes in z3. You should file a ticket directly at their site: https://github.com/pysmt/pysmt/issues
I am trying to do grass scripting in Eclipse and i follow the instructions outlined in this page. I think i have everything configured however when i try to import grass.script i get the following message:
Traceback (most recent call last):
File "/home/nesic/Desktop/grass_dev/Simulacije/test.py", line 6, in <module>
import grass.script as grass
File "/usr/lib/grass64/etc/python/grass/script/__init__.py", line 1, in <module>
from core import *
File "/usr/lib/grass64/etc/python/grass/script/core.py", line 38, in <module>
gettext.install('grasslibs', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
File "/usr/local/lib/python2.6/posixpath.py", line 67, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
What am I doing wrong?
os.getenv("GISBASE") most likely returns None, because the envorinment variable GISBASE is not set. That then leads to the AttributeError: 'NoneType' object has no attribute 'endswith' you're seeing.
Try setting GISBASE according to http://grass.osgeo.org/grass70/manuals/variables.html:
GISBASE
directory where GRASS lives. This is set automatically by the startup script.
(BTW, if you don't know about it already, there's also gis.stackexchange.org)