I can't install "httpclient" for python - python

My OS is Windows7 32bit & I use VScode and python 3.6 32bit
When I tried
C:\python>pip install client
Collecting httpclient
Using cached httpclient-0.0.2.zip
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.19.tar.gz
Extracting in C:\Users\Public\Documents\ESTsoft\CreatorTemp\tmptrynwiem
Traceback (most recent call last):
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\distribute_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\setup.py", line 13, in <module>
use_setuptools()
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\distribute_setup.py", line 125, in _do_download_build_egg(egg, tarball, to_dir)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\distribute_setup.py", line 99, in _build_egg_extractall(tar)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\distribute_setup.py", line 467, in _extractallself.chown(tarinfo, dirpath)
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-b7pgq1re\httpclient\

The httplib module has been renamed to http.client in Python 3. You don't need to install http.client in python 3. It is pre-installed. So directly import it in your script as follows:
import http.client

Related

Error message displayed when python starts

I recently did
pip install --user sphinx-toolbox
Since then i get the following error message each time i run a python script:
Error processing line 1 of /home/jody/.local/lib/python3.9/site-packages/_sphinx_jinja2_compat.pth:
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.9/../../../lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/home/jody/.local/lib/python3.9/site-packages/sphinx_jinja2_compat/__init__.py", line 44, in <module>
import markupsafe # noqa: E402
ModuleNotFoundError: No module named 'markupsafe'
Remainder of file ignored
After this my scripts works normally.
How can i fix this issue?

Error importing theano library in python version 3.7.4 in linux

You can find the C code in this temporary file:
/tmp/theano_compilation_error_7_ntcw7n
Traceback (most recent call last):
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 81, in <module>
actual_version, force_compile, _need_reload))
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 105, in <module>
actual_version, force_compile, _need_reload))
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/__init__.py", line 110, in <module>
from theano.compile import (
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/__init__.py", line 12, in <module>
from theano.compile.mode import *
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/mode.py", line 11, in <module>
import theano.gof.vm
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/vm.py", line 674, in <module>
from . import lazylinker_c
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 140, in <module>
preargs=args)
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/cmodule.py", line 2396, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): /home/vaishnavnimkar/.theano/compiledir_Linux-5.2-2parrot1-amd64-x86_64-with-Parrot-4.7-stable--3.7.4+-64/lazylinker_ext/mod.cpp:1:10: fatal error: Python.h: No such file or directory. 1 | #include <Python.h>. | ^~~~~~~~~~. compilation terminated..
You need to install the python-dev extensions for proper header-files. For Debian distributions package is python3-dev which can be installed with apt-get. For Redhat distributions its python3-devel which might be installed with yum
I hope this should solve your problem.

On ubuntu ,TypeError: chown() missing 1 required positional argument: 'numeric_owner'

I'm trying install MySQL-python on my computer which os is ubuntu,but it have a
TypeError:TypeError: chown() missing 1 required positional argument: 'numeric_owner'
Detailed information:
ubuntua#ubuntua-Aspire-4736:~/Documents/MySQL-python-1.2.4b4$ python3 setup.py build
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmpuyexxhsu
Traceback (most recent call last):
File "/home/ubuntua/Documents/MySQL-python-1.2.4b4/distribute_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 7, in
use_setuptools()
File "/home/ubuntua/Documents/MySQL-python-1.2.4b4/distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/ubuntua/Documents/MySQL-python-1.2.4b4/distribute_setup.py", line 125, in _do_download
_build_egg(egg, tarball, to_dir)
File "/home/ubuntua/Documents/MySQL-python-1.2.4b4/distribute_setup.py", line 99, in _build_egg
_extractall(tar)
File "/home/ubuntua/Documents/MySQL-python-1.2.4b4/distribute_setup.py", line 486, in _extractall
self.chown(tarinfo, dirpath)
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
I don't know how to solve this problem.Who can help me?Thannks!
From the looks of it, it looks like you are trying to install MySQL-python with Python 3. MySQL-python is not supported in Python 3 - as stated here: https://pypi.python.org/pypi/MySQL-python/1.2.5
You may want to try mysqlclient instead : https://pypi.python.org/pypi/mysqlclient

Python - Sphinx: vague Import error

I am trying to generate API documentation from comments (in numpydoc style) in my project and I am stuck at vague import errors from sphinx:
/home/carbolymer/workspace/si-app/doc/source/scripts.rst:10: WARNING: autodoc: failed to import module 'scripts.backtest'; the following exception was raised:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 547, in import_object
__import__(self.modname)
File "/home/carbolymer/workspace/si-app/application/scripts/backtest.py", line 6, in <module>
from scipy import stats
File "/usr/lib/python3.5/site-packages/scipy/__init__.py", line 64, in <module>
from numpy import __version__ as __numpy_version__
ImportError: cannot import name '__version__'
/home/carbolymer/workspace/si-app/doc/source/scripts.rst:18: WARNING: autodoc: failed to import module 'scripts.importdb'; the following exception was raised:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 547, in import_object
__import__(self.modname)
File "/home/carbolymer/workspace/si-app/application/scripts/importdb.py", line 5, in <module>
from si.storage.dataimport import DataImport, database_drivers, sources
File "/home/carbolymer/workspace/si-app/application/si/storage/dataimport.py", line 6, in <module>
from si.storage.datasource.file import Stooq as StooqFile
File "/home/carbolymer/workspace/si-app/application/si/storage/datasource/file.py", line 19, in <module>
from si.storage.datasource.util import correct_prices
File "/home/carbolymer/workspace/si-app/application/si/storage/datasource/util.py", line 4, in <module>
def correct_prices(dataframe, calendar=PolishCalendar()):
File "/usr/lib/python3.5/unittest/mock.py", line 917, in __call__
return _mock_self._mock_call(*args, **kwargs)
File "/usr/lib/python3.5/unittest/mock.py", line 976, in _mock_call
result = next(effect)
StopIteration
Full log:
http://pastebin.com/tycmVQdN
I've tried mocking numpy.__version__ but it does not work. Also I have no clue what about the lines containing PolishCalendar() - why sphinx is trying to mock this object?
Because of those import errors, these files are missing in the documentation. How can I fix this?
My build command:
make clean ; sphinx-apidoc -a -f -o ./source ../application ; make html
Versions:
$ sphinx-build --version
Sphinx (sphinx-build) 1.5.1
$ python --version
Python 3.5.2
source/conf.py: http://pastebin.com/VfsiX4uZ

PIP Install Failing

I am learning Python and the documentation I am following suggested installing Firebird. I ran sudo pip install fdb.
I saw a build directory which I understand just contains the source code and not the binaries so I deleted that. When I do pip freeze | grep fdb, I cannot find Firebird.
I tried running sudo pip install fdb again and I am getting this error now (and the build directory is returning):
Downloading/unpacking fdb
Downloading fdb-0.9.9.tar.gz (481Kb): 481Kb downloaded
Running setup.py egg_info for package fdb
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/nayef/Documents/Django/build/fdb/setup.py", line 7, in <module>
from fdb import __version__
File "fdb/__init__.py", line 23, in <module>
from fdb.fbcore import *
File "fdb/fbcore.py", line 26, in <module>
from . import ibase
File "fdb/ibase.py", line 1164, in <module>
isc_attach_database = fb_library.isc_attach_database
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 366, in __getattr__
func = self.__getitem__(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 371, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, isc_attach_database): symbol not found
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/nayef/Documents/Django/build/fdb/setup.py", line 7, in <module>
from fdb import __version__
File "fdb/__init__.py", line 23, in <module>
from fdb.fbcore import *
File "fdb/fbcore.py", line 26, in <module>
from . import ibase
File "fdb/ibase.py", line 1164, in <module>
isc_attach_database = fb_library.isc_attach_database
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 366, in __getattr__
func = self.__getitem__(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 371, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, isc_attach_database): symbol not found
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /Users/nayef/Documents/Django/build/fdb
Storing complete log in /Users/nayef/Library/Logs/pip.log
What am I doing wrong here? I'm not sure what's wrong with pip. I never faced any issues with it.
This isn't pip failing, this is the fdb package installation failing.
It seems you have some drivers missing, specifically, the firebird header files.
Do you have firebird installed? Make sure you install the Python bindings only after the driver has been installed.

Categories