Accessing Python V2 packages on Pypi after Python V2 EOL - python-2.7

I'm trying to install a Python v2 package (yes, EOL, I know) and when when I do a pip install bezier) I get a message that hints that the other side is in Python V3:
>> pip2 install --user bezier
Collecting bezier
Downloading https://files.pythonhosted.org/packages/b9/0c/b1982f93c36fc06850a3880bb693bf24a047946633ca7403664836b9da9e/bezier-2020.5.19.tar.gz (313kB)
100% |████████████████████████████████| 317kB 2.4MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qgjAbR/bezier/setup.py", line 93
print(NUMPY_MESSAGE, file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-qgjAbR/bezier/
Is there a way to access the V2 packages (secret pip options or manual download+install)?
This would be for Ubuntu 19.04 and Ubuntu 16.04.

The last version supporting Python 2.7 is 0.9. So
pip install -U "bezier==0.9.0"
or
pip install -U "bezier<0.10.0"

Related

/bin/sh: mysql_config: not found while making docker image in django app [duplicate]

This is the error I get
(mysite)zjm1126#zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log
(mysite)zjm1126#zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log
What can I do to resolve this?
It seems mysql_config is missing on your system or the installer could not find it.
Be sure mysql_config is really installed.
For example on Debian/Ubuntu you must install the package:
sudo apt-get install libmysqlclient-dev
Maybe the mysql_config is not in your path, it will be the case when you compile by yourself
the mysql suite.
Update: For recent versions of debian/ubuntu (as of 2018) it is
sudo apt install default-libmysqlclient-dev
In Mac OS, I simply ran this in terminal to fix:
export PATH=$PATH:/usr/local/mysql/bin
This is the quickest fix I found - it adds it to the path, but I think you're better off adding it permanently (ie add it to /etc/paths) if you plan to install MySQL-python in another environment.
(tested in OSX Mountain Lion)
There maybe various answers for the above issue, below is a aggregated solution.
For Ubuntu:
$ sudo apt update
$ sudo apt install python-dev
$ sudo apt install python-MySQLdb
For CentOS:
$ yum install python-devel mysql-devel
apt-get install libmysqlclient-dev python-dev
Seemed to do the trick.
If you are on MAC
Install this globally
brew install mysql
then export path like this
export PATH=$PATH:/usr/local/mysql/bin
Than globally or in your venv whatever you like
pip install MySQL-Python
Note: globally for python3 as Mac can have both python2 & 3
pip3 install MySQL-Python
You can use the MySQL Connector/Python
Installation via PyPip
pip install mysql-connector-python
Further information can be found on the MySQL Connector/Python 1.0.5 beta announcement blog.
On Launchpad there's a good example of how to add-, edit- or remove data with the library.
For centos users:
yum install -y mysql-devel python-devel python-setuptools
then
pip install MySQL-python
If this solution doesn't work, and print gcc compile error like:
_mysql.c:29:20: error: Python.h: No such file or directory
You need to specify the path of Python.h, like this:
pip install --global-option=build_ext --global-option="-I/usr/include/python2.6" MySQL-python
I was trying to install mysql-python on an Amazon EC2 Linux instance and I had to install these :
yum install mysql mysql-devel mysql-common mysql-libs gcc
But then I got this error :
_mysql.c:29:20: fatal error: Python.h: No such file or directory
So I installed :
yum install python-devel
And that did the trick.
For anyone that is using MariaDB instead of MySQL, the solution is to install the libmariadbclient-dev package and create a symbolic link to the config file with the correct name.
For example this worked for me:
ln -s /usr/bin/mariadb_config /usr/bin/mysql_config
For Linux
this works for me
yum install python-devel mysql-devel
Try sudo apt-get build-dep python-mysqldb
OSX Mavericks
Due to changes within osx mavericks & xcode development tools you may get the error on installation
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
therefore use :
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python
for mariadb install libmariadbclient-dev instead of libmysqlclient-dev
sudo apt-get install libmariadbclient-dev
You should install the mysql first:
yum install python-devel mysql-community-devel -y
Then you can install mysqlclient:
pip install mysqlclient
I had the same problem in the Terraform:light container. It is based on Alpine.
There you have to install mariadb-dev with:
apk add mariadb-dev
But that one is not enough because also all the other dependencies are missed:
apk add python2 py2-pip gcc python2-dev musl-dev
sometimes the error depends on the actual cause. we had a case where mysql-python was installed through the python-mysqldb debian package.
a developer who didn't know this, accidentally ran pip uninstall mysql-python and then failed to recover with pip install mysql-python giving the above error.
pip uninstall mysql-python had destroyed the debian package contents, and of course pip install mysql-python failed because the debian package didn't need any dev files.
the correct solution in that case was apt-get install --reinstall python-mysqldb which restored mysql-python to its original state.
Sequence to be followed.
pip install mysqlclient
sudo apt-get install python3-dev libmysqlclient-dev
pip install configparser
sudo cp /usr/lib/python3.6/configparser.py /usr/lib/python3.6/ConfigParser.py
Then try to install the MYSQL-python again. That Worked for me
On Mac:
brew install mysql-client
locate mysql
mdfind mysql | grep bin
then add to path
export PATH=$PATH:/usr/local/Cellar/mysql-client/8.0.23/bin/
or permanently
echo "export PATH=$PATH:/usr/local/Cellar/mysql-client/8.0.23/bin/" >> ~/.zshrc
source ~/.zshrc
Had a similar issue trying to install on OS X Server 10.6.8. Here's what I had to do.
Using:
MySQL-python 1.2.4b4 (source)
MySQL-5.6.19 (binary installer)
Python 2.7 (binary installer)
NOTE: Installing in virtualenv...
Unzip source, open 'distribute_setup.py' and edit DEFAULT_VERSION to use the latest version of distribute tools, like so:
DEFAULT_VERSION = "0.6.49"
Save. Open 'site.cfg' file and uncomment the path to mysql_config so it looks something like (reference your own path to mysql_config):
# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.
mysql_config = /usr/local/mysql/bin/mysql_config
Now clean, build and make will not fail with the 'mysql_config' not found error.
Hope this helps someone else trying to make use of their old xserves :-)
Your sudo path does not know about your local path... go into superuser mode, add the path, and install it from there.
sudo su
export PATH=$PATH:/usr/local/mysql/bin/
pip install mysql-python
exit
And you're up and running on OSX. Now you have an updated global python.
if you install MySQL-python in your virtual env, you should check the pip version, if the version is older than 9.0.1, please update it
pip install --upgrade pip
write on 27 Aug, 2021
my macos version is BigSur(14.4), and mysql version is mysql8. It seems like in the higher version of mysql, they delete the my_config.h files but change to the mysql.h.
so your guys should run the following shell:
cd /usr/local/include/mysql
cp mysql.h my_config.h
after that, run pip install MySQL-python and everything will be ok.
on MacOS Mojave, mysql_config is found at /usr/local/bin/ rather than /usr/local/mysql/bin as pointed above, so no need to add anything to path.
In my case my database is running on container and my flask app is running on another container when i tried updating code app got broke with error
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-bya8e734/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-build-bya8e734/mysqlclient/setup_posix.py", line 65, in get_config
libs = mysql_config("libs")
File "/tmp/pip-build-bya8e734/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
Key in stack trace is
/bin/sh: 1: mysql_config: not found
because where my flask app is running doesn't have mysql client properly configured so first i installed mysql server and then install
sudo apt-get install mysql-server-5.7 -y
Then started MySQL
mansoor#LARC-mansur:~/Documents/clients/HR/DevopsSimulator/web$ sudo systemctl start mysql
Then install flask-mysql package and this time it worked
mansoor#LARC-mansur:~/Documents/clients/HR/DevopsSimulator/web$ sudo pip3 install flask-mysqldb
This is different case but posting here because may be someone else in the world facing same issue

How to install django with python3.9 on ubuntu aws

I'm having challenges installing django using the command sudo python3.9 -m pip install Django. The error I get running that command is:
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/pip/__main__.py", line 19, in <module>
sys.exit(pip.main())
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 242, in main
with self._build_session(
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 66, in _build_session
session = PipSession(
File "/usr/lib/python3/dist-packages/pip/download.py", line 321, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/lib/python3/dist-packages/pip/download.py", line 93, in user_agent
zip(["name", "version", "id"], platform.linux_distribution()),
AttributeError: module 'platform' has no attribute 'linux_distribution'
It's been a hard time trying to run sudo python manage.py migrate. From the comment/answer from this Stack Overflow post Traceback while running 'sudo python3 manage.py migrate' I got to know that I need python 3.6 and above. When I created the aws ubuntu server instance I ran python3 -V and the ouput was that python3.5 was running on the machine. I upgraded it to python 3.9. Now when I run python3 -V the output is: Python 3.9.4. After upgrading to python3.9 I created and activated another virtual enviroment.
Now when I try to install django using the command sudo python3.9 -m pip install Django I get the above error. If I use sudo python3 -m pip install Django the django is installed with python3.5 because, thereafter when I run sudo python3 manage.py migrate it throws back an error pointing to File "/usr/lib/python3.5/runpy.py", line 197, in _run_module_as_main If I delete python 3.5 in /usr/lib folder (since I still have python 3.9 there), python3.5 is recreated in the /usr/lib folder whenever I reinstall django using sudo python3 -m pip install Django (even if python3 -V is outputting Python 3.9.4). When I run sudo python3 manage.py migrate it says I don't have django installed in my enviroment variable.
Now the explanation is getting boring. PLEASE HOW DO I INSTALL DJANGO ON UBUNTU AWS USING PYTHON3.9?
sudo apt-get install python3-setuptools
sudo apt remove python3-pip
sudo python3.9 -m easy_install pip
then try to install django again
python3 -m pip install Django
Don't forget to create a virtual environment and specify the python version first
I later found out that it is not possible to run sudo python3.9 -m pip install Django. As stated in the stack overflow post found in the link Traceback while running 'sudo python3 manage.py migrate', python3.5 does not support it.
I had to install python3.6. I was able to use this python version to install django by runnig sudo python3.6 -m pip install Django.
I'm definitely not satisfied with these sorts of breaking changes that exist with python releases, but I'm glad I got the program running.

Why do I get syntax error when I try to do a pip install on CentOS 6?

I'm trying to install a python module called cymysql on a CentOS 6 system by commands like
yum install -y python-setuptools && easy_install pip && pip install cymysql
However I received an Error message saying there're a few lines got SyntaxError: invalid syntax ( see the error code as following)---It actually happened when I run the third command pip install cymysql
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==21.0', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 561, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2631, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2291, in load
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2297, in resolve
File "/usr/local/lib/python2.7/site-packages/pip-21.0-py2.7.egg/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Not so sure what's happening here, just wondering if anyone can help? (I enclosed the pip file and main.py here but I don't know where is the init.py file).BTW, It's centOS 6 but I have installed the Python 3.6.10 on the server.When I run the command python3.6 -V, I got
python3.6.10
FIY
PIP file Code:
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==21.0','console_scripts','pip'
__requires__ = 'pip==21.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==21.0', 'console_scripts', 'pip')() //**THIS IS LINE 11**
)
Line 57 to 62 in Main.py
try:
cmd_name, cmd_args = parse_command(args)
except PipError as exc:
sys.stderr.write(f"ERROR: {exc}") //**THIS IS LINE 60**
sys.stderr.write(os.linesep)
sys.exit(1)
&tldr;
On an RPM-based distro, you use RPM packages as much as possible.
Never run pip as root user
You must not use pip as root user (or asking for trouble).
There is a whole infrastructure of Python packages installable through yum and this is what you should use.
You can still use pip to install Python modules, but only in very rare cases when a Python module is not available as a package. In that case you must use pip inside a virtual Python environment. Your case is such.
Make sure you have fixed yum for base, EPEL and set up SCLO repositories, since CentOS 6 is EOL.
Then:
# Ensure EPEL repository
yum -y install epel-release
# fix EPEL repo due to EOL:
curl https://www.getpagespeed.com/files/centos6-epel-eol.repo --output /etc/yum.repos.d/epel.repo
yum -y install centos-release-scl-rh
# don't forget to fix repository configuration due to EOL:
curl https://www.getpagespeed.com/files/centos6-scl-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl.repo
curl https://www.getpagespeed.com/files/centos6-scl-rh-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
# install python 3.6 from Software collection packages (installing virtualenv will pick up both the base python and its pip package)
yum -y install rh-python36-python-virtualenv
Now you can create a virtual environment with any packages from pip, but you have to activate the software collection in your shell first, example:
. /opt/rh/rh-python36/enable
cd ${HOME}
# create "myapp" virtual environment
virtualenv myapp
# install desired packages using virtualenv's pip (will install to the virtualenv and not damage your system)
./myapp/bin/pip install cymysql
Do not go over pip version 20 on a Centos 6 system, otherwise wheels with precompiled c libraries will break.
Long story short, do this first:
pip install --upgrade pip==20.1.0
After that you can install cymysql

Install h5py without sudo

I'm trying to install h5py package via pip for python 2.7, I can't use sudo and I have python 3.2 installed too.
Here is my attemp:
I have installed pip:
curl -O https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py --user
then I installed wheel
~/.local/bin/pip2.7 install --user wheel
Collecting wheel
/home/myuser/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/home/myuser/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.29.0
Then installed h5py, seems it failed.
~/.local/bin/pip2.7 install --user h5py
Collecting h5py
Using cached h5py-2.5.0.tar.gz
/usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.py:3: UserWarning: Module pip was already imported from /home/myuser/.local/lib/python2.7/site-packages/pip/__init__.pyc, but /usr/lib/python2.7/dist-packages is being added to sys.path
from pkg_resources import Distribution, PathMetadata, ensure_directory
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in /usr/lib/python2.7/dist-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): Cython>=0.17 in /home/myuser/.local/lib/python2.7/site-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): six in /home/myuser/.local/lib/python2.7/site-packages (from h5py)
Building wheels for collected packages: h5py
Running setup.py bdist_wheel for h5py ... error
Complete output from command /usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-7KTR1Y/h5py/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpE1KVSupip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for h5py
Running setup.py clean for h5py
Failed to build h5py
Installing collected packages: h5py
Running setup.py install for h5py ... done
Successfully installed h5py-2.5.0
run python via python2.7
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import h5py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/myuser/.local/lib/python2.7/site-packages/h5py/__init__.py", line 23, in <module>
from . import _conv
File "h5py/h5r.pxd", line 21, in init h5py._conv (/tmp/pip-build-7KTR1Y/h5py/h5py/_conv.c:7356)
File "h5py/_objects.pxd", line 12, in init h5py.h5r (/tmp/pip-build-7KTR1Y/h5py/h5py/h5r.c:2941)
File "h5py/_objects.pyx", line 1, in init h5py._objects (/tmp/pip-build-7KTR1Y/h5py/h5py/_objects.c:7226)
ImportError: /home/myuser/.local/lib/python2.7/site-packages/h5py/defs.so: undefined symbol: H5Oexists_by_name
What I'm doing wrong?
Update:
~/.local/bin/pip2.7 show h5py
---
Metadata-Version: 1.1
Name: h5py
Version: 2.5.0
Summary: Read and write HDF5 files from Python
Home-page: http://www.h5py.org
Author: Andrew Collette
Author-email: andrew dot collette at gmail dot com
License: UNKNOWN
Location: /home/myuser/.local/lib/python2.7/site-packages
Requires: numpy, Cython, six
My OS is Ubuntu 12.04.1 LTS.
So there's a few things happening here:
Missing SSL certificate problems (see the urllib3 link)
setuptools not finding wheel, meaning a wheel isn't built, so pip calls python setup.py install directly
h5py is trying to use a function in HDF5 which does not exist in the version of HDF5 that's on your system.
1 and 2 are worth fixing (as they may be symptoms of other problems with the system), but 3 is the reason h5py isn't working for you.
h5py is trying to access H5Oexists_by_name. According to https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-ExistsByName, this first appeared in version 1.8.5 of HDF5. According to http://packages.ubuntu.com/source/precise/hdf5, the version of HDF5 on your system is 1.8.4 (but you need to check this!). Somehow h5py thinks the HDF5 library on you system is 1.8.5 or higher (see https://github.com/h5py/h5py/blob/4ee8f89b6dc658fdea5dc62d0f29058121928cfe/h5py/h5o.pyx#L172)
It looks like someone else has run into a similar problem, and filed https://bugs.launchpad.net/ubuntu/+source/hdf5/+bug/1418220. You probably want to inform them of your problem, so that they can produce a bug fix.

ImportError: No module named '_sqlite3' in python3.3

sqlite3 error
import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.3/sqlite3/dbapi2.py", line 26, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'
i use sqlite3 install command
pip install pysqlite
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/usr/local/lib/python3.3/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 98: invalid continuation byte
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/usr/local/lib/python3.3/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 98: invalid continuation byte
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pysqlite
Storing complete log in /root/.pip/pip.log
I am a Fedora 20 user. To solve this:
Install sqlite-devel package, using:
yum install sqlite-devel
After installing,recompile python from the source using:
./configure
make && make install
For multiple versions of Python, use altinstall instead of install.
I think it must be you not install sqlite3, you can do like this
sudo apt-get install sqlite3
sqlite3 -version
sudo apt-get install python-pysqlite2
sudo apt-get install python-pysqlite2-dbg
sudo apt-get install libsqlite3-dev
sudo apt-get install sqlite
sudo pip install pysqlite
then you will will find the sqlite3
For Python3 in Ubuntu:
sudo apt-get install libsqlite3-dev
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz (replace the version number by your python3 version)
tar -xf Python-3.6.3.tar.xz
cd Python-3.6.3/
./configure --enable-loadable-sqlite-extensions && make && sudo make install
refer: https://github.com/sloria/TextBlob/issues/173
The compile package is short of something,you should use yum to
install these 5,and then recompile and install python3
yum install readline-devel
yum install tk-devel
yum install tcl-devel
yum install openssl-devel
yum install sqlite-devel
and then recompile the python3
tar Jxvf Python-3.5.0.tar.xz
cd Python-3.5.0
./configure --prefix=/usr/local/python3
make && make install
I touched this problem in using compiled 3.5.7
wget https://www.python.org/ftp/python/3.5.7/Python-3.5.7.tgz
tar xvfz Python-3.5.7.tgz
cd Python-3.5.7
./configure --enable-optimizations
sudo make altinstall
# python3.5
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'
Solution:
yum install sqlite-devel
re-compile python 3.5 from source
Follow the below url to get ride of this error,
Centos-Sqlite3-Error-GCP