Python Urllib ContextualVersionConflict - python

Till Oct 20, it was fine. Oct 21, it failed with the below messages. Can any one help here
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i8sl36tr/elasticsearch-curator/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i8sl36tr/elasticsearch-curator/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-et0c4kgw
cwd: /tmp/pip-install-i8sl36tr/elasticsearch-curator/
Complete output (20 lines):
Traceback (most recent call last):
File "/tmp/pip-install-i8sl36tr/elasticsearch-curator/setup.py", line 39, in <module>
from cx_Freeze import setup, Executable
ModuleNotFoundError: No module named 'cx_Freeze'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-i8sl36tr/elasticsearch-curator/setup.py", line 177, in <module>
tests_require = ["mock", "nose", "coverage", "nosexcover"]
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 676, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 775, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (urllib3 1.24.3 (/tmp/pip-install-i8sl36tr/elasticsearch-curator/.eggs/urllib3-1.24.3-py3.7.egg), Requirement.parse('urllib3<1.26,>=1.25.4'), {'botocore'})
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```

On 19.10.2020 AWS released new botocore version 1.19.0.
So far versions 1.19.0, 1.19.1, 1.19.2 are not compatible with elasticsearch-curator - version 5.8.1.
I had same problem and temporary fixed issue by installing older version of elasticsearch-curator - version 5.6.0.
I believe AWS will soon release botocore version that is compatible with elasticsearch-curator - version 5.8.1.

It looks like your Python environment is inconsistent with the versions requires by your packages. Have you tried installing your environment with the --use-feature=2020-resolver flag?
python -m pip install --use-feature=2020-resolver elasticsearch elasticsearch-curator ...

Related

Unable to install pandas using Python3.8

When I try to install pandas on a Linux machine, I run into the below issue. Please let me know what dependency am I missing here or if there is any other issue.
The same command worked fine when I installed with Python3
Python version - Python3.8
# python3.8 -m pip install pandas
Collecting pandas
Using cached https://files.pythonhosted.org/packages/99/f0/f99700ef327e51d291efdf4a6de29e685c4d198cbf8531541fc84d169e0e/pandas-1.3.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in main
status = self.run(options, args)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 345, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 196, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 359, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 305, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 214, in prepare_linked_requirement
abstract_dist.prepare_distribution_metadata(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/distributions/source.py", line 70, in prepare_distribution_metadata
reqs = self.req.pep517_backend.get_requires_for_build_wheel()
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.py", line 70, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.py", line 162, in _call_hook
raise BackendUnavailable
pip._vendor.pep517.wrappers.BackendUnavailable
WARNING: You are using pip version 19.2.3, however version 21.3.1 is available.
When executed as python3.8 -m pip install --no-use-pep517 pandas, observing below issue -
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xt3n6dn0/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xt3n6dn0/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-xt3n6dn0/pandas/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 35, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Try:
python3.8 -m pip install --no-use-pep517 pandas
Maybe you should also upgrade pip and setuptools before:
python3.8 -m pip install -U pip setuptools
Try maybe
pip cache purge to clean all cached packages,
also you can try to install after the update of pip - pip install --upgrade pip.
If that does not help, try to make a virtual environment with your python3.8 and try to install packages inside that venv.

Python PIP issue when installing Ray - The wheel package is not available

I'm trying to install Ray - this can be done with a simple pip install ray
During the installation, packages get downloaded and installed correctly until it reaches gpustat
Python version: 3.8.7
OS: Linux (cflinuxfs3 to be more specific)
Here's the stacktrace
Downloading https://masked-package-path/packages/packages/b4/69/gpustat-0.6.0.tar.gz (78 kB)
ERROR: Command errored out with exit status 1:
command: /tmp/contents295671398/deps/0/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tdlwfmx8/gpustat/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tdlwfmx8/gpustat/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-4yij8vu9
cwd: /tmp/pip-install-tdlwfmx8/gpustat/
Complete output (22 lines):
WARNING: The wheel package is not available.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-tdlwfmx8/gpustat/setup.py", line 91, in <module>
setup(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
_install_setup_requires(attrs)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
dist = best[req.key] = env.best_match(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
return self.obtain(req, installer)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
return installer(requirement)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
return fetch_build_egg(self, req)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/installer.py", line 83, in fetch_build_egg
raise DistutilsError('the `allow-hosts` option is not supported '
distutils.errors.DistutilsError: the `allow-hosts` option is not supported when using pip to install requirements.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
**ERROR** Could not install pip packages: could not run pip: exit status 1
Also, I tried installing wheel (because the WARNING is saying it's missing) but no luck.
Any known issues regarding gpustat-0.6.0?
I had a similar error, but it was caused by gpustat's requirement for pytest-runner.
Running pip install pytest-runner fixed it for me. Just sharing in case anyone else has this problem.
Note: this was being done through a corporate proxy.

EROR when trying to download pygame on to python

I've tried lots of different ways of installing pygame and none work it always comes up with an error message.
I need this module for a game: I'm trying to make a multiplayer game for a project for school and online told me to use this module.
Any help would be great!! Also I've never put a question on here before so hope I'm doing it right! Thanks
C:\Users\RDSTw>py -m pip install pygame==2.0.0.dev6
Collecting pygame==2.0.0.dev6
Using cached pygame-2.0.0.dev6.tar.gz (3.7 MB)
ERROR: Command errored out with exit status 1:
command: 'C:\Python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RDSTw\\AppData\\Local\\Temp\\pip-install-lgh1zxp0\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\RDSTw\\AppData\\Local\\Temp\\pip-install-lgh1zxp0\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\RDSTw\AppData\Local\Temp\pip-pip-egg-info-ov5fgttm'
cwd: C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\
Complete output (31 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\setup.py", line 258, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\config.py", line 208, in main
deps = CFG.main(**kwds)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 17, in download_sha1_unzip
import requests
ModuleNotFoundError: No module named 'requests'
Making dir :prebuilt_downloads:
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This says that you don't have the requests module installed. So first install requests using pip install -U requests and then again install pygame. I also did it this way.

Error installing telethon with pip3 install telethon

When i try to install telethon from pip3 i got this error, why?
I run this in a windows 10 of 32 bits in the cmd.
C:\Users\JUAN>pip3 install telethon
Collecting telethon
Using cached Telethon-1.16.4-py3-none-any.whl (483 kB)
Collecting pyaes
Using cached pyaes-1.6.1.tar.gz (28 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\juan\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JUAN\\AppData\\Local\\Temp\\pip-install-i2of7eld\\pyaes\\setup.py'"'"'; __file__='"'"'C:\\Users\\JUAN\\AppData\\Local\\Temp\\pip-install-i2of7eld\\pyaes\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\JUAN\AppData\Local\Temp\pip-pip-egg-info-pffewwkh'
cwd: C:\Users\JUAN\AppData\Local\Temp\pip-install-i2of7eld\pyaes\
Complete output (24 lines):
Traceback (most recent call last):
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2867, in get_entry_map
ep_map = self._ep_map
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2825, in __getattr__
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\JUAN\AppData\Local\Temp\pip-install-i2of7eld\pyaes\setup.py", line 10, in <module>
setup(name = 'pyaes',
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 423, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 657, in <genexpr>
for entry in dist.get_entry_map(group).values()
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2869, in get_entry_map
ep_map = self._ep_map = EntryPoint.parse_map(
File "c:\users\juan\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2550, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I solved the problem by uninstalling python and pip, the python version I had was 3.8.5 and the latest version is 3.8.9.

Python : Failing to install scikit-learn (error code 1) on widows

I followed the instructions on the official sklearn website, and even if I fulfil the requirements I still cannot install sklearn. Here is the error message I get :
ERROR: Command errored out with exit status 1:
command: 'd:\others\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\anath\\AppData\\Local\\Temp\\pip-install-dnha64ok\\scikit-learn\\setup.py'"'"'; __file__='"'"'C:\\Users\\anath\\AppData\\Local\\Temp\\pip-install-dnha64ok\\scikit-learn\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\anath\AppData\Local\Temp\pip-record-s7idmuvg\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\
Complete output (44 lines):
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "d:\others\python\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\setup.py", line 290, in <module>
setup_package()
File "C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\setup.py", line 286, in setup_package
setup(**metadata)
File "d:\others\python\lib\site-packages\numpy\distutils\core.py", line 137, in setup
config = configuration()
File "C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\setup.py", line 174, in configuration
config.add_subpackage('sklearn')
File "d:\others\python\lib\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "d:\others\python\lib\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
config = self._get_configuration_from_setup_py(
File "d:\others\python\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 76, in configuration
maybe_cythonize_extensions(top_path, config)
File "C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\sklearn\_build_utils\__init__.py", line 42, in maybe_cythonize_extensions
with_openmp = check_openmp_support()
File "C:\Users\anath\AppData\Local\Temp\pip-install-dnha64ok\scikit-learn\sklearn\_build_utils\openmp_helpers.py", line 83, in check_openmp_support
ccompiler.compile(['test_openmp.c'], output_dir='objects',
File "d:\others\python\lib\distutils\_msvccompiler.py", line 360, in compile
self.initialize()
File "d:\others\python\lib\distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "d:\others\python\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "d:\others\python\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "d:\others\python\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
available_vc_ver
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\anath\\AppData\\Local\\Temp\\pip-installpip-install-dnha64ok\\scikit-learn\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\anath\AppData\Local\Temp\pip-record-s7idmuvg\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
It seems like there is a problem with numpy but I already updated to the latest version.
I'm on Windows 10, using Python 3.7, and numpy/scipy are up to date.
Thanks in advance !
Upgrade your python to 3.8 ,because 3.9.0 also have this installation issue.
I think your problem is with setuptools. Upgrade it using the following command:
pip3 install --upgrade setuptools
And then upgrade your scipy/numpy to the latest version :
pip3 install --upgrade numpy
Your C++ build tools are missing too. Get it from here: https://visualstudio.microsoft.com/visual-cpp-build-tools/
You can go to this site for Binaries for windows:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
here you can find required packages if you don't want to install C++ build tools

Categories

Resources