"pip install gevent" on windows gives IndexError - python-3.x

I'm trying to pip install grequests on Windows 10, but it errors out when it attempts to install gevent.
I'll be grateful for any clues on how to resolve this. (FWIW, I also tried pip --no-cache-dir install gevent, amongst other variants. They all failed the same way - please see below).
# pip3 --version
pip 20.0.2 from c:\users\username\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)
# python --version
Python 3.8.1
# pip3 install grequests
Collecting grequests
Using cached grequests-0.4.0-py3-none-any.whl (4.6 kB)Collecting gevent
Using cached gevent-1.4.0.tar.gz (5.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\username\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-_nbp9r04\\gevent\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-_nbp9r04\\gevent\\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\username\AppData\Local\Temp\pip-install-_nbp9r04\gevent\pip-egg-info'
cwd: C:\Users\username\AppData\Local\Temp\pip-install-_nbp9r04\gevent\
Complete output (113 lines):
Traceback (most recent call last):
File "c:\users\username\appdata\local\programs\python\python38\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:

Related

pip3 install fails on mac os

I am trying to install the ssl module using pip3 version 20.2.1 on Mac OS 10.14 which gives me the following error:
Command: pip3 install ssl
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nj/5mklr5y50b1d58zr4w_06k1c0000gp/T/pip-install-7az75aro/ssl/setup.py'"'"'; __file__='"'"'/private/var/folders/nj/5mklr5y50b1d58zr4w_06k1c0000gp/T/pip-install-7az75aro/ssl/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/nj/5mklr5y50b1d58zr4w_06k1c0000gp/T/pip-pip-egg-info-9we57qa4
cwd: /private/var/folders/nj/5mklr5y50b1d58zr4w_06k1c0000gp/T/pip-install-7az75aro/ssl/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/nj/5mklr5y50b1d58zr4w_06k1c0000gp/T/pip-install-7az75aro/ssl/setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Is this a problem with the ssl module itself?
You don't need to install the SSL package for Python 3. It is a built-in module.
The SSL package on Pypi explains its purpose:
The old socket.ssl() support for TLS over sockets is being superseded
in Python 2.6 by a new ‘ssl’ module. This package brings that module
to older Python releases, 2.3.5 and up (it may also work on older
versions of 2.3, but we haven’t tried it).

Issues Installing pdftotext on MacOS using Anaconda

I am newer to programming and am having trouble installing pdftotext in Anaconda, using Mac OS Mojave 10.14.6 and Python 3.6.7. I have installed all the dependencies recommended (https://github.com/jalan/pdftotext) but have not been able to successfully install pdftotext.
Errors include:
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3_/T/pip-install-ak3q4wz7/pdftotext/setup.py'"'"'; __file__='"'"'/private/var/folders/3_/T/pip-install-ak3q4wz7/pdftotext/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/3_/T/pip-install-ak3q4wz7/pdftotext/pip-egg-info
cwd: /private/var/folders/3_//T/pip-install-ak3q4wz7/pdftotext/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I ended up using pdftotext from poppler instead of the package listed above. This required the installation of poppler using conda-forge in Anaconda.
For Mac:
conda create -n envname python=3.7
conda activate envname
conda config --add channels conda-forge
conda install poppler
ModuleNotFoundError: No module named 'setuptools'
This suggests that you want to install at least one more dependency:
$ conda install setuptools
Or pip install, if you prefer.

Unable to install wsgiref in python 3.x

I can't install wsgiref in python 3. I got these errors.
I am using python 3, but I can't install wsgiref
I tried pip install wsgiref and pip install wsgiref==0.1.2
E:\CodeWork\Machine Learning\SWATI-The-Assistant-master\SWATI-The-Assistant-master>pip install wsgiref==0.1.2
Collecting wsgiref==0.1.2
Using cached https://files.pythonhosted.org/packages/41/9e/309259ce8dff8c596e8c26df86dbc4e848b9249fd36797fd60be456f03fc/wsgiref-0.1.2.zip
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-h2ydr_0e\\wsgiref\\setup.py'"'"'; __file__='"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-h2ydr_0e\\wsgiref\\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\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\pip-egg-info'
cwd: C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\setup.py", line 5, in <module>
import ez_setup
File "C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\ez_setup\__init__.py", line 170
print "Setuptools version",version,"or greater has been installed."
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Setuptools version",version,"or greater has been installed.")?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
The reason the pip 3 install is erroring is the syntax of one of the print statements in the setup process is old python 2 style with no parentheses. The good news is that wsgiref is already included in the python 3 library by default. Fire up a python 3 shell and try typing 'import wsgiref', that should succeed with no error.

Installing package using Pip install on MacOS 10.15

Using Python3.7.3, MacOS 10.15
Can't install package - feather
tried pip3 install feather
returns error:
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/setup.py'"'"'; __file__='"'"'/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/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: /private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/
Complete output (31 lines):
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
Traceback (most recent call last):
File "/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/distribute_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
All I'm trying to do is avoid this error in spyder
ModuleNotFoundError: No module named 'feather'
Can someone help me as to why I'm running into an issue like this
Looks like setuptools is missing.
Try pip3 install setuptools
this is where the error is reported.
# Setuptools 0.7b and later is a suitable (and preferable)
# substitute for any Distribute version.
try:
pkg_resources.require("setuptools>=0.7b")
return
except (pkg_resources.DistributionNotFound,
pkg_resources.VersionConflict):
pass
if not hasattr(pkg_resources, '_distribute'):
if not no_fake:
_fake_setuptools()
raise ImportError
What is the version number of setuptools?

install pymssql and cython fails on Mac OSX

I have python project. In the project i have requirements.txt file. while trying to install dependency from requirements file i am getting below error. I am using mac machine, python 3.6, Cython==0.29.3,pymssql==2.1.4
ERROR: Command errored out with exit status 1:
command: /Users/user_name/.virtualenvs/test/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/setup.py'"'"'; __file__='"'"'/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/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: /private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/
Complete output (7 lines):
/Users/user_name/.virtualenvs/test/lib/python3.6/site-packages/setuptools/dist.py:45: DistDeprecationWarning: Do not call this function
warnings.warn("Do not call this function", DistDeprecationWarning)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/setup.py", line 88, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
ERROR: Command errored out with exit status 1: python setup.py
egg_info Check the logs for full command output.
Able to figure out below are the steps,
brew install freetds
Then try to install requirements.txt file.
If still getting errors then follow . . the below steps.
pip install cython
pip install pymssql
then again try to install requirements.txt file.

Resources