pip install xlwings fails - pip

I'm on MacOS Mojave Version 10.14.6, 2.8 GHz Intel Core i7 processor. Python version: 2.7.
"pip install xlwings" fails for me. I have tried to resolve this by upgrading setuptools with pip install -U setuptools
However, this does not fix the issue. The full error message for "pip install xlwings" is as follows:
Collecting xlwings
Using cached xlwings-0.16.6.tar.gz (634 kB)
Collecting psutil>=2.0.0
Using cached psutil-5.9.0.tar.gz (478 kB)
Collecting appscript>=1.0.1
Using cached appscript-1.2.0.tar.gz (289 kB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/setup.py'"'"'; __file__='"'"'/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/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 /private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-pip-egg-info-fmr2EU
cwd: /private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/setup.py", line 8, in <module>
raise RuntimeError("Python 3.x required.")
RuntimeError: Python 3.x required.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

xlwings declares appscript as a dependency but it doesn't limit version; appscript doesn't properly declare Python version compatibility (xlwings does it properly) so pip is trying to install the latest version which is not compatible with Python 2.7. Try to limit versions this way:
pip install "xlwings<0.17" "appscript<1.2"

Related

Error while installing "bincopy" -- pip install bincopy

C:\W2\build_files\project_specific\python_scripts>pip install bincopy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting bincopy
Using cached bincopy-17.8.0-py2.py3-none-any.whl (16 kB)
Collecting humanfriendly
Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting argparse-addons>=0.4.0
Using cached argparse_addons-0.6.0.tar.gz (3.5 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\hjvnk4\\appdata\\local\\temp\\pip-install-pqjrju\\argparse-addons\\setup.py'"'"'; __file__='"'"'c:\\users\\hjvnk4\\appdata\\local\\temp\\pip-install-pqjrju\\argparse-addons\\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\hjvnk4\appdata\local\temp\pip-pip-egg-info-i3avsj'
cwd: c:\users\hjvnk4\appdata\local\temp\pip-install-pqjrju\argparse-addons\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\hjvnk4\appdata\local\temp\pip-install-pqjrju\argparse-addons\setup.py", line 4, in <module>
import argparse_addons
File "argparse_addons.py", line 19
f'{string} is not in the range {self.minimum}..{self.maximum}')
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
C:\W2\build_files\project_specific\python_scripts>
The answer here is clear: you are using an unsupported Python (2.7). Newer versions of Python included new syntax, so you will find this kind of messages. There are 2 options to work around this:
Don't use the latest versions of packages and extensions. This is not a great idea, though. Do it if you really need Python 2.
Update your Python version. Consider Python 3.7 or greater.
Remove python2
sudo apt purge -y python2.7-minimal

How to use pip-tools to install from a github repo?

Here is a line in a req.in file (for pip-compile) to get a package from a github repository:
-e git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
Running pip-compile req.in gives a req.txt with
-e git+git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
Using pip to install (pip install -r req.txt) gives this error:
ERROR: Command errored out with exit status 1:
command: .../.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'.../.venv/src/django-editorjs-fields/setup.py'"'"'; __file__='"'"'.../.venv/src/django-editorjs-fields/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'"'"'))' develop --no-deps
cwd: .../.venv/src/django-editorjs-fields/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
I have setuptools (and in fact all the other libraries) installed. See, no errors:
$ .venv/bin/python -c 'import io, os, sys, setuptools, tokenize;'
$
If I install directly (without the -e) it works:
$ pip install git+git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
... (works)
But when I take the -e out of req.in, pip-compile complains:
$ pip-compile req.in
...
pip._internal.exceptions.InstallationError: Invalid requirement: 'git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields' (from line 1 of req.in)
Hint: It looks like a path. File 'git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields' does not exist.
What the heck, I'm trapped.
How do I put a github repo into req.in, compile it with pip-compile into req.txt, and pip install req.txt without errors?
I need it to work automatically because we have a toolchain that depends on it (github workflows, dependabot, ..).
I'm using python 3.9.1_2, pip 21.1.2, pip-tools 6.2.0 on OS X. Also happened with pip-tools 6.0.1 (not surprising).

Receiving an error when installing MariaDB via pip3 [duplicate]

This question already has answers here:
Python MariaDB pip install failed, missing mariadb_config
(3 answers)
Closed 2 years ago.
Im receiving an error when installing mairadb via pip3. Below is the command and error.
sudo pip3 install mariadb
------------------------------------------------------------------
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting mariadb
Using cached mariadb-1.0.0.tar.gz (78 kB)
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-z5vslgxx/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z5vslgxx/mariadb/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-hfv4vge6
cwd: /tmp/pip-install-z5vslgxx/mariadb/
Complete output (12 lines):
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-z5vslgxx/mariadb/setup.py", line 26, in <module>
cfg = get_config(options)
File "/tmp/pip-install-z5vslgxx/mariadb/mariadb_posix.py", line 49, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-z5vslgxx/mariadb/mariadb_posix.py", line 26, in mariadb_config
raise EnvironmentError(
OSError: mariadb_config not found.
Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
option, which should point to the mariadb_config utility.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have updated setuptools for pip via sudo pip3 install --upgrade setuptools to no avail. This error also occurs when trying to install most sql related modules for example mysql.
I am now able to install MariaDB 1.0.0 connector with no issues now. If you are receiving an OS error, install the mariadbclient-dev package with sudo apt-get install libmariadbclient-dev then you can install with pip3 install mariadb.

an error shows when I try to install submit50

C:\Users\BISMILLAH>pip install submit50
Collecting submit50
Using cached submit50-3.0.2.tar.gz (5.5 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\bismillah\appdata\local\programs\python\python36-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\BISMILLAH\\AppData\\Local\\Temp\\pip-install-enj227ls\\submit50\\setup.py'"'"'; __file__='"'"'C:\\Users\\BISMILLAH\\AppData\\Local\\Temp\\pip-install-enj227ls\\submit50\\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\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\pip-egg-info'
cwd: C:\Users\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\setup.py", line 2, in <module>
raise RuntimeError("submit50 does not support Windows directly. Instead, you should install the Windows Subsystem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install-win10) and then install submit50 within that.")
RuntimeError: submit50 does not support Windows directly. Instead, you should install the Windows Subsystem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install-win10) and then install submit50 within that.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Turns out submit50 doesn't run on Windows but this solution worked for me:
https://github.com/cs50/submit50/issues/196#issuecomment-617907204

Python3 I try to install lshash 0.0.4dev on windows 10

I am trying to install lshash 0.0.4dev
with pip install lshash on anconda promot
and I get this error:
enter image description here
(base) C:\Users\User>python -m pip install lshash
Collecting lshash
Using cached lshash-0.0.4dev.tar.gz (7.2 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-xq8e0vo7\\lshash\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-xq8e0vo7\\lshash\\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\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\pip-egg-info'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\setup.py", line 3, in <module>
import lshash
File "C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\lshash\__init__.py", line 12, in <module>
from lshash import LSHash
ImportError: cannot import name 'LSHash' from 'lshash' (C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\lshash\__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I hope someone can help me.
lshash 0.0.4dev was released on Apr 27, 2013. The project seems to be abandoned at the very early stage of development. The code is obviously Python2-only.
Try installing lshash3 instead
https://pypi.org/project/lshash3/

Resources