Python3.7 installing http with pip3 not working - linux

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

Related

cannot import name '_jsonl' from partially initialized module 'jsonl'

I am trying to install the python jsonl module on an Ubuntu system. Tried on two different computers and get the same exact error:
pip install jsonl
Collecting jsonl
Downloading jsonl-1.6.tar.gz (9.0 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5lw5f9ew/jsonl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5lw5f9ew/jsonl/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-install-5lw5f9ew/jsonl/pip-egg-info cwd: /tmp/pip-install-5lw5f9ew/jsonl/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-5lw5f9ew/jsonl/setup.py", line 5, in <module>
import jsonl
File "/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py", line 19, in <module>
from jsonl import _jsonl as jsonl
ImportError: cannot import name '_jsonl' from partially initialized module 'jsonl' (most likely due to a circular import) (/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Any ides on how to fix this? As the same exact error occurs on two systems, I'm thinking it's a config error on my part, but no idea on how to resolve. Thanks!
jsonl, the latest version 1.6 was released in 2014. I can install it with Python 2.7 but not with Python 3. The bottom line: it's an outdated abandoned project, forget it.
Another problem: it requires simplejson but doesn't declare it as a dependency.

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.

Cannot install modules using pip - it gives an error

I uninstalled Python 3.8 and then installed Python 3.9.
Now, when I try to install any module using pip:
pip install pygame
It shows this error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\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\Acer\AppData\Local\Temp\pip-pip-egg-info-lgmfm8yh'
cwd: C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried uninstalling and installing Python again, but still no luck. I had no problem like this when I was using Python 3.8
When I tried installing Django, it worked but then I tried installing Pandas and it did not work.
Please help.
I think there are some compatibility issues with python3.9.
For more information,you can check this link.
https://github.com/pygame/pygame/issues/2145

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.

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.

Resources