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.
Related
I am trying to install the 'mysql' package ( Version 0.0.2) , using pip install -r requirements.txt
But I am facing the following error:
Collecting mysql==0.0.2
Using cached mysql-0.0.2.tar.gz (1.9 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pwiwdipw/virtualenv/ITC/3.6/bin/python3.6_bin -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup;setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-yaqwy2z8
cwd: /tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/
Complete output (28 lines):
WARNING: `mysql` is a virtual package. Please use `%s` as a dependency directly.
running egg_info
creating /tmp/pip-pip-egg-info-yaqwy2z8/mysql.egg-info
writing /tmp/pip-pip-egg-info-yaqwy2z8/mysql.egg-info/PKG-INFO
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/setup.py", line 42, in <module>
url="https://github.com/valhallasw/virtual-mysql-pypi-package",
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/alt/python36/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 292, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 656, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 1106, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 188, in write_pkg_file
license = rfc822_escape(self.get_license())
File "/opt/alt/python36/lib64/python3.6/distutils/util.py", line 474, in rfc822_escape
lines = header.split('\n')
AttributeError: 'list' object has no attribute 'split'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar.gz#sha256=55e66b5e7b3823b1da5fb2a063e95a628fb850b2a0b76bdcd884faac5d2daa7d(from https://pypi.org/simple/mysql/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysql==0.0.2 (from versions: 0.0.1, 0.0.2, 0.0.3)
ERROR: No matching distribution found for mysql==0.0.2
Steps taken to try to solve the issue:
1.I have tried changing the versions , yet the package is still not installing.
2.Manually trying to install it , using pip install mysql==0.0.2, instead of installing from requirements.txt
How do I solve this?
Thank you
Please follow that package's instructions:
https://pypi.org/project/mysql
mysql 0.0.3
... or mysqlclient (Python 3) ...
Instead of depending on this package, please depend on the relevant package directly.
This means installing https://anaconda.org/conda-forge/mysqlclient ,
for which conda will install
both the pure python code and the binary dependencies.
Conda won't require you to have a working gcc compiler installed.
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.
From today, I started getting error while installing modules from requirements.txt, I tried to find the error module and remove it but I couldn't find.
Pillow
nospamplus
pymediainfo
apscheduler
howdoi
pyseoanalyzer
pokedex.py
faker
deep_translator
pornhub-api
countryinfo
emoji-country-flag
langdetect
PyProxyToolkit
cairosvg
grapheme
cryptosteganography
QScintilla
requests_html
flask
yahoo_fin
anime_downloader
pandas
PyDictionary
fontTools
pydub
quote
lottie
textblob
python-magic
glitch_this
PyGithub
pytesseract
youtube-dl
opencv-contrib-python
telethon
iplookup
wget
numpy
googletrans
pyshorteners
aiohttp
bs4
coffeehouse
cowpy
emoji
gTTS-token>=1.1.3
gTTS>=2.0.1
geopy
gitpython
google-api-python-client==1.8.0
google-auth-oauthlib
google_images_download>=2.7.1
gsearch
hachoir
heroku3
httplib2
humanize
lxml
lyricsgenius
oauth2client
psycopg2-binary
PyLyrics
pySmartDL
pybase64>=0.4.0
pyfiglet
pylast
python-barcode
python-dotenv
pytz
qrcode
regex
requests
search-engine-parser>=0.4.2
selenium
speedtest-cli>=2.0.2
sqlalchemy>=1.2
telegraph
tswift
urbandict>=0.5
wikipedia>=1.4.0
youtube-search
password_strength
pyjokes
cryptocompare
These are the modules.
Below is the error I get:
Collecting goslate
Downloading goslate-1.5.1.tar.gz (17 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u0eft0x8/goslate_a9d50754d502446c876c20f9eb75ad67/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u0eft0x8/goslate_a9d50754d502446c876c20f9eb75ad67/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-tybqx6p2
cwd: /tmp/pip-install-u0eft0x8/goslate_a9d50754d502446c876c20f9eb75ad67/
Complete output (26 lines):
running egg_info
creating /tmp/pip-pip-egg-info-tybqx6p2/goslate.egg-info
writing /tmp/pip-pip-egg-info-tybqx6p2/goslate.egg-info/PKG-INFO
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-u0eft0x8/goslate_a9d50754d502446c876c20f9eb75ad67/setup.py", line 19, in <module>
setup(
File "/usr/local/lib/python3.9/dist-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.9/dist-packages/setuptools/command/egg_info.py", line 292, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/usr/local/lib/python3.9/dist-packages/setuptools/command/egg_info.py", line 628, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/usr/lib/python3.9/distutils/dist.py", line 1117, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/usr/local/lib/python3.9/dist-packages/setuptools/dist.py", line 140, in write_pkg_file
write_field('Summary', single_line(self.get_description()))
File "/usr/local/lib/python3.9/dist-packages/setuptools/dist.py", line 124, in single_line
raise ValueError("newlines not allowed")
ValueError: newlines not allowed
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1
I tried to find and remove goslate module, but I couldn't find. Maybe this goslate is required by one of my modules.
Create a list of all the dependencies and run the following code.
for l in list:
print('checking for {}'.format(l))
url = 'https://pypi.org/pypi/{}/json'
json = requests.get(url.format(l)).json()
if json['info']['requires_dist'] is not None:
if 'goslate' in json['info']['requires_dist']:
print('found one ! : {}'.format(l))
this will check all if goslate is in any of the modules that you need.
got help from here How to list dependencies for a python library without installing?
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 ...
I am trying to install django-visits, but anytime I run the "pip install django-visits" command, I get the following error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\samuel\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-insta
ll-8t2j3cs9\\distribute\\setup.py'"'"'; __file__='"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-8t2j3cs9\\distribute\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3c
s9\distribute\pip-egg-info'
cwd: C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\dist.py", line 7, in <module>
from setuptools.command.install import install
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
How can I fix it?
Simply try pip3 install django-visits and see if it works. If not, follow the solution below.
I think this is because python3.7 and pip were installed from different sources.
I suggest using python's inbuilt facility to install pip i.e
python3 -m ensurepip --upgrade
This should install pip3 and pip3.x where x in python3.x.