Closed Sue-Fwl closed 3 years ago
Update: I tried solving one issue after the other: First there is the line:
Error processing line 3 of Anaconda3\lib\site-packages\googleapis_common_protos-1.52.0-py3.7-nspkg.pth
Opened the file and added a new line after each semicolon of this line:
import sys, types, os;
Next problem was so many missing modules and METADATA, I don't know why or how they suddenly disappeared !!:
ModuleNotFoundError: No module named 'requests'
No module named 'chardet'
\Anaconda3\lib\site-packages\numpy\__init__.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
six needed Numpy (for some reason it suddenly broke?!) -Re-install numpy/Remove it's folders/copy correct folders and replace
At this point conda is working fine, but calling spyder produce the following errors that I had to fix:
ModuleNotFoundError: No module named 'six'
FileNotFoundError: [Errno 2] No such file or directory: 'e:\\anaconda3\\lib\\site-packages\\idna-2.10.dist-info\\METADATA'
FileNotFoundError: [Errno 2] No such file or directory: 'e:\\anaconda3\\lib\\site-packages\\googleapis_common_protos-1.52.0.dist-info\\METADATA'
FileNotFoundError: [Errno 2] No such file or directory: 'e:\\anaconda3\\lib\\site-packages\\cachetools-4.1.1.dist-info\\METADATA'
ModuleNotFoundError: No module named 'pytz'
For all modules: Install it via python pip e.g: pip install googleapis-common-protos or copy it from python directory if installed there and had the METADATA file. or just download it separately and replace the ones in Anaconda folder.
Sometimes only the METADATA is missing so if the same package was downloaded in the python/lib/site-packages you can find the folder and copy from it the METADATA file and that solves the problem.
Hi @Sue-Fwl thanks for opening this and for your detailed explanation. I'm not sure what is the original reason for your problem, but now it seems that your working environment is broken due to mixing pip and conda package installation. I suggest you follow the steps on this video https://youtu.be/Ul79ihg41Rs for deleting your installation and starting a new one in the correct way to get back spyder working. In case the steps in this video don't work, please let us know.
When I launch python, the rectangled logo appears with "Initializing" on it. Then it closes and an error is displayed through anaconda prompt. I tried installing the missing module "urllib3" but
Requirement already satisfied: urllib3 in e:\anaconda3\lib\site-packages (1.25.10)
traceback for calling Spyder
Traceback (most recent call last):
File "E:\Anaconda3\Scripts\spyder-script.py", line 10, in <module>
sys.exit(main())
File "E:\Anaconda3\lib\site-packages\spyder\app\start.py", line 205, in main
mainwindow.main()
File "E:\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3651, in main
mainwindow = run_spyder(app, options, args)
File "E:\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3526, in run_spyder
main.setup()
File "E:\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 857, in setup
from spyder.plugins.completion.plugin import CompletionManager
File "E:\Anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 29, in <module>
from spyder.plugins.completion.kite.plugin import KiteCompletionPlugin
File "E:\Anaconda3\lib\site-packages\spyder\plugins\completion\kite\plugin.py", line 23, in <module>
from spyder.plugins.completion.kite.client import KiteClient
File "E:\Anaconda3\lib\site-packages\spyder\plugins\completion\kite\client.py", line 18, in <module>
import requests
File "E:\Anaconda3\lib\site-packages\requests\__init__.py", line 46, in <module>
from .exceptions import RequestsDependencyWarning
File "E:\Anaconda3\lib\site-packages\requests\exceptions.py", line 9, in <module>
from urllib3.exceptions import HTTPError as BaseHTTPError
ModuleNotFoundError: No module named 'urllib3.exceptions'
Hi @Sue-Fwl thanks for opening this and for your detailed explanation. I'm not sure what is the original reason for your problem, but now it seems that your working environment is broken due to mixing pip and conda package installation. I suggest you follow the steps on this video https://youtu.be/Ul79ihg41Rs for deleting your installation and starting a new one in the correct way to get back spyder working. In case the steps in this video don't work, please let us know.
Thanks for following up, was writing a follow up and didn't see your answer. I was trying to avoid uninstalling unless I have to.
@juanis2112 The video was very informative thank you! I reinstalled Spyder on a clean environment and glad to inform you that everything is working fine and I even found the last session reloaded!
However, I got a module import error when importing Keras:
ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`
And I just remembered that I had this error before running into all these issues, and that I upgraded Tensorflow using pip and didn't think much about it.
So should I now upgrade it through conda on my environment or should I follow the command?
After searching for an answer, I think "Keras requires TensorFlow 2.2 or higher" was a factor in producing this error. Because as I read TensorFlow is sometimes troublesome on Win.
I solved the issue by downgrading conda install Keras == 2.3.1
to match the ver of Tensorflow ==1.14.0 , then downloading conda install tensorflow-gpu==1.14.0
Related dep: numpy == 1.18.5
Now I'm not getting any errors, other than the same future warning I got at the beginning:
E:\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:
516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
If it's not a problem for my current setup, I would close this issue as resolved. Thanks.
If it's not a problem for my current setup, I would close this issue as resolved.
I don't think it is because it's a warning, not an error.
Appreciate your time.
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
(Not working)Problem Description
The issue started gradually on Spyder. First Spyder displayed issue submissions every time I launched it. Then I started getting warnings in the kernel about Type:1 attribute or variable error, but I didn't find a solution for it and it didn't affect my project execution.
Finally, Spyder just stopped responding to kernel commands and started lagging so I closed it and re-ran it but it didn't launch. Tried to launch it through conda and got the error. Conda stopped preforming any commands and the other applications on conda couldn't run anymore. (Jupyter) and just launching Anaconda prompt displays the error:
I tried the suggested solutions on other issues such as, removing Kite, and going back a revision (error):
Traceback (most recent call last): File "\Anaconda3\lib\site.py", line 168, in addpackage exec(line) File "", line 1, in
File "", line 580, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'
Remainder of file ignored Traceback (most recent call last): File "\Anaconda3\lib\site-packages\conda\gateways\connection__init__.py", line 21, in
from requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'requests'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in call return func(*args, **kwargs) File "\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 81, in do_call module = import_module(relative_mod, name.rsplit('.', 1)[0]) File "\Anaconda3\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 8, in
from .install import install
File "Anaconda3\lib\site-packages\conda\cli\install.py", line 19, in
from ..core.index import calculate_channel_urls, get_index
File "\Anaconda3\lib\site-packages\conda\core\index.py", line 10, in
from .package_cache_data import PackageCacheData
File "\Anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 14, in
from .path_actions import CacheUrlAction, ExtractPackageAction
File "\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 30, in
from ..gateways.connection.download import download
File "\Anaconda3\lib\site-packages\conda\gateways\connection__init__.py", line 39, in
from pip._vendor.requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'pip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "\Anaconda3\lib\site-packages\conda\gateways\connection__init__.py", line 21, in
from requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'requests'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "\Anaconda3\Scripts\conda-script.py", line 12, in
sys.exit(main())
File "\Anaconda3\lib\site-packages\conda\cli\main.py", line 152, in main
return conda_exception_handler(_main, *args, *kwargs)
File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1371, in conda_exception_handler
return_value = exception_handler(func, args, **kwargs)
File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1082, in call
return self.handle_exception(exc_val, exc_tb)
File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1126, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1137, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "\Anaconda3\lib\site-packages\conda\exceptions.py", line 1207, in print_unexpected_error_report
from .cli.main_info import get_env_vars_str, get_main_info_str
File "\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 19, in
from ..core.index import _supplement_index_with_system
File "\Anaconda3\lib\site-packages\conda\core\index.py", line 10, in
from .package_cache_data import PackageCacheData
File "\Anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 14, in
from .path_actions import CacheUrlAction, ExtractPackageAction
File "\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 30, in
from ..gateways.connection.download import download
File "\Anaconda3\lib\site-packages\conda\gateways\connection__init__.py", line 39, in
from pip._vendor.requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'pip'
I tried upgrading pip as I've seen some suggestions but conda ended up deleting pip! and it didn't allow me to install it after that
I installed pip through CMD and made sure pip-dscript.py was in Conda scripts, then tried to use it through Conda but got the same error:
What steps reproduce the problem?
Paste Traceback/Error Below (if applicable)
traceback for calling Spyder
Versions
Dependencies
conda info - is returing with an error issue to submit.