answer How can I solve this kernal error in Jupyter on anaconda - anaconda

I didn't change anything but today i got this error when i try to use conda.
Error processing line 3 of D:\anaconda\lib\site-packages\googleapis_common_protos-1.53.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "D:\anaconda\lib\site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 553, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'

edit googleapis_common_protos-1.53.0-py3.9-nspkg.pth
search for "os;" and add a carriage return after it.

Related

Anaconda broke itself upon updating

So, Anaconda suggested me to do a conda update -n base -c defaults conda after I created a new environment, which I did. It ran for a few minutes, with huge amounds of warnings saying it couldn't delete some files. Then stopped, and now everything is broken.
I cannot update anaconda anymore, I cannot run conda info nor conda env list, I can't do anything. I can't use my envs through VScode either for example.
The output of conda info is:
>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1082, in __call__
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 87, in _main
exit_code = do_call(args, p)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\index.py", line 15, in <module>
from .subdir_data import SubdirData, make_feature_record
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 54, in <module>
from conda_content_trust.common import (
File "C:\ProgramData\Anaconda3\lib\site-packages\conda_content_trust\common.py", line 63, in <module>
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\hazmat\primitives\asymmetric\ed25519.py", line 8, in <module>
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\exceptions.py", line 16, in <module>
class _Reasons(utils.Enum):
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\utils.py", line 115, in __getattr__
obj = getattr(self._module, attr)
AttributeError: module 'cryptography.utils' has no attribute 'Enum'
$ C:\ProgramData\Anaconda3\Scripts\conda-script.py info
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
I tried to install conda install anaconda-clean to erase it all cleanly, but I get the same error (cryptography).
It is really a problem in a moment when I need a functional python fast.
I am on Windows 10.
I am not so familiar with conda's inner working on a low level.
Please advise.
Thanks

Error while running ARA server on Alpine linux

I am trying to install the latest version of the Ansible Records Analyzer server on an alpine Linux I made sure that all requirements are well installed ( Django, GCC,python3, Pypi, ansible) the install went well except for a warning about the absence of root PATH on the PATH variable which I fixed:
The warning :
WARNING: The script pbr is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The fix:
~ # export PATH=/root/.local/bin:$PATH
So following the install guide on this step that intends to run the server I have an avalanche of errors as if the run command doesn't find the needed components to be executed although I'm sure all the components are installed :
~ # ara-manage runserver
[ara] No setting found for SECRET_KEY. Generating a random key...
Traceback (most recent call last):
File "/root/.local/bin/ara-manage", line 8, in <module>
sys.exit(main())
File "/root/.local/lib/python3.8/site-packages/ara/server/__main__.py", line 41, in main
if not os.path.exists(settings.ARA_SETTINGS):
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.local/lib/python3.8/site-packages/ara/server/settings.py", line 263, in <module>
ALLOWED_HOSTS=ALLOWED_HOSTS.to_list(),
AttributeError: 'list' object has no attribute 'to_list'
What could be the reason behind this behavior?
Well I managed to overcome this issue, the problem was in dynaconf the current version 3.1.3 doesn't read the conf files properly which fails in the server run.
Meanwhile, the only workaround is to install the previous version of dynaconf :
pip install 'dynaconf==3.1.2'
FYI dynaconf already has a fix proposed for the regression: rochacbruno/dynaconf#541
I've tested that it does resolve this issue and it will be released in dynaconf 3.1.4 soon.

ModuleNotFound error after sucessfully install cgal using conda?

I installed CGAL in windows using conda:
https://anaconda.org/conda-forge/cgal
But it gives error during importing modules.
>>> import CGAL
>>> print(CGAL.__version__)
4.14.0
>>> import CGAL.CGAL_AABB_tree
Traceback (most recent call last):
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 17, in <module>
_CGAL_AABB_tree = swig_import_helper()
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 16, in swig_import_helper
return importlib.import_module('_CGAL_AABB_tree')
File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_CGAL_AABB_tree'
The issue is not the ModuleNotFoundError, but the underlying ImportError: DLL load failed:. Looking at your error message, you can see that your python does succesfully locate what you are trying to import at
C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py
but fails to load a dependent DLL.
I have reproduced your issue. It seems to be one that only effects the most current of cgal in conda forge, which is 4.14 When you install the 4.13 version everything works fine, so simply do:
conda remove cgal
conda install -c conda-forge cgal==4.13
I have created an issue on the conda-forge feedstock

i am trying to convert text to speech using pyttsx3 in python. but i am getting the error maybe on driverName

i am trying to convert text to speech using pyttsx3 in python. but i am getting the error maybe on driverName.
Here is my code
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
Here is the Output which gives error.
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
============ RESTART: D:/abhi/My Program/text-to-speech(pyttsx3).py ============
Traceback (most recent call last):
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\weakref.py", line 131, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/abhi/My Program/text-to-speech(pyttsx3).py", line 2, in <module>
engine = pyttsx3.init()
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in <module>
import win32com.client
File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os
ImportError: DLL load failed while importing win32api: The specified module could not be found.
>>>
Your code is no problem.
It can run successfully on my Windows 10, my python version is 3.7.3.
ImportError: DLL load failed while importing win32api: The specified module could not be found.
Your win32api module does not seem to be installed correctly, please use pip uninstall pywin32 to uninstall and use pip install pywin32 to install again.
You can also refer other methods in the link to solve it.
For KeyError: None, you can refer Python KeyError Exceptions and How to Handle Them to do some error handling.
Finally, please follow this tutorial to convert text to speech.
I sloved my own problem.
Firstly! I uninstalled Python-3.8 from control panel and installed Python-3.7.2(and added to path during installation).
Secondly,Upgraded setuptool using cmd -> pip install --upgrade setuptools.
after that I installed SpeechRecognition, pyttsx3
and after that I also installed
PyAudio-0.2.11-cp37-cp37m-win_amd64.whl using whl file(because pyaudio is necessary to run this program).
Link to download whl file-> Here .
Now, This program works.

Error occurs during installation of Robot Framework with Python on Windows 7

I have installed "python-3.3.0.msi" successfully and set up PATH as "C:\Python33;" on Windows 7. After that I tried to install Robot Framework by using "robotframework-2.7.7.win32.exe" (double click on the .exe file). At the last step of installation I found the following error:
File "<string>", line 35
except Exception, err:
^
SyntaxError: invalid syntax
I clicked on "Finish" button --> Installation wizard was disappeared. I set the PATH as "C:\Python33\Scripts". Then I checked the version by using the command "pybot --version" at command prompt. Below error was shown:
Traceback (most recent call last):
File "C:\Python33\lib\runpy.py", line 140, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "C:\Python33\lib\runpy.py", line 102, in _get_module_details
loader = get_loader(mod_name)
File "C:\Python33\lib\pkgutil.py", line 482, in get_loader
return find_loader(fullname)
File "C:\Python33\lib\pkgutil.py", line 499, in find_loader
pkg = importlib.import_module(pkg_name)
File "C:\Python33\lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 869, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "C:\Python33\lib\site-packages\robot\__init__.py", line 22, in <module>
from robot.rebot import rebot, rebot_cli
File "C:\Python33\lib\site-packages\robot\rebot.py", line 268, in <module>
from robot.conf import RebotSettings
File "C:\Python33\lib\site-packages\robot\conf\__init__.py", line 17, in <mo
from .settings import RobotSettings, RebotSettings
File "C:\Python33\lib\site-packages\robot\conf\settings.py", line 172
except EnvironmentError, err:
^
SyntaxError: invalid syntax
How can I solve the above error?
Robot Framework doesn't support Python 3 yet. You should try to use Python 2.7 instead. (Python 3 changes lots of things in the language syntax, including the syntax for catching exceptions shown in this traceback). So, follow the following installation steps:
Install Python2.7.3
Install robotframework2.7.7
set PATH as "C:\Python27\;C:\Python27\Scripts\"
Verify the installation by using the command "pybot --version" at command prompt. If everything is OK, the
following message will be displayed:
"Robot Framework 2.7.7 (Python 2.7.3 on win32)"
you should run "pip install robotframework-python3"
https://pypi.python.org/pypi/robotframework-python3

Resources