Unable to install wsgiref in python 3.x - 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.

Related

Cannot install uwsgi thru pip install uwsgi using pycharms in Windows 10

Getting an error installing uWsgi using pycharms. I do not have Linux and most of the solutions I saw are using Linux. Any advice?
Executed command:
pip install uwsgi
Error occurred:
ERROR: Command errored out with exit status 1:
Command output:
Collecting uwsgi
Using cached uWSGI-2.0.19.1.tar.gz (803 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Sherman\Selenium\video_code\venv\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sherman\\AppData\\Local\\Temp\\pip-install-kmyfu2dr\\uwsgi_af87984b16b348968367e4dff1c9d244\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sherman\\AppData\\Local\\Temp\\pip-install-kmyfu2dr\\uwsgi_af87984b16b348968367e4dff1c9d244\\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\Sherman\AppData\Local\Temp\pip-pip-egg-info-1cos39nx'
cwd: C:\Users\Sherman\AppData\Local\Temp\pip-install-kmyfu2dr\uwsgi_af87984b16b348968367e4dff1c9d244\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Sherman\AppData\Local\Temp\pip-install-kmyfu2dr\uwsgi_af87984b16b348968367e4dff1c9d244\setup.py", line 3, in <module>
import uwsgiconfig as uc
File "C:\Users\Sherman\AppData\Local\Temp\pip-install-kmyfu2dr\uwsgi_af87984b16b348968367e4dff1c9d244\uwsgiconfig.py", line 8, in <module>
uwsgi_os = os.uname()[0]
AttributeError: module 'os' has no attribute 'uname'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
To make it work on windows 10, you will have to build uWSGI package by modifying some of its setup. Replacing os with platform
Alternatively, you can try waitress or uvicorn. Which work well in windows.

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).

Can't pip install egenix-mx-base

I am trying to create an exe from using pyinstaller with
python 3.8
windows 7
pip 20.1.1
78935 WARNING: Hidden import "mx.DateTime" not found!
I tried:
pip install egenix-mx-base
However I get this error:
Using cached egenix-mx-base-3.2.9.zip (74 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python38\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppDat
a\\Local\\Temp\\pip-install-5lbz35_k\\egenix-mx-base\\setup.py'"'"'; __file__='"
'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-5lbz35_k\\egenix-mx-base\\
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-pip-egg
-info-l5hzmpcw'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-ba
se\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-base
\setup.py", line 9, in <module>
import mxSetup, os
File "C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-base
\mxSetup.py", line 229
print 'running mxSetup.py with setuptools patched distutils'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('run
ning mxSetup.py with setuptools patched distutils')?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.
I tried all the solutions form this issue but nothing works:
https://github.com/pypa/pip/issues/8
egenix-mx-base is for Python2 only. For date/time manipulation there are enough other modules including modules from the stdlib: datetime, calendar, time.

Python3.7 installing http with pip3 not working

when running pip3 install http I get the following error:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w8rp368e/http/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w8rp368e/http/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-t6p61b0y
cwd: /tmp/pip-install-w8rp368e/http/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-w8rp368e/http/setup.py", line 3, in <module>
import http
File "/tmp/pip-install-w8rp368e/http/http/__init__.py", line 17, in <module>
from request import Request
ImportError: cannot import name 'Request' from 'request' (/home/.local/lib/python3.7/site-packages/request/__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
have the latest version of pip, requests and have tried all the found answers, but the error is still being thrown. Help would be much appreciated.
http, as in this package, was last updated in 2012 and was written for python 2. It therefore does not work in newer python versions.
But you can just use the http built-in module. See here. "built-in" means that it should be available in your python version already.
Try:
import http

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