I am trying to install the pywin32 for my window service but unfortunately, I receive this error. I am also trying to install another module but the error was still the same. I'm wondering if it's a package error or python error as a whole. because even though I'm trying to install another module, the module 'typing' has attribute 'NoReturn' error has still appeared.
File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python36\Scripts\pip.exe\__main__.py", line 4, in <module>
File "c:\python36\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "c:\python36\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "c:\python36\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "c:\python36\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "c:\python36\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "c:\python36\lib\site-packages\pip\_internal\configuration.py", line 27, in <module>
from pip._internal.utils.misc import ensure_dir, enum
File "c:\python36\lib\site-packages\pip\_internal\utils\misc.py", line 38, in <module>
from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed
File "c:\python36\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 186, in <module>
class RetryError(Exception):
File "c:\python36\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 193, in RetryError
def reraise(self) -> t.NoReturn:
AttributeError: module 'typing' has no attribute 'NoReturn'
The NoReturn attribute was not added to the typing module until Python 3.6.2, you most likely have 3.6.0, which won't work. You'll need to upgrade to Python 3.6.2 or higher.
Related
when I try to start a new conda environment using
conda create --name myenv
and then
conda install -n myenv pip
and then I try use
pip
I get the following error message:
Traceback (most recent call last):
File "C:\Users\ese\Miniconda3\envs\myenv\Scripts\pip-script.py", line 6, in <module>
from pip._internal.cli.main import main
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_internal\exceptions.py", line 13, in <module>
from pip._vendor.requests.models import Request, Response
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\requests\__init__.py", line 43, in <module>
from pip._vendor import urllib3
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\__init__.py", line 11, in <module>
from . import exceptions
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\exceptions.py", line 3, in <module>
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\packages\six.py", line 234, in create_module
return self.load_module(spec.name)
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\packages\six.py", line 209, in load_module
mod = mod._resolve()
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\packages\six.py", line 118, in _resolve
return _import_module(self.mod)
File "C:\Users\ese\Miniconda3\envs\myenv\lib\site-packages\pip\_vendor\urllib3\packages\six.py", line 87, in _import_module
__import__(name)
File "C:\Users\ese\Miniconda3\envs\myenv\lib\http\client.py", line 71, in <module>
import email.parser
File "C:\Users\ese\Miniconda3\envs\myenv\lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "C:\Users\ese\Miniconda3\envs\myenv\lib\email\feedparser.py", line 27, in <module>
from email._policybase import compat32
File "C:\Users\ese\Miniconda3\envs\myenv\lib\email\_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "C:\Users\ese\Miniconda3\envs\myenv\lib\email\utils.py", line 29, in <module>
import socket
File "C:\Users\ese\Miniconda3\envs\myenv\lib\socket.py", line 51, in <module>
import _socket
ImportError: dynamic module does not define module export function (PyInit__socket)
I have tried reinstalling conda in my different versions and it keeps happening. I am actually having a feeling this might be related to having some weird restrictions on my company PC, but I am unsure. Anyone know how I could solve this? Thanks!
Traceback (most recent call last):
File "C:\Users\mohammadprgrm\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\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\mohammadprgrm\Desktop\py\env\Scripts\shub.exe\__main__.py", line 4, in <module>
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\tool.py", line 7, in <module>
from shub.utils import update_available
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\utils.py", line 42, in <module>
from scrapinghub import ScrapinghubClient, ScrapinghubAPIError, HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\__init__.py", line 13, in <module>
from .hubstorage import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\__init__.py", line 6, in <module>
from .client import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\client.py", line 8, in <module>
from .project import Project
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\project.py", line 3, in <module>
from .job import Job
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\job.py", line 2, in <module>
from .resourcetype import (ItemsResourceType, DownloadableResource,
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\resourcetype.py", line 5, in <module>
from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
That version of the scrapinghub package is evidently not compatible with Python 3.10.
Downgrade to Python 3.9, or upgrade the package to a new, compatible version if there is one which there may not be yet: https://github.com/scrapinghub/python-scrapinghub/issues/160
I created a new virtual environment, and installed a package (particularly, cvxpy). I ran some tests and it worked fine. Then, for no apparent reason, I started getting errors when running pip:
(.venv39a) PS D:\Dropbox\ariel-algorithms\cvxpy> python -m pip
Traceback (most recent call last):
File "C:\Users\user\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\user\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\cli\autocompletion.py", line 12, in <module>
from pip._internal.metadata import get_default_environment
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\metadata\__init__.py", line 3, in <module> from .base import (BaseDistribution, BaseEnvironment, FilesystemWheel,
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\metadata\base.py", line 22, in <module>
from pip._vendor.packaging.requirements import Requirement
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\packaging\requirements.py", line 12, in <module>
from pip._vendor.pyparsing import Combine
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\__init__.py", line 135, in <module>
from .common import _builtin_exprs as common_builtin_exprs
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\common.py", line 5, in <module>
from .helpers import any_close_tag, any_open_tag, delimited_list
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\helpers.py", line 5, in <module>
from . import __diag__
ImportError: cannot import name '__diag__' from partially initialized module 'pip._vendor.pyparsing' (most likely due to a circular import) (D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\__init__.py)
It says there is a circular import in pip itself - how can this be?
I tried to remove the virtual environment and re-install everything, but after some time, it happened again. How can I debug this strange circular import, in pip itself?
When I tried to install discord.py, I saw an error. When I simply enter the pip command, I see this error again . I tried other pip commands, result was same. I reinstalled python but it did not help.
Error:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\progress_bars.py", line 8, in <module>
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
ModuleNotFoundError: No module named 'pip._vendor.progress
If you don't have python 3.4 or later pip may not be installed.
To check if it is installed use:
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip --version.
If it isn't installed - follow this link: https://www.w3schools.com/python/python_pip.asp
Iv'e Looked and Looked and cannot figure out this problem. Pip will not work for anything at all and it is causing me much trouble. pip3 will work, but pip will not work at all. keeps spitting out this error having to do with cryptography module. other posts said to pip remove enum and pip install enum34, but the problem is that pip won't even allow me to do this. When I try to do anything with pip, it's spits out this error or similar.
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==18.1.dev0', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_internal/cli/cmdoptions.py", line 17, in <module>
from pip._internal.index import (
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_internal/index.py", line 14, in <module>
from pip._vendor import html5lib, requests, six
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_vendor/requests/__init__.py", line 97, in <module>
from pip._vendor.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip-18.1.dev0-py2.7.egg/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/crypto.py", line 12, in <module>
from cryptography import x509
File "/usr/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
from cryptography.x509.base import (
File "/usr/lib/python2.7/dist-packages/cryptography/x509/base.py", line 16, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/lib/python2.7/dist-packages/cryptography/x509/extensions.py", line 24, in <module>
from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
File "/usr/lib/python2.7/dist-packages/cryptography/x509/general_name.py", line 18, in <module>
from cryptography.x509.name import Name
File "/usr/lib/python2.7/dist-packages/cryptography/x509/name.py", line 28, in <module>
_ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)
TypeError: 'type' object is not iterable
Thank You Very Much
Try:
curl 'https://bootstrap.pypa.io/get-pip.py' -o get-pip.py
python get-pip.py --force-reinstall