why is my spyder IDE no longer opening - python

I just closed my spyder IDE on win7 64bit 64bit python2.7 after a long session.
during that last session, I had also installed a couple of new libraries via conda install. maybe that threw things off?
now when I try to start spyder again, the spyder splash screen appears briefly but then spyder doesn't open. if I try to start spyder from the command line, I get the following error:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\jlarsch>conda install spyder
Warning: could not import binstar_client (A 0.7-series setuptools cannot be inst
alled with distribute. Found one at c:\users\jlarsch\appdata\local\continuum\ana
conda\lib\site-packages\setuptools-20.7.0-py2.7.egg)Fetching package metadata: .
...
Solving package specifications: .........
# All requested packages already installed.
# packages in environment at C:\Users\jlarsch\AppData\Local\Continuum\Anaconda:
#
spyder 2.3.9 py27_0
C:\Users\jlarsch>spyder
Traceback (most recent call last):
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\Scripts\spyder-script.
py", line 2, in <module>
start_app.main()
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\start_app.py", line 114, in main
from spyderlib import spyder
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\spyder.py", line 137, in <module>
from spyderlib.ipythonconfig import IPYTHON_QT_INSTALLED
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\ipythonconfig.py", line 24, in <module>
required_version=IPYTHON_REQVER)
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\dependencies.py", line 70, in add
installed_version)]
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\dependencies.py", line 32, in __init__
self.installed_version = programs.get_module_version(modname)
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\spyd
erlib\utils\programs.py", line 238, in get_module_version
mod = __import__(module_name)
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\IPyt
hon\__init__.py", line 48, in <module>
from .terminal.embed import embed
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\IPyt
hon\terminal\embed.py", line 16, in <module>
from IPython.core.interactiveshell import DummyMod
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\IPyt
hon\core\interactiveshell.py", line 31, in <module>
from pickleshare import PickleShareDB
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\pick
leshare.py", line 41, in <module>
from path import path as Path
File "C:\Users\jlarsch\AppData\Local\Continuum\Anaconda\lib\site-packages\path
.py", line 126, in <module>
except pkg_resources.DistributionNotFound:
NameError: name 'pkg_resources' is not defined
seems related to this issue but I don't understand how I might be able to fix this on windows?

try this download setuptools from here and install.

Related

Error when analysing code (pylint) on Spyder

I use Spyder 5 (Python 3.7.9), although I also installed Python 3.9 but not with Spyder.
When I press F8 to run a Static Analysis Code, a message displays:
Traceback (most recent call last):
File "D:\obj\windows-release 37amd64_Release\msi_python\zip_amd64\runpy.py", line 193, in
_run_module_as_main
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 85, in
_run_code
File "C:\Program Files\Spyder\pkgs\pylintmain.py", line 9, in <<module> pylint.run_pylint()
File "C:\Program Files\Spyder\pkgs\pylint_init.py", line 21, in run_pylint from pylint.lint import Run as PylintRun
File "C:\Program Files\Spyder pkgs\pylint\lint_init.py", line 75, in <module> from pylint.lint.parallel import check_parallel
File "C:\Program Files\Spyder\pkgs\pylint\lint\parallel.py", line 7, in <module>
from pylint import reporters File "C:\Program Files\Spyder\pkgs\pylint\reportersinit.py", line 25, in <module>
from pylint import utils
File "C:\Program Files\Spyder\pkgs\pylint\utils_init__.py", line 45, in <module>
from pylint.utils.ast walker import ASTWalker
File "C:\Program Files\Spyder\pkgs\pylint\utils\ast_walker.py", line 6, in <module>
from astroid import nodes
File "C:\Program Files\Spyder\pkgs\astroidinit.py", line 46, in <module>
from pathlib import Path
ModuleNotFoundError: No module named 'pathlib'
Before installing Spyder 5 (I had Spyder 3), it worked, but since I've updated Spyder, it won't anymore.
Thank you!
(Spyder maintainer here) This is a bug in our Windows installer and we'll try to fix it in our next version, to be released in June.
It look like you're in fact using python2 and not python 3.7. Your default python might be python2 so you should try using python3 instead of python when launching commands, or try changing the default python for your system (if at all possible).

unable to open jupyter notebook using command prompt, tried installing again and again differently

I ran jupyter notebook and I'm getting the following error. Please help!
I checked the conda version, it's working fine. I added paths in the environment variables. I don't know why it isn't working. Previously it worked fine I recently uninstalled it and installed it again.
Traceback (most recent call last):
File "C:\Users\Admin\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\Admin\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\__init__.py", line 50, in <module>
from zmq import backend
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
getting this error,
please help!
There can be an issue with the 64bit version of Anaconda, Try these steps:
Install Anaconda 32 Bit for windows.
Add \Anaconda3 and \Anaconda3\Script to Path in Environment variables.
Open Anaconda Prompt and Create an Environment and activate it.
Once you activate the Environment, you will into it. Then write the command JUPYTER
NOTEBOOK, it should run on your Browser.
If that dose not work you can go back and install a bit older version of Anaconda and try doing the same.
Here for more help (:

Anaconda navigator not launching, not even through terminal

I installed the latest version of Anaconda on my Windows 10. After installing i tried to launch it but it wouldn't launch even after trying several times. I also tried to launch the jupyter notebook and spider shortcut that was created but even that didn't work. So I tried to run it using the terminal and this is the error I recieved:
UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
warnings.warn(
Traceback (most recent call last):
File "C:\Users\capta\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\capta\anaconda3\lib\site-packages\notebook\notebookapp.py", line 49, in <module>
from zmq.eventloop import ioloop
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\capta\anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
I also encountered this problem after I uninstalled the Microsoft Visual Studio C++ redistributable. It fixed (DLL error) after I installed Visual Studio 2015, 2017, and 2019.
You can find it on The latest supported Visual C++ downloads

I can't install any python package

When I'm trying to install any package using PyCharm terminal, I always get this error.
(venv) C:\Users\Mi\Desktop\MAIN\Coding\python>pip install PyMySQL
Traceback (most recent call last):
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\Scripts\pip-script.py",
line 11, in <module>
load_entry_point('pip==19.0.3', 'console_scripts', 'pip')()
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 489, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2793, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2411, in load
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2417, in resolve
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\base_command.py", line 20, in <module>
from pip._internal.download import PipSession
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\download.py", line 6, in <module>
from json import json
ImportError: cannot import name 'json' from 'json' (C:\Users\Mi\Anaconda3\lib\json\__
init__.py)
But when I use pip install the library is installed, but it still doesn't work in PyCharm.
Thanks for help! And sorry for my english.
you can try to download corresponding pacages in '.tar.gz' format on this link
manually unzip it
enter the unzipped folder
install the package through the following cmd command:
python setup.py install
here I suppose you are using windows and your python is above 3
If you are continuously encontering this problem,I suggest you alter the original download channel to a mirror.
If you installed the library through terminal and Pycharm still doesn't recognize the library, I think may be you should select the correct interpreter for the project by clicking the project interpreter at the bottom right in a Pycharm project. Look at the image in this
link. Click on the Interpreter which is named just "Python 3.x", it may work then.
["3.x" as in which version of python you are using]

Error while installing python setuptools for compiling pyOpenSSL

I want to use pyOpenSSL, which I have downloaded and tried to build, but I am having problems with setuptools.
First I have downloaded just python and used it with no success, but now I have tried with WinPython and got the same result, which is:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
from setuptools import setup
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\__init_
_.py", line 11, in <module>
from setuptools.extension import Extension
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\extensi
on.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\dist.py
", line 15, in <module>
from setuptools.compat import numeric_types, basestring
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\compat.
py", line 19, in <module>
from SimpleHTTPServer import SimpleHTTPRequestHandler
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\SimpleHTTPServer.py", line 27, i
n <module>
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\SimpleHTTPServer.py", line 208,
in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\mimetypes.py", line 358, in init
db.read_windows_registry()
File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\mimetypes.py", line 260, in read
_windows_registry
with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str
I have installed Python 2.7.6 with PyCharm with no success, and also tried WinPython with the same result.
I am running windows 7 x64.
Since you are facing problem in installing setuptools itself, you can download the windows binary file for setuptools from this link.
This website is a great repository of pre-compiled windows binaries for various Python modules.
If installing 64-bit Python is not a necessity, I would suggest you to install 32-bit version of Python and other modules.
This is related to a bug in Python 2.7.6, to do with Windows Registry corruption.
Some programs (wrongly) write a terminating null to registry entries and this screws up setuptools. Updating Python fixes the issue.
See This blog post

Categories

Resources