Spyder Python IDE unable to start consolle - anaconda

today, after a restart of my editor, I discovered that it is not able any more to run the consolle (using it on a daily since years).
In the consolle the following message appears:
Traceback (most recent call last):
File "C:\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py", line 23, in
start.main()
File "C:\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 253, in main
import_spydercustomize()
File "C:\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 43, in import_spydercustomize
import spydercustomize
ModuleNotFoundError: No module named 'spydercustomize'
My version of python is:
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
and from a Python prompt I can see this:
>>> import spyder
>>> spyder.__version__
'4.2.5'
>>>
Anybody has an idea of what could have happened and how to fix this without reinstalling everything?
P.S. I noticed that the substrings "site‑packages" in the message from the consolle contains a character alike "-" that is not interpreted by the windows file explorer (it can't find the folder). It looks like to be another kid of minus sign. The folder "C:\Anaconda3\Lib\site-packages\spyder_kernels\customize" and its content are actually present on my PC

Related

Pip not working; from 'ImportError: No module named urllib3' to non-admin windows user

I am facing some problems with pip. The original error message in my command prompt (windows, Python 2.7.14 and this is the version I must keep) when typing for instance pip was
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\python27\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ImportError: No module named urllib3
My journey to solve/explore the problem:
This happend no matter which of the following prompt commands I was trying
pip
pip --version
pip list
pip freeze
pip install --upgrade requests
pip install urllib3
Other commands might have change the error message a little bit in terms of the files listed like
python -m pip install --upgrade pip
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "C:\Python27\lib\runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "C:\Python27\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "C:\Python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ImportError: No module named urllib3
I have checked the following (according to several suggestions I found in related questions on stackoverflow)
a pip application can be found in C:\Python27\Scripts
dont have something called PYTHONPATH in system variables only Path
C:\Python27\Scripts is listed in system variables>Path
anaconda was installed by the user before me. I uninstalled as apparently this could cause troubles and deleted all remaining .condarc files,./conda & conda folders as well as the system variable>Path listing.
I have tried the solution which was voted for here by downloading and running python get-pip.py. This is the error message:
>python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 23974, in <module>
main()
File "get-pip.py", line 188, in main
tmpdir = tempfile.mkdtemp()
File "C:\Python27\lib\tempfile.py", line 331, in mkdtemp
dir = gettempdir()
File "C:\Python27\lib\tempfile.py", line 275, in gettempdir
tempdir = _get_default_tempdir()
File "C:\Python27\lib\tempfile.py", line 200, in _get_default_tempdir
with _io.open(fd, 'wb', closefd=False) as fp:
AttributeError: 'module' object has no attribute 'open'
I was told there were some problems noticed before: The computer has 2 users, an administrator and an additional user with '(user)' in its name. I was told that it was not possible to install anaconda for that user - it was installed by the administrator for all users but in the end spyder for instance and the anaconda prompt could only be ran as administrator, too. So I am not sure if there is a problem in general with the user setup?!
I ran the command prompt as administrator and pip --version worked
pip 9.0.1 from c:\python27\lib\site-packages (python 2.7)
So I ran python -m pip install --upgrade pip as administrator, opened the command prompt again (not as administrator and now the new error is
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "c:\python27\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "c:\python27\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "c:\python27\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 25, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "c:\python27\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "c:\python27\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "c:\python27\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 26, in <module>
import zipfile
File "c:\python27\lib\zipfile.py", line 501, in <module>
class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'
Tried step 3 again, same outcome
Now I am frustrated and I am hoping for help because I am not super experienced and I don't want to mess up things even more (probably already did by uninstalling anaconda).
Thank you for helping!
PS: I can not exclude that I did not miss the correct solution for this problem, as several topics are addressing pip and urllib3 already, however I have tried my best to cover all suggestions. I apologize if there is already a similar topic solving this problem out there.

Unable to open jupyter notebook using pip on windows

C:\Users\user>jupyter notebook
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\Scripts\jupyter-notebook.EXE_main.py", line 4, in
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\notebookapp.py", line 47, in
from zmq.eventloop import ioloop
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq_init.py", line 125, in
from zmq import backend
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend_init.py", line 32, in
raise original_error from None
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend_init_.py", line 27, in
_ns = select_backend(first)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend\select.py", line 36, in select_backend
raise ImportError(f"Importing {name} failed with {e}") from e
ImportError: Importing zmq.backend.cython failed with builtins.type size changed, may indicate binary incompatibility. Expected 888 from C header, got 880 from PyObject
I had the same problem and was able to rectify it by uninstalling the Jupyter notebook version that didn't work for me(5.0, 4.8) and installing a version that did work (4.0). I couldn't find this exact problem online but similar problems have occurred with NumPy module installations also fixed with a different version installation.
try:
pip uninstall notebook
pip install notebook==4.0

unable to start scrapyd in windows cmd

I am trying to start scrapyd in windows cmd using scrapyd, however error below occurred.
C:\Users\Zheyuuu>scrapyd
Traceback (most recent call last):
File "d:\anacaonda\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\anacaonda\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Anacaonda\Scripts\scrapyd.exe\__main__.py", line 5, in <module>
File "d:\anacaonda\lib\site-packages\scrapyd\scripts\scrapyd_run.py", line 3, in <module>
from twisted.scripts.twistd import run
File "d:\anacaonda\lib\site-packages\twisted\scripts\twistd.py", line 17, in <module>
from twisted.scripts._twistw import ServerOptions, \
File "d:\anacaonda\lib\site-packages\twisted\scripts\_twistw.py", line 8, in <module>
from twisted.application import app, service, internet
File "d:\anacaonda\lib\site-packages\twisted\application\internet.py", line 54, in <module>
from automat import MethodicalMachine
File "d:\anacaonda\lib\site-packages\automat\__init__.py", line 2, in <module>
from ._methodical import MethodicalMachine
File "d:\anacaonda\lib\site-packages\automat\_methodical.py", line 34, in <module>
#attr.s(frozen=True)
TypeError: attributes() got an unexpected keyword argument 'frozen'
I have been searching for solutions in google but unfortunatelly figure out why it happened. What's more, I have reinstalled scrapyd but it didn't work. My packages are below.
Scrapy (1.3.3)
scrapyd (1.2.0)
scrapyd-client (1.1.0)
Twisted (17.5.0)
Python: 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Well, I have solved it. The bug lies in Twisted. I reinstalled it and everything runs perfectly.

Tensorflow CPU Version installation error (DLL load fail) Win7, Python 3.5.0

Been struggling on this on for 3 days. I already have tensorflow working on 3 other mahcines but need to install this on a high performance CPU going forward.
Get following DLL Import error while trying to install tensorflow using pip.
Processor: Intel(R) Xeon(R) CPU
System Type: 64-bit
Based on other solutions i have already tried
Have followed all instructions on the Tensorflow installation page
have installed the Microsoft Visual C++ 2015 Redistributable Update
Tried with Conda Package after installing multiple Anaconda versions
Tried some alternate [whl][1] as I could not find my CPU in the AVX2
CPU List
Tried multiple individual versions (Python 3.5, 3.6, tensorflow
1.12.0, 1.9.0, 1.6.0 etc) (i.e. without anaconda)
pywrap_tensorflow_internal import
ImportError: DLL load failed with error code -1073741795
============================
(venv)
c:\software\Python35\venv\Lib\site-packages>echo %Path%
c:\software\Python35\venv\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\
System32\Wbem;C:\software\Python35;C:\software\Python35\venv\Lib\site-packages;
C:\software\Python35\venv\Lib\site-packages\tensorflow\include\tensorflow;C:\software\curl
(venv) c:\software\Python35>pip show tensorflow
Name: tensorflow
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: c:\software\python35\venv\lib\site-packages
Requires: termcolor, grpcio, keras-preprocessing, wheel, absl-py, six, numpy, ke
ras-applications, astor, tensorboard, protobuf, gast
Required-by:
(venv) c:\software\Python35>cd c:\software\python35\venv\lib\site-packag
es
(venv) c:\software\Python35\venv\Lib\site-packages>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
File "c:\software\Python35\venv\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "c:\software\Python35\venv\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\__init__.py",
line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-im
port
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\__init
__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
File "c:\software\Python35\venv\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "c:\software\Python35\venv\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code -1073741795
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Tried Python 3.6.0 install and Tensorflow 1.5.0. Got "google.protobuf.pyext import _message" error. So as per this I upgraded to 3.6.1. I am able to Import tensorflow now! So looks like i have to be with tensorflow 1.5.0 version

What does this stack trace tell me is wrong with my Tensorflow Installation

I have went through and installed CUDA, cuDNN, an followed the instructions to the best of my ability. I have added the environment variables I believe I need, but I still seem to have problems.
I have come as far as testing to see if tensorflow has been installed correctly. When pull up a command prompt, type python to use the shell, I type import tensorflow as tf.
I then get this stack trace, something I cannot make sense of to solve the problem myself. This is where I need the communities help:
>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File"C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 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\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit
Please try installing CUDA 9.0. the problem should be with the CUDA 9.1 version. You can download the driver from the following link : CUDA Toolkit 9.0
To uninstall CUDA:
Please run the following commands :
sudo apt-get --purge remove cuda
sudo apt autoremove
These commands should be able to uninstall cuda from your system.
If you have the cuDNN configured to work with GPU:
You can remove them just my deleting the files in the directories that you have copied to, during its setup.

Resources