Python PIP broken trying to update - python

I tried to update pip today to version 20.0.2 from 19.2.3, but the install gave a huge error:
C:\Users\fizzy\Downloads\trivia-master>python -m pip install --upgrade pip
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
from pip._internal.models.search_scope import SearchScope
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\models\search_scope.py", line 11, in <module>
from pip._internal.utils.misc import normalize_path, redact_password_from_url
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3242, in <module>
def _initialize_master_working_set():
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3267, in _initialize_master_working_set
tuple(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3268, in <genexpr>
dist.activate(replace=False)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2776, in activate
declare_namespace(pkg)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2275, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2208, in _handle_ns
loader.load_module(packageName)
File "C:\Users\fizzy\Downloads\trivia-master\google.py", line 6, in <module>
from config import API_KEY, CSE_ID
ModuleNotFoundError: No module named 'config'
I ignored this error, thinking the new version happened to just not install, and tried to install LXML but gave this similar error:
C:\Users\fizzy\Downloads\trivia-master>pip install lxml
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
from pip._internal.models.search_scope import SearchScope
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\models\search_scope.py", line 11, in <module>
from pip._internal.utils.misc import normalize_path, redact_password_from_url
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3242, in <module>
def _initialize_master_working_set():
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3267, in _initialize_master_working_set
tuple(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3268, in <genexpr>
dist.activate(replace=False)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2776, in activate
declare_namespace(pkg)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2275, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2208, in _handle_ns
loader.load_module(packageName)
File "C:\Users\fizzy\Downloads\trivia-master\google.py", line 6, in <module>
from config import API_KEY, CSE_ID
ModuleNotFoundError: No module named 'config'
I can't reinstall pip either as it just gives me the same error when running pip uninstall pip. How do I fix this?

Related

Error: Traceback (most recent call last): while installing sckiti-learn package

While I was trying to install scikit-learn package, I got this error message:
Error: Traceback (most recent call last):
File "/snap/pycharm-professional/306/plugins/python/helpers/packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/configuration.py", line 26, in <module>
from pip._internal.utils.logging import getLogger
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 13, in <module>
from pip._internal.utils.misc import ensure_dir
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 40, in <module>
from pip._internal.locations import get_major_minor_version, site_packages, user_site
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/locations/__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "/home/ryuke/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
Notice: I was following this stack overflow link Getting PyCharm to import sklearn

Jupyter Lab not oppening - The process is being used by another process

Hey guys I am trying to open Jupyter Lab and install some packages from the command line and I get the following error, it looks like python is being used by other process.
Traceback (most recent call last):
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 92, in _tempfile
os.write(fd, reader())
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\abc.py", line 371, in read_bytes
with self.open('rb') as strm:
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_adapters.py", line 54, in open
raise ValueError()
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\Scripts\jupyter-lab.exe\__main__.py", line 4, in <module>
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab\labapp.py", line 15, in <module>
from jupyterlab_server import (
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\__init__.py", line 5, in <module>
from .app import LabServerApp
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\app.py", line 10, in <module>
from .handlers import LabConfig, add_handlers
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\handlers.py", line 18, in <module>
from .listings_handler import ListingsHandler, fetch_listings
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\jupyterlab_server\listings_handler.py", line 8, in <module>
import requests
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\__init__.py", line 147, in <module>
from . import packages, utils
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\utils.py", line 24, in <module>
from . import certs
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\certs.py", line 14, in <module>
from certifi import where
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 177, in _exec_module
notify_module_loaded(module)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\core.py", line 72, in where
_CACERT_PATH = str(_CACERT_CTX.__enter__())
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "C:\Users\loque\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 98, in _tempfile
_os_remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\loque\\AppData\\Local\\Temp\\tmpfsz7k7d8'
How can I fix this?
I try Re-installing python and even installing other versions, not working still :(
I also deleted all the contents in the Temp folders and once i run the code it creates a new temp file that uses the process.

Python permission denied

I am trying to run 'pip install notebook --upgrade' but I am getting this error. I have tried running as administrator but that does not fix the problem
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\pip.exe\__main__.py", line 4, in <module>
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 574, in _build_master
ws = cls()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 567, in __init__
self.add_entry(entry)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 623, in add_entry
for dist in find_distributions(entry, True):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2065, in find_on_path
for dist in factory(fullpath):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2127, in distributions_from_metadata
if len(os.listdir(path)) == 0:
PermissionError: [WinError 5] Access is denied: 'c:\\users\\administrator\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\~etuptools-49.2.1.dist-info'
Try running the cmd as admin. Then, try upgrading the modules. This could also happen when the installation was not done correctly or the module requires a certain version which could occur in 3.9 since it's new.

Kernel Restart (Ctrl+.) in spyder not working

I have recently updated my Anaconda and Spyder app! But in this new version of Spyder (version 4), when I restart the kernel (with short key and from console in above ribbon), the Restart kernel confirmation window shows up, Then I press the "yes" button but nothing happens.
Can anyone help me with this?
I have the same problem with Spyder 5.2.2 :
Spyder version: 5.2.2 None
Python version: 3.7.9 64-bit
Qt version: 5.12.10
PyQt5 version: 5.12.3
Operating System: Windows 10
When restarting the kernel, I get this:
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 7.31.1 -- An enhanced Interactive Python.
Restarting kernel...
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)
Traceback (most recent call last):
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fa125436\Miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\console\start.py", line 21, in <module>
import ipykernel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\ipykernel\connect.py", line 10, in <module>
import jupyter_client
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\__init__.py", line 125, in <module>
from zmq import backend
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 32, in <module>
raise original_error from None
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
File "C:\Users\fa125436\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\fa125436\AppData\Local\Programs\Spyder\pkgs\zmq\backend\cython\__init__.py)

pip install pyublas fails with `NameError: name 'sys_platform' is not defined`

Under Ubuntu 16.04 and Python 2.7.12 sudo -H pip install pyublas fails with the following stacktrace:
Collecting pyublas
Using cached PyUblas-2013.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
Extracting in /tmp/tmpnYhYMx
Now working in /tmp/tmpnYhYMx/distribute-0.6.35
Building a Distribute egg in /tmp/pip-build-vvsChR/pyublas
Traceback (most recent call last):
File "setup.py", line 248, in <module>
scripts = scripts,
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2237, in requires
dm = self._dep_map
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2466, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2499, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2496, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/tmp/tmpnYhYMx/distribute-0.6.35/_markerlib/markers.py", line 109, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/pip-build-vvsChR/pyublas/distribute-0.6.35-py2.7.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 143, in <module>
main()
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 29, in main
from aksetup_helper import hack_distutils, get_config, setup, \
File "aksetup_helper.py", line 3, in <module>
distribute_setup.use_setuptools()
File "distribute_setup.py", line 152, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 132, in _do_download
_build_egg(egg, tarball, to_dir)
File "distribute_setup.py", line 123, in _build_egg
raise IOError('Could not build the egg.')
IOError: Could not build the egg.
Following various related SO answers, I have confirmed that distribute is not installed, setuptools is up to date (setuptools (36.0.1)).
I have also tried manually running setup per this answer to no avail.

Categories